Viewing images layed on top of each other

Please see my answers "==>>"
Thanks, I will look into floatcanvas.
Any other suggestions will be appreciated.

thanks

···

-----Original Message-----
From: Christopher Barker [mailto:Chris.Barker@noaa.gov]
Sent: Thursday, December 27, 2007 1:20 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Viewing images layed on top of each other

Karl Kobata wrote:

Please suggest step-by-step syntax to do the following:

That's an awful lot of functionality to ask us to write for you! But
here's some questions that may lead to help getting you started:

I would like to draw graphic drawings that can be overlayed on each
other. The graphics are initialized at the start of the application and
does not change.

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.

The selected layers will
be changed many times in many combinations.

And yet they do not change? I'm confused.
==>> 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.

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

If you're talking about vector graphics (where the objects are
mathematically defined) then wx.lib.FloatCanvas can help you a lot. (see
also the latest version from http://morticia.cs.dal.ca/FloatCanvas/)
==>> thanks, I will look into this also.

It could help with rater graphics too, but I'm not sure about
transparency. Transparent rasters have only recently had good support in
wx, and FloatCanvas pre-dates that -- it may take some tweaking.

-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@noaa.gov

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@noaa.gov

I wanted to thank you for point me to Floatcanvas.
I have integrated the canvas into our tool. The zoom, pan and origin in the
lower left is god sent.

I do have additional usage questions :
1) where can I find the details of the parameter options for all the AddXXX
functions for the canvas?
2) I am not sure how to use the group function that you mentioned in a
previous email. Will you point me to data/instructions/example?
2) do you have suggestions on how to print multiple lines of text stacked
onto each other spacing them by the font extent? Using the GetTextExtent
did not give me the correct spacing. Interested in your suggestion.

Thanks so much for your help.

karl

···

-----Original Message-----
From: Christopher Barker [mailto:Chris.Barker@noaa.gov]
Sent: Thursday, December 27, 2007 5:15 PM
To: Karl Kobata
Cc: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Viewing images layed on top of each other

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@noaa.gov