Large images in wx

HI,
I'm trying (again) to display large images in wxPython, Win32. The problem is that I can't seem to do it so that I can see an area larger than the screen size, i.e., 2048x768. The images are created OK, but scroll bars will only show/scroll that area.
The demo window can't be stretched larger either; even wxFrame(NULL, -1, "Hello from wxPython") can't stretch larger.
Where is the limitation coming from, and how can I get around it?

I want to create simple, but wide, scroll-able plots in a notebook or MDI app.
Ex:
                 image_data = bmpArray.tostring()
                 img = wxEmptyImage(self.dataPoints, height)
                 img.SetData(image_data)
                 bmp = img.ConvertToBitmap()
                 wxStaticBitmap(self.nb.xrcImgWindow, -1, bmp, wxPoint(0, 0),
                                wxSize(bmp.GetWidth(), bmp.GetHeight()))

>bmp.GetWidth(), bmp.GetHeight() --> 4000, 500

Ray

RJ wrote:

I'm trying (again) to display large images in wxPython, Win32. The problem
is that I can't seem to do it so that I can see an area larger than the
screen size, i.e., 2048x768. The images are created OK, but scroll bars
will only show/scroll that area.

I want to create simple, but wide, scroll-able plots in a notebook or MDI app.
Ex:
                 image_data = bmpArray.tostring()
                 img = wxEmptyImage(self.dataPoints, height)
                 img.SetData(image_data)
                 bmp = img.ConvertToBitmap()
                 wxStaticBitmap(self.nb.xrcImgWindow, -1, bmp, wxPoint(0, 0),
                                wxSize(bmp.GetWidth(), bmp.GetHeight()))

>bmp.GetWidth(), bmp.GetHeight() --> 4000, 500

this should be no problem is you use a wxScrolledWindow, and draw to it
with a DC, using, for instance, DC.DrawBitmap.

See the wxScrolledWindow demo, and adapt for your needs. You'll want to
derive from wxScrolledWindow, and have your image drawn in the OnPaint
method. If you have it stored in a Bitmap, there is no need for
Buffering, as the bitmap is your buffer. I've enclosed a small example,
and a jpg of my very cute daughter to test it.

-Chris

junk.py (1.72 KB)

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (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

Sorry about enclosing a jpeg with a recent note. I should know better.
Sorry to all with slow connections.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (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

Sorry about enclosing a jpeg with a recent note. I should know better.
Sorry to all with slow connections.

But cute kid, anyway :wink:

···

On Thu, 2003-06-26 at 12:02, Chris Barker wrote:

-Chris

--
Pay your respects to the vultures, for they are your future
                                                     -Coil