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.

35 lines
1.4 KiB

  1. //-------------------------------------------------------------------------
  2. // TmUtils.h - theme manager shared utilities
  3. //-------------------------------------------------------------------------
  4. #pragma once
  5. //-------------------------------------------------------------------------
  6. #define DIBDATA(infohdr) (((BYTE *)(infohdr)) + infohdr->biSize + \
  7. infohdr->biClrUsed*sizeof(RGBQUAD))
  8. #define THEME_OFFSET(x) int(x - _LoadingThemeFile._pbThemeData)
  9. #define THEMEFILE_OFFSET(x) int(x - pThemeFile->_pbThemeData)
  10. //------------------------------------------------------------------------------------
  11. class CBitmapPixels
  12. {
  13. public:
  14. CBitmapPixels();
  15. ~CBitmapPixels();
  16. //---- "OpenBitmap()" returns a ptr to pixel values in bitmap. ----
  17. //---- Rows go from bottom to top; Colums go from left to right. ----
  18. //---- IMPORTANT: pixel DWORDS have RGB bytes reversed from COLORREF ----
  19. HRESULT OpenBitmap(HDC hdc, HBITMAP bitmap, BOOL fForceRGB32,
  20. DWORD OUT **pPixels, OPTIONAL OUT int *piWidth=NULL, OPTIONAL OUT int *piHeight=NULL,
  21. OPTIONAL OUT int *piBytesPerPixel=NULL, OPTIONAL OUT int *piBytesPerRow=NULL);
  22. void CloseBitmap(HDC hdc, HBITMAP hBitmap);
  23. //---- public data ----
  24. BITMAPINFOHEADER *_hdrBitmap;
  25. protected:
  26. //---- private data ----
  27. int _iWidth;
  28. int _iHeight;
  29. };
  30. //------------------------------------------------------------------------------------