PRODUCT : Borland C++ NUMBER : 1329 VERSION : 1.0 OS : OS2 DATE : October 25, 1993 PAGE : 1/2 TITLE : Creating a Presentation Space Bitmap under OS/2. Bitmap Creation under OS/2 2.0. =============================== Created presentation spaces DO NOT have a default bitmaps associated with them. The following code shows how to created bitmap from scratch and associate it with a presentation space. // ============================================================== // | Creates a bitmap and associated the bitmap of size area | // | into the HPS passed in the parameter hps. A handle to the | // | newly created bitmap is returned. | // ============================================================== HBITMAP CreateSetBitmap(HPS hps, RECTL area) { BITMAPINFOHEADER2 BitmapInfo; // Header of bitmap HBITMAP theBitmap; // Bitmap created // Clear the bitmap information header structure memset(&BitmapInfo, 0, sizeof(BITMAPINFOHEADER2) ); // Set Bitmap information header fields BitmapInfo.cbFix = sizeof(BITMAPINFOHEADER2) ; // Set the area of the bitmap in the presentation space BitmapInfo.cx = area.xRight + 1; BitmapInfo.cy = area.yTop + 1; // Number of planes for the graphcis mode BitmapInfo.cPlanes = 1L; // Bit count for color BitmapInfo.cBitCount = 4L; // No compression BitmapInfo.ulCompression = BCA_UNCOMP; // 16 Bit color BitmapInfo.cclrUsed = 16; // Create the bitmap theBitmap = GpiCreateBitmap(hps, &BitmapInfo, PRODUCT : Borland C++ NUMBER : 1329 VERSION : 1.0 OS : OS2 DATE : October 25, 1993 PAGE : 2/2 TITLE : Creating a Presentation Space Bitmap under OS/2. 0, NULL, NULL); // Set the bitmap to the presentation space GpiSetBitmap(hps, theBitmap); // Set the background mix attribute for each primitive GpiSetBackMix(hps, BM_OVERPAINT); // Erase the presentation space GpiErase(hps); // return the newly created bitmap return theBitmap; } DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.