X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11f406f91fb3faceb6e07853dec9c90cd3e15066..c944775f72435d2c0493113e05445898ab8baf1b:/src/msw/bitmap.cpp?ds=sidebyside diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index b942d9d61f..f3221c6e73 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -374,6 +374,8 @@ bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon, return true; #else // __WXMICROWIN__ || __WXWINCE__ wxUnusedVar(icon); + wxUnusedVar(transp); + return false; #endif // !__WXWINCE__/__WXWINCE__ } @@ -1087,8 +1089,14 @@ bool wxBitmap::SaveFile(const wxString& filename, // ---------------------------------------------------------------------------- // sub bitmap extraction // ---------------------------------------------------------------------------- +wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect ) const +{ + MemoryHDC dcSrc; + SelectInHDC selectSrc(dcSrc, GetHbitmap()); + return GetSubBitmapOfHDC( rect, (WXHDC)dcSrc ); +} -wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const +wxBitmap wxBitmap::GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const { wxCHECK_MSG( Ok() && (rect.x >= 0) && (rect.y >= 0) && @@ -1109,16 +1117,15 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const dcDst; { - SelectInHDC selectSrc(dcSrc, GetHbitmap()), - selectDst(dcDst, GetHbitmapOf(ret)); - - if ( !selectSrc || !selectDst ) + SelectInHDC selectDst(dcDst, GetHbitmapOf(ret)); + + if ( !selectDst ) { - wxLogLastError(_T("SelectObjct(hBitmap)")); + wxLogLastError(_T("SelectObject(destBitmap)")); } if ( !::BitBlt(dcDst, 0, 0, rect.width, rect.height, - dcSrc, rect.x, rect.y, SRCCOPY) ) + (HDC)hdc, rect.x, rect.y, SRCCOPY) ) { wxLogLastError(_T("BitBlt")); }