home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / wps / graphic / showbmp / bitmap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-18  |  2.8 KB  |  48 lines

  1. /********************************************************************
  2. **                       BITMAP Header File                        **
  3. ********************************************************************/
  4. #define  ERRBMP_RC_END_OF_FILE    (-10)        // RC = End Of File
  5. #define  ERRBMP_RC_DEVOPENDC      (-11)        // RC = DevOpenDC failed
  6. #define  ERRBMP_RC_CREATEPS       (-12)        // RC = GpiCreatePS failed
  7. #define  ERRBMP_RC_CREATEBM       (-13)        // RC = GpiCreateBitmap failed
  8. #define  ERRBMP_RC_SETBM          (-14)        // RC = GpiSetBitmap failed
  9. #define  ERRBMP_RC_SETBMBITS      (-15)        // RC = GpiSetBitmapBits failed
  10.  
  11. #define  ERRBMP_DOSOPEN_FAILED    (0x8001)     // DosOpen Failed
  12. #define  ERRBMP_HDRREAD_FAILED    (0x8002)     // Bitmap header read failed
  13. #define  ERRBMP_INVALID_FILETYPE  (0x8003)     // Invalid Bitmap filetype
  14. #define  ERRBMP_BMPINFO_FAILED    (0x8004)     // BMP Info alloc/read failed
  15. #define  ERRBMP_SCANBUF_FAILED    (0x8005)     // Scanline buffer alloc failed
  16. #define  ERRBMP_SCANLINE_FAILED   (0x8006)     // Scanline read failed
  17.  
  18. #define  MAX_COLORS     (256)          // Maximum supported colors
  19.  
  20. /********************************************************************
  21. **                 Define BMPCTL Data Structure                    **
  22. ********************************************************************/
  23. typedef struct _BMPCTL                 // Define Bitmap Control area
  24.   {
  25.     TID              tidThread;        // Thread ID
  26.     HAB              habThread;        // Thread HAB
  27.     HWND             hwndClient;       // Client window to notify
  28.     ERRORID          Err;              // PM Error ID
  29.     HSEM             hTriggerSem;      // Thread trigger semaphore handle
  30.     PCHAR            pFileName;        // Bitmap file name ptr
  31.     HDC              hdcBitmap;        // Bitmap device memory context handle
  32.     HPS              hpsBitmap;        // Bitmap Presentation Space handle
  33.     HBITMAP          hbmBitmap;        // Bitmap handle
  34.     USHORT           cColors;          // Number of colors in image
  35.     USHORT           cbLine;           // Scanline size in bytes
  36.     USHORT           cLines;           // Number of scanlines
  37.     PVOID            pScan;            // Bitmap scanline buffer ptr
  38.     PBITMAPINFO      pBmi;             // Bitmap info and color table ptr
  39.     BITMAPFILEHEADER Hdr;              // Bitmap file info header
  40.     LONG    lLogColorTbl[MAX_COLORS];  // Logical Color Table
  41.   } BMPCTL, FAR *PBMPCTL;
  42.  
  43. /********************************************************************
  44. **                 Define BITMAP Function Calls                    **
  45. ********************************************************************/
  46. VOID DestroyBitMap (PBMPCTL pCtl);
  47. USHORT CreateBitmap (PBMPCTL pCtl);
  48.