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.

77 lines
1.7 KiB

  1. #ifndef _PREVIEW_H
  2. #define _PREVIEW_H
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // Preview.h : header file
  7. //
  8. #define PREVIEW_SELECT_OFFSET 1
  9. /////////////////////////////////////////////////////////////////////////////
  10. // CRectTrackerEx
  11. class CRectTrackerEx : public CRectTracker
  12. {
  13. public :
  14. void SetClippingWindow(CRect Rect);
  15. protected:
  16. CRect m_rectClippingWindow;
  17. virtual void AdjustRect( int nHandle, LPRECT lpRect );
  18. };
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CPreview window
  21. class CPreview : public CWnd
  22. {
  23. // Construction
  24. public:
  25. void SetHBITMAP(HBITMAP hBitmap);
  26. void PaintHBITMAPToDC();
  27. void ScaleBitmapToDC(HDC hDC, HDC hDCM, LPRECT lpDCRect, LPRECT lpDIBRect);
  28. void ScreenRectToClientRect(HWND hWnd,LPRECT pRect);
  29. CRectTrackerEx m_RectTracker;
  30. CPreview();
  31. // Attributes
  32. public:
  33. // Operations
  34. public:
  35. void GetSelectionRect(RECT *pRect);
  36. void SetSelectionRect(RECT *pRect);
  37. void InvalidateSelectionRect();
  38. // Overrides
  39. // ClassWizard generated virtual function overrides
  40. //{{AFX_VIRTUAL(CPreview)
  41. //}}AFX_VIRTUAL
  42. // Implementation
  43. public:
  44. void SetPreviewRect(CRect Rect);
  45. virtual ~CPreview();
  46. // Generated message map functions
  47. protected:
  48. HBITMAP m_hBitmap;
  49. CRect m_PreviewRect;
  50. //{{AFX_MSG(CPreview)
  51. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  52. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  53. afx_msg void OnPaint();
  54. //}}AFX_MSG
  55. DECLARE_MESSAGE_MAP()
  56. };
  57. /////////////////////////////////////////////////////////////////////////////
  58. //{{AFX_INSERT_LOCATION}}
  59. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  60. #endif