+ HBITMAP hBmp = ::GpiCreateBitmap(hPs, &vHeader, 0L, NULL, &vInfo);
+ if (!hBmp)
+ {
+ wxLogLastError("CreateBitmap");
+ }
+ SetHBITMAP((WXHBITMAP)hBmp);
+}
+
+// Create from XPM data
+wxBitmap::wxBitmap(
+ char** ppData
+, wxControl* WXUNUSED(pAnItem))
+{
+ Init();
+
+ (void)Create( (void *)ppData
+ ,wxBITMAP_TYPE_XPM_DATA
+ ,0
+ ,0
+ ,0
+ );
+}
+
+wxBitmap::wxBitmap(
+ int nW
+, int nH
+, int nD
+)
+{
+ Init();
+
+ (void)Create( nW
+ ,nH
+ ,nD
+ );
+}
+
+wxBitmap::wxBitmap(
+ void* pData
+, long lType
+, int nWidth
+, int nHeight
+, int nDepth
+)
+{
+ Init();
+
+ (void)Create( pData
+ ,lType
+ ,nWidth
+ ,nHeight
+ ,nDepth
+ );
+}
+
+wxBitmap::wxBitmap(
+ const wxString& rFilename
+, long lType
+)
+{
+ Init();
+
+ LoadFile( rFilename
+ ,(int)lType
+ );
+}
+
+bool wxBitmap::Create(
+ int nW
+, int nH
+, int nD
+)
+{
+ HBITMAP hBmp;
+ BITMAPINFOHEADER2 vHeader;
+ BITMAPINFO2 vInfo;
+ HPS hpsScreen;
+ HDC hdcScreen;
+ DEVOPENSTRUC vDop = { NULL, "DISPLAY", NULL, NULL, NULL, NULL, NULL, NULL, NULL };
+ SIZEL vSize = {0, 0};
+ LONG lBitCount;
+
+ wxASSERT(vHabmain != NULL);
+
+ hpsScreen = ::WinGetScreenPS(HWND_DESKTOP);
+ hdcScreen = ::GpiQueryDevice(hpsScreen);
+ ::DevQueryCaps(hdcScreen, CAPS_COLOR_BITCOUNT, 1L, &lBitCount);
+
+ vHeader.cbFix = sizeof(vHeader);
+ vHeader.cx = (USHORT)nW;
+ vHeader.cy = (USHORT)nH;
+ vHeader.cPlanes = (USHORT)nD;
+ vHeader.cBitCount = lBitCount;
+ vHeader.ulCompression = BCA_UNCOMP;
+ vHeader.cxResolution = 0;
+ vHeader.cyResolution = 0;
+ vHeader.cclrUsed = 0;
+ vHeader.cclrImportant = 0;
+ vHeader.usUnits = BRU_METRIC;
+ vHeader.usRecording = BRA_BOTTOMUP;
+ vHeader.usRendering = BRH_NOTHALFTONED;
+ vHeader.cSize1 = 0;
+ vHeader.cSize2 = 0;
+ vHeader.ulColorEncoding = 0;
+ vHeader.ulIdentifier = 0;