[wxPython] wxMemoryDC problem?

Hi!

I create a memory DC to draw my DC in background and blit it to the screen DC:

       saveDC = wxMemoryDC()
       saveDC.SelectObject (wxEmptyBitmap (maxX, maxY))
       for obj in objList:
          obj.Draw (saveDC)

It works fine with maxX and maxY = 6000, but if I try it with 6200 I get an empty screen (empty memory DC).

I didn't chance any other code.
Is there a problem with large bitmaps?

Any suggestions would be appreciated,
Mike

Platform and versions?

It works fine with maxX and maxY = 6000, but if I try it with 6200 I get

an

empty screen (empty memory DC).

I didn't chance any other code.
Is there a problem with large bitmaps?

I don't know, but do you really want to use a 115MB chunk of memory when
you're only going to be displaying a small section of it at a time? (Or do
you have a display that big? If so then send one to me and I'll make it
work however you want! :wink:

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

Robin Dunn wrote:

> I didn't chance any other code.
> Is there a problem with large bitmaps?

I don't know, but do you really want to use a 115MB chunk of memory when
you're only going to be displaying a small section of it at a time? (Or do
you have a display that big? If so then send one to me and I'll make it
work however you want! :wink:

I have tried to do that in the past, in order to get fast scrolling, but
I ran into problems as well with really large bitmaps (long before I
should have had memory limitations) I never got a blank screen, but it
turned out not to be a good way to go anyway.

-Chris

···

--
Christopher Barker,
Ph.D.
ChrisHBarker@home.net --- --- ---
http://members.home.net/barkerlohmann ---@@ -----@@ -----@@
                                   ------@@@ ------@@@ ------@@@
Oil Spill Modeling ------ @ ------ @ ------ @
Water Resources Engineering ------- --------- --------
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------

Thats exactly what I tried...
My repaint is too slow if I redraw all while scrolling.

My version is Python 2.0 with wxPython 2.2.5 on Win2000.

Chris, how did you solve the problem?

Thanks,
Mike

···

At 10:00 19.06.2001 -0700, you wrote:

I have tried to do that in the past, in order to get fast scrolling, but
I ran into problems as well with really large bitmaps (long before I
should have had memory limitations) I never got a blank screen, but it
turned out not to be a good way to go anyway.

My repaint is too slow if I redraw all while scrolling.

My version is Python 2.0 with wxPython 2.2.5 on Win2000.

Take a look at wxPython/demo/ColourDB.py in 2.3.0 (or at
http://cvs.wxwindows.org/cgi-bin/viewcvs.cgi/wxPython/demo/ColourDB.py?rev=1
.2&content-type=text/vnd.viewcvs-markup if you don't want to update to 2.3.0
yet.)

In addition to showing off the extra colors that the colourdb library module
gives you it shows how to tile a background image that is sensitive to the
scrolled position of the window and also shows one approach to only drawing
the bits of the window that actually need refreshed. When a
wxScrolledWindow is scrolled then it is only the pixelsPerUnitX or
pixelsPerUnitY at the edge that need painted and so only drawing that part
really speeds it up a lot.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!