- ::StretchDIBits( memdc, 0, origin, width, height,\
- 0, 0, width, height, lpBits, lpDIBh, DIB_RGB_COLORS, SRCCOPY);
- origin += height;
- // if numDIB = 1, lines below can also be used
- // hbitmap = CreateDIBitmap( hdc, &(lpDIBh->bmiHeader), CBM_INIT, lpBits, lpDIBh, DIB_RGB_COLORS );
- // The above line is equivalent to the following two lines.
- // hbitmap = ::CreateCompatibleBitmap( hdc, width, height );
- // ::SetDIBits( hdc, hbitmap, 0, height, lpBits, lpDIBh, DIB_RGB_COLORS);
- // or the following lines
- // hbitmap = ::CreateCompatibleBitmap( hdc, width, height );
- // HDC memdc = ::CreateCompatibleDC( hdc );
- // ::SelectObject( memdc, hbitmap);
- // ::SetDIBitsToDevice( memdc, 0, 0, width, height,
- // 0, 0, 0, height, (void *)lpBits, lpDIBh, DIB_RGB_COLORS);
- // ::SelectObject( memdc, 0 );
- // ::DeleteDC( memdc );
+
+ //
+ // Have to do something similar to WIN32's StretchDIBits, use GpiBitBlt
+ // in combination with setting the bits into the selected bitmap
+ //
+ lScans = ::GpiSetBitmapBits( hPS
+ ,0 // Start at the bottom
+ ,(LONG)nHeight // One line per scan
+ ,(PBYTE)pucBits
+ ,&vInfo
+ );
+ hPSScreen = ::GpiCreatePS( vHabmain
+ ,hDCScreen
+ ,&vSize
+ ,PU_PELS | GPIA_ASSOC
+ );
+
+ POINTL vPoint[4] = { 0, nOrigin,
+ nWidth, nHeight,
+ 0, 0, nWidth, nHeight
+ };
+
+
+ ::GpiBitBlt( hPSScreen
+ ,hPS
+ ,4
+ ,vPoint
+ ,ROP_SRCCOPY
+ ,BBO_IGNORE
+ );
+ ::GpiDestroyPS(hPSScreen);
+ nOrigin += nHeight;