ultimatepp/tutorial/Draw05/main.cpp
klugier 1ea99cbc68 Tutorial: Draw tutorial code modernization.
git-svn-id: svn://ultimatepp.org/upp/trunk@15464 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2020-11-20 00:43:27 +00:00

26 lines
504 B
C++

#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct MyApp : TopWindow {
Image image;
virtual void Paint(Draw& w) override {
w.DrawRect(GetSize(), Cyan());
w.DrawImage(10, 10, image);
}
MyApp() {
ImageDraw iw(100, 40);
iw.Alpha().DrawRect(0, 0, 100, 40, GrayColor(0));
iw.Alpha().DrawEllipse(0, 0, 100, 40, GrayColor(255));
iw.DrawEllipse(0, 0, 100, 40, Yellow());
iw.DrawText(26, 10, "Image", Arial(16).Bold());
image = iw;
}
};
GUI_APP_MAIN
{
MyApp().Sizeable().Run();
}