+ if ( !Create(w, h, d) )
+ return false;
+
+ if ( !GetDIBSection(m_handle, &ds) )
+ {
+ // we've just created a new DIB section, why should this fail?
+ wxFAIL_MSG( _T("GetObject(DIBSECTION) unexpectedly failed") );
+
+ return false;
+ }
+
+ if ( !::GetDIBits
+ (
+ ScreenHDC(), // the DC to use
+ hbmp, // the source DDB
+ 0, // first scan line
+ h, // number of lines to copy
+ ds.dsBm.bmBits, // pointer to the buffer
+ (BITMAPINFO *)&ds.dsBmih, // bitmap header
+ DIB_RGB_COLORS // and not DIB_PAL_COLORS
+ ) )
+ {
+ wxLogLastError(wxT("GetDIBits()"));
+
+ return 0;
+ }