mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.upptst
git-svn-id: svn://ultimatepp.org/upp/trunk@15211 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d6ceddf9ae
commit
ef1839fba8
2 changed files with 46 additions and 0 deletions
10
upptst/PdfPainting/PdfPainting.upp
Normal file
10
upptst/PdfPainting/PdfPainting.upp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
uses
|
||||
CtrlLib,
|
||||
PdfDraw;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
36
upptst/PdfPainting/main.cpp
Normal file
36
upptst/PdfPainting/main.cpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
#include <Painter/Painter.h>
|
||||
#include <PdfDraw/PdfDraw.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
PdfDraw draw;
|
||||
|
||||
Size size=draw.GetPagePixels();
|
||||
Size DPI=draw.GetPixelsPerInch();
|
||||
|
||||
Rect drawrect=size;
|
||||
PaintingPainter dp(size);
|
||||
|
||||
dp.Clear(White());
|
||||
dp.Move(0,0);
|
||||
dp.Line(size.cx,size.cy);
|
||||
dp.Stroke(3,Black());
|
||||
dp.Move(0,size.cy);
|
||||
dp.Line(size.cx,0);
|
||||
dp.Stroke(3,Black());
|
||||
dp.Move(0,0).Line(size.cx,0).Line(size.cx,size.cy).Line(0,size.cy).Line(0,0);
|
||||
dp.Stroke(3,Black());
|
||||
|
||||
dp.Circle(size.cx/2,size.cy/2,min(size.cx,size.cy)/2).Stroke(2,Black());
|
||||
|
||||
draw.DrawPainting(drawrect,dp.GetResult());
|
||||
|
||||
SaveFile("d:/xxx/test.pdf", draw.Finish());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue