]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/bitmap.cpp
allow the user to press Esc to close preview frame wherever the focus is, not only...
[wxWidgets.git] / src / msw / bitmap.cpp
index b942d9d61f0cf31f15ea648037fdd786168ee62d..f3221c6e73caaa8275e464ff1a1c7febb477b6d0 100644 (file)
@@ -374,6 +374,8 @@ bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon,
     return true;
 #else // __WXMICROWIN__ || __WXWINCE__
     wxUnusedVar(icon);
     return true;
 #else // __WXMICROWIN__ || __WXWINCE__
     wxUnusedVar(icon);
+    wxUnusedVar(transp);
+
     return false;
 #endif // !__WXWINCE__/__WXWINCE__
 }
     return false;
 #endif // !__WXWINCE__/__WXWINCE__
 }
@@ -1087,8 +1089,14 @@ bool wxBitmap::SaveFile(const wxString& filename,
 // ----------------------------------------------------------------------------
 // sub bitmap extraction
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // 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) &&
 {
     wxCHECK_MSG( Ok() &&
                  (rect.x >= 0) && (rect.y >= 0) &&
@@ -1109,16 +1117,15 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
               dcDst;
 
     {
               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,
         }
 
         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"));
         }
         {
             wxLogLastError(_T("BitBlt"));
         }