+
+ // Check if the bitmap has the correct depth for this device context
+ if (bitmap.Ok() && (bitmap.GetDepth() != GetDepth()))
+ {
+ // Make a new bitmap that has the correct depth.
+ wxBitmap newBitmap = bitmap.GetBitmapForDC(* this);
+
+ m_selectedBitmap = newBitmap ;
+ }
+ else
+ {
+ m_selectedBitmap = bitmap;
+ }