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.

34 lines
884 B

  1. // Copyright (C) Microsoft Corporation 1993-1997
  2. // Stripped down version of cpaldc in hha.dll
  3. const int SCREEN_DC = 0;
  4. const int SCREEN_IC = 1;
  5. class CPalDC
  6. {
  7. public:
  8. CPalDC(HBITMAP hbmp = NULL, HPALETTE hpal = NULL);
  9. CPalDC::~CPalDC(void);
  10. CPalDC(int type);
  11. void SelectPal(HPALETTE hpalSel);
  12. HPALETTE CreateBIPalette(HBITMAP hbmp);
  13. int GetDeviceWidth(void) const { return GetDeviceCaps(m_hdc, HORZRES); };
  14. int GetDeviceHeight(void) const { return GetDeviceCaps(m_hdc, VERTRES); };
  15. int GetDeviceColors(void) const { return GetDeviceCaps(m_hdc, NUMCOLORS); };
  16. HDC m_hdc;
  17. HPALETTE m_hpalOld;
  18. HPALETTE m_hpal;
  19. HBITMAP m_hbmpOld;
  20. HBITMAP m_hbmp;
  21. operator HDC() const { return m_hdc; }
  22. operator HBITMAP() const { return m_hbmp; }
  23. operator HPALETTE() const { return m_hpal; }
  24. protected:
  25. BOOL m_fHdcCreated;
  26. };