[Pygui] Pixmap confusion
Greg Ewing
greg.ewing at canterbury.ac.nz
Wed Dec 15 23:37:12 CET 2010
Colin Brown wrote:
>
> I cannot understand how the same objects that
> are absolutely referenced to my
> main Window and also written to the Pixmap, appear row inverted when
> retrieved from the Pixmap
It's because Cocoa's default coordinate system for graphics
ports has the origin in the lower left with X upwards, like
Postscript. I need to invert the coordinate system to make
it match the window coordinates.
> The graphics
> positioning is upside down but the text
> drawing in the Pixmap is rightside up.
NSGraphicsContext has an isFlipped property that Cocoa uses
to flip the text. I need to get that set to True, although
that turns out not to be so straightforward for a graphics
context attached to a bitmap.
I'm making progress, though -- I've got both the text *and*
the graphics upside down now. :-)
--
Greg
More information about the Pygui
mailing list