Hi Sam,

The canvas has PixelToWorld and WorldToPixel conversion functions.

So, having your fixed pixel coords, you can just redraw your objects at the 
recalculated world coords whenever you pan or zoom.

 
 
Vitor
http://fr0st.wordpress.com




----- Mensaje original ----
> De: Sam <[email protected]>
> Para: Mailing List for the wxPython Float Canvas. <[email protected]>
> Enviado: miércoles, 3 de junio, 2009 21:51:03
> Asunto: [fc] Using pixel coordinates for bitmap placement
> 
> Hi all
> Apologies if this has been asked previously but I had no luck searching 
> the archive.  I am using FloatCanvas to construct a mapping tool and my 
> world coordinates are in the projection I am using (NZTM).  This is all 
> working quite nicely but I wish to add scale and direction images such 
> that they are placed using pixel coordinates.  This is so they remain in 
> place unscaled as the user pans and zooms.  Is there a simple way of 
> doing this?  I have tried subclassing Bitmap (and creating a new 
> PixelBitmap class) where I have edited the _Draw function to not scale 
> the coordinates (pixel coordinates are passed in).  I don't see the 
> print message I put in the modified _Draw function and I don't get any 
> error messages and when I zoomtofit everything disappears (obviously the 
> pixel coords are still being treated as world coords, which is not what 
> I want!!).
> Any hints/ideas?
> Cheers, Sam :)
> _______________________________________________
> FloatCanvas mailing list
> [email protected]
> http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas



      
____________________________________________________________________________________
¡Obtén la mejor experiencia en la web!
Descarga gratis el nuevo Internet Explorer 8. 
http://downloads.yahoo.com/ieak8/?l=e1
_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to