PDA

View Full Version : Cartesian coordinate system in QPaint



graciano
27th February 2013, 12:19
Hi
His there a way to change de default coordinate system of a QPaintDevice so that if works like a Cartesian coordinate system in QPainter, with (0,0) as the center?

^NyAw^
27th February 2013, 12:26
Hi,

Take a look at Coordinate System on Window-Viewport Conversion coordsys.html.

wysota
27th February 2013, 12:44
QPainter p(this);
p.translate(width()/2, height()/2);
p.scale(1, -1);

Note that such transformations will slow down drawing.