A memory device context provides a means to draw graphics onto a bitmap.
A bitmap must be selected into the new memory DC before it may be used for anything. Typical usage is as follows:
// Create a memory DC wxMemoryDC 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);Note that the memory DC must be deleted before a bitmap can be reselected into another memory DC.
See also wxBitmap, wxDC, wxCanvasDC.