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()))
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.