mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 22:02:58 -06:00
Syncing uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@1949 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
87c9dbee46
commit
50745b3050
3 changed files with 64 additions and 0 deletions
10
uppdev/PainterImage/PainterImage.upp
Normal file
10
uppdev/PainterImage/PainterImage.upp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
uses
|
||||
CtrlLib,
|
||||
Painter;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
5
uppdev/PainterImage/init
Normal file
5
uppdev/PainterImage/init
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ifndef _PainterImage_icpp_init_stub
|
||||
#define _PainterImage_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#include "Painter/init"
|
||||
#endif
|
||||
49
uppdev/PainterImage/main.cpp
Normal file
49
uppdev/PainterImage/main.cpp
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
#include <Painter/Painter.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
namespace Upp {
|
||||
Image DownScale(const Image& img, int nx, int ny);
|
||||
};
|
||||
|
||||
struct App : TopWindow {
|
||||
void Paint(Draw& w) {
|
||||
Size sz = GetSize();
|
||||
ImageDraw idw(1200, 600);
|
||||
idw.DrawRect(0, 0, 1200, 600, White);
|
||||
idw.DrawText(0, 0, "(Hello)", Serif(400));
|
||||
|
||||
|
||||
#if 0
|
||||
Image m = idw;
|
||||
Size isz = m.GetSize();
|
||||
m = DownScale(m, isz.cx / sz.cx, isz.cy / sz.cy);
|
||||
w.DrawRect(sz, White());
|
||||
w.DrawImage(0, 0, m);
|
||||
#endif
|
||||
|
||||
DrawPainter sw(w, GetSize());
|
||||
sw.Clear(White());
|
||||
sw.DrawImage(0, 0, sz.cx, sz.cy, idw);
|
||||
}
|
||||
};
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
ImageDraw idw(1200, 600);
|
||||
idw.DrawRect(0, 0, 1200, 600, White);
|
||||
idw.DrawText(0, 0, "(Hello)", Serif(400));
|
||||
|
||||
DrawingDraw dw(350, 250);
|
||||
dw.DrawImage(0, 0, 350, 250, idw);
|
||||
|
||||
QtfRichObject pict(CreateDrawingObject(dw.GetResult(), Size(350, 250), Size(350, 250)));
|
||||
|
||||
// /**/ PNGEncoder png;
|
||||
// /**/ png.SaveFile("c:\\kk.png", pict.obj.ToImage(Size(350, 250)));
|
||||
|
||||
PromptOK(String("[A5 Rendering problem: ") + pict.ToString());
|
||||
|
||||
App().Sizeable().Run();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue