uppdev sync

git-svn-id: svn://ultimatepp.org/upp/trunk@780 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-01-17 12:52:42 +00:00
parent 142e17fbd1
commit 0a816262a9
4 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,11 @@
uses
CtrlLib,
Report,
Painter;
file
main.cpp;
mainconfig
"" = "GUI";

6
uppdev/Mirrors/init Normal file
View file

@ -0,0 +1,6 @@
#ifndef _Mirrors_icpp_init_stub
#define _Mirrors_icpp_init_stub
#include "CtrlLib/init"
#include "Report/init"
#include "Painter/init"
#endif

31
uppdev/Mirrors/main.cpp Normal file
View file

@ -0,0 +1,31 @@
#include <CtrlLib/CtrlLib.h>
#include <Report/Report.h>
#include <Painter/Painter.h>
using namespace Upp;
GUI_APP_MAIN
{
Font fnt = Arial(200);
Size isz = GetTextSize("M", fnt);
String letters = "sSzZEeDNB12345679kKrRLCc";
Report r;
Size page = r.GetPageSize();
r.DrawText(0, 0, letters, fnt);
for(int y = isz.cy * 2; y + isz.cy < page.cy; y += isz.cy * 2)
for(int x = 0; x < page.cx; x += isz.cx * 2) {
int ch = letters[rand() % letters.GetCount()];
PaintingPainter gw(isz.cx, isz.cy);
gw.Begin();
if((rand() & 3) == 0) {
gw.Translate(isz.cx, 0);
gw.Scale(-1, 1);
}
gw.Character((isz.cx - fnt.Info()[ch]) / 2, 0, ch, fnt).Fill(Black());
// gw.Rectangle(0, 0, isz.cx, isz.cy).Stroke(5, LtGray());
gw.End();
r.DrawPainting(x, y, isz.cx, isz.cy, gw);
}
Perform(r);
}

View file

@ -553,6 +553,19 @@ GUI_APP_MAIN
{
SetDefaultCharset(CHARSET_WIN1250);
PaintingPainter p(500, 800);
p.Clear(White());
p.Opacity(0.5);
PaintLion(&p, NULL);
PrinterJob job;
if(job.Execute()){
Draw &draw = job;
draw.StartPage();
draw.DrawPainting(0, 0, 4000, 6000, p);
draw.EndPage();
}
// BenchmarkImageFill();
#ifndef _DEBUG