[wxPython-users] What does PrepareDC do in OGL example?

Christopher Barker Chris.Barker at noaa.gov
Wed Jan 16 10:17:02 PST 2008


Armando Serrano Lombillo wrote:
> canvas.PrepareDC(dc)

>  "Call this function to prepare the device context for drawing a scrolled image", 

exactly. If your image is on a scrolled window, then you have two 
coordinate systems -- the "virtual" one and the actual pixel coords of 
the window in its current position. PrepareDC() sets up the DC to deal 
with that, so you can draw in the virtual coordinate system.

It may be that you've tested in only when the image wasn't scrolled, so 
it didn't make a difference then.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list