/
dinruspro
/
tutorial
Обзор
Документация
Войти
/
dinruspro
/
tutorial
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
Image04/main.cpp
41 строка
647 B
EnergonV
Уроки теперь тоже здесь!
09 янв 2024, 19:25
09 янв 2024, 19:25
4b3ebd6
Код
Авторство
О чём код?
#include <CtrlLib/CtrlLib.h> using namespace Upp; struct MyApp : public TopWindow { Image img; FileSel fs; MyApp() { fs.Type("Image file", "*.bmp;*.png;*.tif;*.tiff;*.jpg;*.jpeg;*.gif"); Sizeable(); } void Paint(Draw& w) override { w.DrawRect(GetSize(), White); if(img) { w.DrawImage(0, 0, img); } else { w.DrawText(0, 0, "No image loaded!", Arial(30).Italic()); } } void LeftDown(Point, dword) override { Open(); } void Open() { if(fs.ExecuteOpen("Choose the image file to open")) { img = StreamRaster::LoadFileAny(~fs); Refresh(); } } }; GUI_APP_MAIN { MyApp app; app.Open(); app.Run(); }