List of all members.
Public Member Functions
|MemoryDC (DC dc)|
|MemoryDC (IntPtr wxObject)|
|void||SelectObject (Bitmap bitmap)|
A bitmap must be selected into the new memory DC before it may be used for anything. Typical usage is as follows:
wx.MemoryDC temp_dc; temp_dc.SelectObject(test_bitmap); // We can now draw into the memory DC... // Copy from this DC to another DC. old_dc.Blit(250, 50, BITMAP_WIDTH, BITMAP_HEIGHT, temp_dc, 0, 0);
Selects the given bitmap into the device context, to use as the memory bitmap. Selecting the bitmap into a memory DC allows you to draw into the DC (and therefore the bitmap) and also to use wx.DC.Blit to copy the bitmap to a window. For this purpose, you may find wx.DC.DrawIcon easier to use instead.
If the argument is wx.NullBitmap (or some other uninitialised wx.Bitmap) the current bitmap is selected out of the device context, and the original bitmap restored, allowing the current bitmap to be destroyed safely.
Be careful to use this function and not SelectObjectAsSource when you want to modify the bitmap you are selecting otherwise you may incurr in some problems related to wx.Bitmap being a reference counted object (see reference counting overview).