home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 20.ddi / SAMPLES / CROPDIB / DIB.H_ / DIB.H
Encoding:
Text File  |  1993-02-08  |  2.2 KB  |  43 lines

  1. /*----------------------------------------------------------------------------*\
  2. |   Routines for dealing with Device independent bitmaps                       |
  3. |                                                                              |
  4. |                                                                              |
  5. \*----------------------------------------------------------------------------*/
  6.  
  7. HANDLE      OpenDIB(HFILE fh);
  8. BOOL        WriteDIB(HFILE fh,HANDLE hdib);
  9. WORD        PaletteSize(VOID FAR * pv);
  10. WORD        DibNumColors(VOID FAR * pv);
  11. HPALETTE    CreateDibPalette(HANDLE hdib);
  12. HPALETTE    CreateBIPalette(LPBITMAPINFOHEADER lpbi);
  13. HANDLE      DibFromBitmap(HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal, WORD wUsage);
  14. HANDLE      DibFromDib(HANDLE hdib, DWORD biStyle, WORD biBits, HPALETTE hpal, WORD wUsage);
  15. HBITMAP     BitmapFromDib(HANDLE hdib, HPALETTE hpal, WORD wUsage);
  16. BOOL        SetDibUsage(HANDLE hdib, HPALETTE hpal,WORD wUsage);
  17. BOOL        DibInfo(HANDLE hdib,LPBITMAPINFOHEADER lpbi);
  18. HANDLE      ReadDibBitmapInfo(HFILE fh);
  19. BOOL        SetPalFlags(HPALETTE hpal, int iIndex, int cntEntries, WORD wFlags);
  20. BOOL        PalEq(HPALETTE hpal1, HPALETTE hpal2);
  21.  
  22. BOOL        DrawBitmap(HDC hdc, int x, int y, HBITMAP hbm, DWORD rop);
  23. BOOL        StretchBitmap(HDC hdc, int x, int y, int dx, int dy, HBITMAP hbm, int x0, int y0, int dx0, int dy0, DWORD rop);
  24.  
  25. BOOL        DibBlt(HDC hdc, int x0, int y0, int dx, int dy, HANDLE hdib, int x1, int y1, LONG rop, WORD wUsage);
  26. 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);
  27.  
  28. LPVOID      DibLock(HANDLE hdib,int x, int y);
  29. VOID        DibUnlock(HANDLE hdib);
  30. LPVOID      DibXY(LPBITMAPINFOHEADER lpbi,int x, int y);
  31. HANDLE      CreateDib(HANDLE hdib, int dx, int dy);
  32.  
  33. #define BFT_ICON   0x4349   /* 'IC' */
  34. #define BFT_BITMAP 0x4d42   /* 'BM' */
  35. #define BFT_CURSOR 0x5450   /* 'PT' */
  36.  
  37. #define ISDIB(bft) ((bft) == BFT_BITMAP)
  38. #define ALIGNULONG(i)   ((i+3)/4*4)        /* ULONG aligned ! */
  39. #define WIDTHBYTES(i)   ((i+31)/32*4)      /* ULONG aligned ! */
  40.  
  41. #define PALVERSION      0x300
  42. #define MAXPALETTE      256
  43.