[wxPython-users] Reducing the size of a BufferedDC

Alexander 'boesi' Bösecke boesi.josi at gmx.net
Sat Dec 16 12:10:24 PST 2006


Hi

Am 15.12.2006 02:55:51 schrieb Robin Dunn:

> Unless you are supplying your own buffer bitmap the buffered DC will use 
>   one that it creates internally.  In order to save the time needed to 
> create an initialize the bitmap each time a buffered DC is used, it will 
> save the last bitmap used and will reuse it again, unless it needs to 
> make a bigger one.  (This was added sometime in 2.7) 

Thanks for the info. Is there a way to delete the bitmap manually (if
memory usage is a concern)? Or is it removed by the GC at some time?

> Your dc.GetSize() call is just giving you the size of that bitmap.
> [...]
> Either supply your own bitmap that is the desired size, or pass the size 
> of the target DC to your drawing function and ignore the size of the 
> buffered DC.

Well that is what I'm doing now and it works ok. But isn't this a bit
confusing? You can even give the buffered DC an argument 'size' - that
makes it still more irritating. IMHO GetSize should return the size of
the target or there should be something like GetTargetSize...


cu boesi
-- 

Frueher hattet ihr die Freiheit zu entscheiden
Heute seid ihr von dieser Entscheidung befreit
                       .-==Report der Magd==-.




More information about the wxpython-users mailing list