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 » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Painter and transformations
Re: Painter and transformations [message #38854 is a reply to message #38852] Thu, 24 January 2013 10:06 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1310
Registered: September 2007
Ultimate Contributor
Well, thanks to Mirek I got te point :

the last translation (used to center drawing on control) happens on a rotated reference, so it's wrong :

	painter.Translate(-center);
	painter.Rotate(angle);
	painter.Translate(sz.cx / 2, sz.cy / 2); <--WRONG


The weird part is that matrix way worked because it is reversed too, as Mirek explained correctly; so, to achieve the purpose it's enough to reverse transformation order (explanation is quite complex, but it works) :

	painter.Translate(sz.cx / 2, sz.cy / 2); <--WRONG
	painter.Rotate(angle);
	painter.Translate(-center);


This one does exactly what the matrix version do.

Max

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How must Alpha be managed ??
Next Topic: Crash in Painter
Goto Forum:
  


Current Time: Thu Aug 28 10:44:07 CEST 2025

Total time taken to generate the page: 0.06919 seconds