//
BITMAPINFOHEADER2 vHeader;
BITMAPINFO2 vInfo;
- LONG alFormats[24]; // Max formats OS/2 PM supports
- ULONG ulBitcount;
//
// Fill in the DIB header
wxFAIL_MSG(wxT("could not allocate memory for DIB"));
return FALSE;
}
+ memset(pucBits, '\0', (nBytePerLine * nHeight));
//
// Create and set the device-dependent bitmap
HBITMAP hBmp;
HBITMAP hBmpOld;
- ::GpiQueryDeviceBitmapFormats(hPS, 24, alFormats);
- ulBitcount = alFormats[1]; // the best one for the device
- if (ulBitcount > 24)
- ulBitcount = 24; // MAX bits supported by PM
memset(&vInfo, '\0', 16);
vInfo.cbFix = 16;
vInfo.cx = (ULONG)nWidth;
vInfo.cy = (ULONG)nHeight;
vInfo.cPlanes = 1;
- vInfo.cBitCount = ulBitcount;
+ vInfo.cBitCount = 24; // Set to desired count going in
hBmp = ::GpiCreateBitmap( hPS
,&vHeader
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
}
+ //
+ // Debug stuff
+ //
hPSScreen = ::GpiCreatePS( vHabmain
,hDCScreen
DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
SIZEL vSizlPage = {0,0};
HDC hDCMem;
- LONG alFormats[24]; // 24 is MAX formats supported
- ULONG ulBitcount;
- ::GpiQueryDeviceBitmapFormats(hPS, 24, alFormats);
- ulBitcount = alFormats[1]; // the best one
- if (ulBitcount > 24) // PM supports a max of 24
- ulBitcount = 24;
vImage.Create( nWidth
,nHeight
);
vDIBInfo.cx = nWidth;
vDIBInfo.cy = nHeight;
vDIBInfo.cPlanes = 1;
- vDIBInfo.cBitCount = ulBitcount;
+ vDIBInfo.cBitCount = 24;
lpBits = (unsigned char *)malloc(nBytePerLine * nHeight);
if (!lpBits)
free(pData);
return wxNullImage;
}
+ memset(lpBits, '\0', (nBytePerLine * nHeight));
+ hBitmap = (HBITMAP)GetHBITMAP();
//
// May already be selected into a PS
,&vSizlPage
,PU_PELS | GPIA_ASSOC
);
- hBitmap = (HBITMAP)GetHBITMAP();
if ((hOldBitmap = ::GpiSetBitmap(hPSMem, hBitmap)) == HBM_ERROR)
{
ERRORID vError;