关于nana的介绍,可以查看《[GUI]nana GUI初尝试》,本文主要是分享其中UI的实现代码。 #include <tchar.h> #include <Windows.h> #include <iostream> #include <nana/gui/wvl.hpp> #include <nana/gui/basis.hpp> #include <nana/gui/widgets/label.hpp> #include <nana/gui/widgets/textbox.hpp> #include <nana/gui/widgets/combox.hpp> #include <nana/gui/widgets/button.hpp> #include <nana/paint/image.hpp> #include <nana/paint/graphics.hpp> #include <nana/gui/layout.hpp> #include <nana/gui/widgets/picture.hpp> int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { // 设置窗体属性 nana::gui::form my_form(nana::gui::API::make_center(450, 220), nana::gui::appearance(true, true, false, false, true, false, false)); my_form.caption(STR("Webpage2Image By eliteYang")); nana::gui::API::window_icon(my_form, nana::paint::image(STR("small.ico"))); // 窗体背景图 nana::paint::image image_bg; bool bOpen = image_bg.open(STR("bg.png")); nana::gui::drawing drawing_bg(my_form); drawing_bg.clear(); drawing_bg.bitblt(0, 0, 450, 220, image_bg, 0, 0); drawing_bg.update(); // 设置label显……

阅读全文