From c29fb4838196a023aef66067e0daeccf5428cb8f Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 8 Aug 2009 21:52:08 +0000 Subject: [PATCH] reference: Minor improvement of ConsoleDraw git-svn-id: svn://ultimatepp.org/upp/trunk@1479 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- reference/ConsoleDraw/main.cpp | 57 ++++++++++++++++------------------ 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/reference/ConsoleDraw/main.cpp b/reference/ConsoleDraw/main.cpp index 691218f99..614458148 100644 --- a/reference/ConsoleDraw/main.cpp +++ b/reference/ConsoleDraw/main.cpp @@ -1,31 +1,26 @@ -#include -#include -#include -#include - -using namespace Upp; - -void DoDraw(Draw& w) -{ - w.DrawRect(0, 0, 600, 200, White()); - w.DrawText(0, 0, "Hello world!", Arial(100), Black()); -} - -CONSOLE_APP_MAIN { - { - ImagePainter w(600, 100); - DoDraw(w); - PNGEncoder().SaveFile(GetHomeDirFile("hello.png"), w); - } - { - RichText txt = ParseQTF("[A4 Just a [*/ little] test!"); - ImagePainter w(1000, 200); - w.DrawRect(0, 0, 1000, 200, White()); - txt.Paint(w, 0, 0, 1000); - PNGEncoder().SaveFile(GetHomeDirFile("richtext.png"), w); - - PdfDraw pdf; - txt.Paint(pdf, 0, 0, 1000); - SaveFile(GetHomeDirFile("richtext.pdf"), pdf.Finish()); - } -} +#include +#include +#include +#include + +using namespace Upp; + +CONSOLE_APP_MAIN { + { + ImagePainter w(600, 100); + w.DrawRect(0, 0, 700, 250, White()); + w.DrawText(0, 0, "Hello world!", Arial(100), Black()); + PNGEncoder().SaveFile(GetHomeDirFile("hello.png"), w); + } + { + RichText txt = ParseQTF("[A4 Just a [*/ little] test!"); + ImagePainter w(1500, 200); + w.DrawRect(0, 0, 1500, 200, White()); + txt.Paint(w, 0, 0, 1500); + PNGEncoder().SaveFile(GetHomeDirFile("richtext.png"), w); + + PdfDraw pdf; + txt.Paint(pdf, 0, 0, 1000); + SaveFile(GetHomeDirFile("richtext.pdf"), pdf.Finish()); + } +}