setupImage.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPIMAGE_HEADER
  2. #define NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPIMAGE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <windows.h>
  7. class SetupImage
  8. {
  9. private:
  10. typedef struct __IMAGEINDEX
  11. {
  12. COLORREF rgbBk;
  13. COLORREF rgbFg;
  14. } IMAGEINDEX;
  15. protected:
  16. SetupImage(HDC hdc, HBITMAP bitmapSource, INT maxColors);
  17. ~SetupImage();
  18. public:
  19. static SetupImage *CreateInstance(HDC hdc, HBITMAP bitmapSource, INT maxColors);
  20. static SetupImage *CreateFromPluginBitmap(HDC hdc, LPCWSTR pszModuleName, LPCWSTR resourceName, INT maxColors);
  21. public:
  22. ULONG AddRef();
  23. ULONG Release();
  24. BOOL GetSize(SIZE *pSize);
  25. BOOL DrawImage(HDC hdc, INT x, INT y, INT cx, INT cy, INT srcX, INT srcY, COLORREF rgbBk, COLORREF rgbFg);
  26. BOOL ResetCache();
  27. private:
  28. ULONG ref;
  29. HBITMAP bitmap;
  30. BYTE *pixels;
  31. BITMAPINFOHEADER header;
  32. IMAGEINDEX *table;
  33. BYTE tableSize;
  34. BYTE tableCount;
  35. BYTE insertCursor;
  36. BYTE readCursor;
  37. };
  38. #endif // NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPIMAGE_HEADER