+#if wxUSE_DIB_FOR_BITMAP
+ if ( bmp.IsDIB() )
+ {
+ DIBSECTION dib;
+ if( ::GetObject(GetHbitmapOf(bmp),
+ sizeof(dib),
+ &dib) == sizeof(dib) )
+ {
+ if ( ::StretchDIBits
+ (
+ GetHdc(),
+ xdest, ydest,
+ width, height,
+ xsrc, ysrc,
+ width, height,
+ dib.dsBm.bmBits,
+ (LPBITMAPINFO)&dib.dsBmih,
+ DIB_RGB_COLORS,
+ SRCCOPY
+ ) == GDI_ERROR )
+ {
+ wxLogLastError(wxT("StretchDIBits"));
+ }
+ }
+ else
+ {
+ wxLogLastError(wxT("GetObject"));
+ }
+ }
+ else
+#endif // wxUSE_DIB_FOR_BITMAP
+ {
+ BITMAPINFO *info = (BITMAPINFO *) malloc( sizeof( BITMAPINFOHEADER ) + 256 * sizeof(RGBQUAD ) );
+#if wxUSE_DRAWBITMAP_24BITS
+ int iBitsSize = (((width * 3) + 3 ) & ~3 ) * height;
+#else
+ int iBitsSize = ((width + 3 ) & ~3 ) * height ;
+#endif