+wxBitmap::wxBitmap(const wxBitmap& bitmap)
+{
+ wxIcon *icon = wxDynamicCast(&bitmap, wxIcon);
+ if ( icon )
+ {
+ HDC hdc = ::CreateCompatibleDC(NULL); // screen DC
+ HBITMAP hbitmap = ::CreateCompatibleBitmap(hdc,
+ icon->GetWidth(),
+ icon->GetHeight());
+ ::SelectObject(hdc, hbitmap);
+ ::DrawIcon(hdc, 0, 0, (HICON)icon->GetHICON());
+
+ ::DeleteDC(hdc);
+
+ SetHBITMAP((WXHBITMAP)hbitmap);
+ }
+ else
+ {
+ Ref(bitmap);
+ }
+
+ if ( wxTheBitmapList )
+ wxTheBitmapList->AddBitmap(this);
+}
+
+wxBitmap::~wxBitmap()