Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
2.4 KiB

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