[wxPython-users] Viewing images layed on top of each other

Christopher Barker Chris.Barker at noaa.gov
Thu Dec 27 17:15:27 PST 2007


Karl Kobata wrote:
> Are these vector or raster (bitmap) graphics? Where are they coming from?
> ==>> I will be using wx.DC member functions such as DrawRectangle,
> DrawCircle, DrawLine, DrawText, etc.  No image read in from a file.

So you've got vector graphics.

> ==>> Sorry, I meant the layer(s) will be made visible.  I am using this
> method of overlay to visually compare 2 or more graphic drawings.  So the
> drawings do not change, just if they are visible or not.

got it.

>> In addition, I would like the ability to zoom on these drawings.

so you have a bunch of graphics defined in code, you need to draw them, 
turn them on/off, zoom and pan around -- this is EXACTLY the kind of 
thing that FloatCanvas was designed for. You'll save yourself a LOT of 
coding if you use it:

http://morticia.cs.dal.ca/FloatCanvas/

I recommend that you download the latest from SVN, take a look at the 
main demo "FloatCanvasDemo.py", and all this little demos in the 
"Demos". Then look at the mailing list archives. If you have any 
questions (you will - there are very few docs aside from the code 
itself), join the list and as there.

It does require numpy, but that's a fabulous package to know about anyway.

Note that there is no "layer" concept, but there is a "Group" object, 
which is almost the same. You can put a bunch of DrawObjects in a Group, 
then call MyGroup.Hide() and MyGroup.Show() however you need.

-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