Old fashion design for PC-104
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.

63 lines
1.7 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: LgMemoryDC.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of LgMemoryDC.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __LG__MEMORY__DC__H__INCLUDED__
  15. #define __LG__MEMORY__DC__H__INCLUDED__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #include "..\LgLib\LgImageDIB.h"
  20. class CLgMemoryDC
  21. {
  22. public:
  23. CLgMemoryDC();
  24. virtual ~CLgMemoryDC();
  25. public:
  26. BOOL Create( int cx, int cy, COLORREF color = RGB(0,0,0) );
  27. BOOL Create( HBITMAP hBitmap, BOOL bCopy = TRUE );
  28. BOOL DeleteDC();
  29. public:
  30. BOOL Ellipse( int nLeftRect, int nTopRect, int nRightRect, int nBottomRect );
  31. BOOL LineTo( int x, int y );
  32. BOOL MoveTo( int x, int y );
  33. int DrawText( LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat );
  34. BOOL FillSolidRect( LPCRECT lpRect, COLORREF clr );
  35. BOOL DrawIcon( int X, int Y, HICON hIcon );
  36. public:
  37. enum { ORIGINAL_BIT_COUNT = -1 };
  38. BOOL SaveDIB( LPCTSTR pFileName, INT nBitCount = ORIGINAL_BIT_COUNT );
  39. BOOL SaveJPEG( LPCTSTR pFileName, INT nQuality = 0x42 );
  40. BOOL GetDIB( CLgImageDIB *pDIB );
  41. HBITMAP CopyImage();
  42. public:
  43. static BOOL SaveDIB( LPBITMAPINFO pBitmapInfo, LPBYTE pByte, LPCTSTR pFileName );
  44. public:
  45. const SIZE& GetSize() const { return m_Size; }
  46. const HDC& GetSafeHdc() const { return m_hDC; }
  47. private:
  48. SIZE m_Size;
  49. HDC m_hDC;
  50. HBITMAP m_hBitmap;
  51. HBITMAP m_hOldBitmap;
  52. };
  53. #endif