Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » Draw is final!
Re: Draw is final! [message #22496 is a reply to message #22495] Sun, 19 July 2009 16:06 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14256
Registered: November 2005
Ultimate Member
referece/ConsoleDraw:

#include <Painter/Painter.h>
#include <RichText/RichText.h>
#include <PdfDraw/PdfDraw.h>
#include <plugin/png/png.h>

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());
	}
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: U++ 2467 released
Next Topic: Tutoring Plan is out
Goto Forum:
  


Current Time: Fri May 02 14:13:57 CEST 2025

Total time taken to generate the page: 0.03743 seconds