I try to get a bitmap of what my dc paints, but when I convert it to Image, I get
File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_gdi.py", line 618, in ConvertToImage return _gdi_.Bitmap_ConvertToImage(*args, **kwargs) wx._core.PyAssertionError: C++ assertion "bmp.Ok()" failed at ..\..\src\msw\dib.cpp(148) in wxDIB::Create(): wxDIB::Create(): invalid bitmap
It also gives the same error when trying to draw the mentioned bitmap on another dc. Therefore, I remember reading here about the method of storing ClientDC drawings in MemoryDC, then to clear ClientDC and draw the contents of MemoryDC back to it. How to do it?
source share