mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
Syncing uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@1058 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
567f3b84f2
commit
aa2166a0d9
26 changed files with 392 additions and 56 deletions
|
|
@ -3,44 +3,11 @@
|
|||
|
||||
using namespace Upp;
|
||||
|
||||
class ImageBuffer__ {
|
||||
protected:
|
||||
ImageBuffer ib;
|
||||
|
||||
public:
|
||||
ImageBuffer__(Size sz) : ib(sz) {}
|
||||
};
|
||||
|
||||
class ImagePainter : private ImageBuffer__, public BufferPainter {
|
||||
public:
|
||||
ImagePainter(Size sz, int mode = MODE_ANTIALIASED) : ImageBuffer__(sz), BufferPainter(ImageBuffer__::ib, mode) {}
|
||||
|
||||
Image GetResult() { return ImageBuffer__::ib; }
|
||||
operator Image() { return GetResult(); }
|
||||
};
|
||||
|
||||
class DrawPainter : public ImagePainter {
|
||||
Draw& w;
|
||||
|
||||
public:
|
||||
DrawPainter(Draw& w, int mode = MODE_ANTIALIASED);
|
||||
~DrawPainter();
|
||||
};
|
||||
|
||||
DrawPainter::DrawPainter(Draw& w, int mode)
|
||||
: ImagePainter(w.GetPagePixels(), mode), w(w)
|
||||
{}
|
||||
|
||||
DrawPainter::~DrawPainter()
|
||||
{
|
||||
w.DrawImage(0, 0, *this);
|
||||
}
|
||||
|
||||
struct App : TopWindow {
|
||||
void Paint(Draw& w) {
|
||||
DUMP(w.GetPagePixels());
|
||||
DUMP(GetSize());
|
||||
DrawPainter sw(w);
|
||||
DrawPainter sw(w, GetSize());
|
||||
sw.Clear(White());
|
||||
sw.Rectangle(0, 0, 100, 100).Stroke(2, Red());
|
||||
sw.Text(0, 0, "", Arial(20)).Fill(Blue());
|
||||
|
|
@ -51,4 +18,3 @@ GUI_APP_MAIN
|
|||
{
|
||||
App().Run();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue