home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / t / triq.zip / DIB.H < prev    next >
C/C++ Source or Header  |  1992-05-06  |  3KB  |  70 lines

  1. /*----------------------------------------------------------------------------*\
  2. |   Routines for dealing with Device independent bitmaps                       |
  3. |                                           |
  4. |   History:                                                                   |
  5. |       06/23/89 toddla     Created                                            |
  6. |                                                                              |
  7. \*----------------------------------------------------------------------------*/
  8.  
  9. HANDLE      OpenDIB(LPSTR szFile);
  10. BOOL        WriteDIB(LPSTR szFile,HANDLE hdib);
  11. WORD        PaletteSize(VOID FAR * pv);
  12. WORD        DibNumColors(VOID FAR * pv);
  13. HPALETTE    CreateDibPalette(HANDLE hdib);
  14. HPALETTE    CreateBIPalette(LPBITMAPINFOHEADER lpbi);
  15. HPALETTE    CreateColorPalette(void);
  16. HPALETTE    CreateExplicitPalette(void);
  17. HPALETTE    CreateSystemPalette(void);
  18. HANDLE      DibFromBitmap(HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal, WORD wUsage);
  19. HANDLE      DibFromDib(HANDLE hdib, DWORD biStyle, WORD biBits, HPALETTE hpal, WORD wUsage);
  20. HANDLE      BitmapFromDib(HANDLE hdib, HPALETTE hpal, WORD wUsage);
  21. BOOL        SetDibUsage(HANDLE hdib, HPALETTE hpal,WORD wUsage);
  22. BOOL        DibInfo(HANDLE hdib,LPBITMAPINFOHEADER lpbi);
  23. HANDLE      ReadDibBitmapInfo(int fh);
  24. BOOL        SetPalFlags(HPALETTE hpal, int iIndex, int cntEntries, WORD wFlags);
  25. BOOL        PalEq(HPALETTE hpal1, HPALETTE hpal2);
  26. BOOL        MapDib(HANDLE hdib, HPALETTE hpal);
  27.  
  28. BOOL        DrawBitmap(HDC hdc, int x, int y, HBITMAP hbm, DWORD rop);
  29. BOOL        DrawDib(HDC hdc, int x, int y, HANDLE hdib, HPALETTE hpal, WORD wUsage);
  30. BOOL        StretchBitmap(HDC hdc, int x, int y, int dx, int dy, HBITMAP hbm, int x0, int y0, int dx0, int dy0, DWORD rop);
  31.  
  32. BOOL        DibBlt(HDC hdc, int x0, int y0, int dx, int dy, HANDLE hdib, int x1, int y1, LONG rop, WORD wUsage);
  33. BOOL        StretchDibBlt(HDC hdc, int x, int y, int dx, int dy, HANDLE hdib, int x0, int y0, int dx0, int dy0, LONG rop, WORD wUsage);
  34.  
  35. LPVOID      DibLock(HANDLE hdib,int x, int y);
  36. VOID        DibUnlock(HANDLE hdib);
  37. LPVOID      DibXY(LPBITMAPINFOHEADER lpbi,int x, int y);
  38. HANDLE      CreateDib(int bits, int dx, int dy);
  39. HANDLE      CopyDib (HANDLE hdib);
  40.  
  41. #define BFT_ICON   0x4349   /* 'IC' */
  42. #define BFT_BITMAP 0x4d42   /* 'BM' */
  43. #define BFT_CURSOR 0x5450   /* 'PT' */
  44.  
  45. #define ISDIB(bft) ((bft) == BFT_BITMAP)
  46. #define ALIGNULONG(i)     ((i+3)&(~3))                  /* ULONG aligned ! */
  47. #define WIDTHBYTES(i)     ((unsigned)((i+31)&(~31))/8)  /* ULONG aligned ! */
  48. #define DIBWIDTHBYTES(bi) (int)WIDTHBYTES((int)(bi).biWidth * (int)(bi).biBitCount)
  49. #define PDIBWIDTHBYTES(pbi) (int)WIDTHBYTES((int)(pbi)->biWidth * (int)(pbi)->biBitCount)
  50.  
  51. #define PALVERSION      0x300
  52. #define MAXPALETTE      256
  53.  
  54. #if 0
  55. extern int FAR PASCAL StretchDIBits (
  56.     HDC    hDC,
  57.     WORD    DestX,
  58.     WORD    DestY,
  59.     WORD    DestXE,
  60.     WORD    DestYE,
  61.     WORD    SrcX,
  62.     WORD    SrcY,
  63.     WORD    SrcXE,
  64.     WORD    SrcYE,
  65.     LPSTR    lpBitsBuffer,
  66.     LPBITMAPINFO    lpBitmapInfo,
  67.     WORD    wUsage,
  68.         DWORD   dwROP );
  69. #endif
  70.