+ if (m_pImage->IsKindOf(CLASSINFO(wxIcon)))
+ {
+ wxIcon* pIcon;
+
+ pIcon = wxDynamicCast(m_pImage, wxIcon);
+ pBitmap = new wxBitmap(*pIcon);
+ vDc.DrawBitmap(*pBitmap, 0, 0);
+ delete pBitmap;
+ }
+ else
+ {
+ pBitmap = wxDynamicCast(m_pImage, wxBitmap);
+ vDc.DrawBitmap(*pBitmap, 0, 0);
+ }
+} // end of wxStaticBitmap::OnPaint
+
+void wxStaticBitmap::SetImage( const wxGDIImage& rBitmap )
+{
+ int nX = 0;
+ int nY = 0;
+ int nWidth = 0;
+ int nHeight = 0;
+
+ Free();
+ ::WinSendMsg( GetHwnd()
+ ,SM_SETHANDLE
+ ,MPFROMHWND(rBitmap.GetHandle())
+ ,NULL
+ );
+ m_pImage = ConvertImage(rBitmap);
+
+ GetPosition(&nX, &nY);
+ GetSize(&nWidth, &nHeight);
+ // Convert to OS/2 coordinate system
+ nY = wxWindow::GetOS2ParentHeight(GetParent()) - nY - nHeight;
+
+ RECTL vRect;
+
+ vRect.xLeft = nX;
+ vRect.yTop = nY + nHeight;
+ vRect.xRight = nX + nWidth;
+ vRect.yBottom = nY;
+
+ ::WinInvalidateRect(GetHwndOf(GetParent()), &vRect, TRUE);