-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathzoomctrl.h
61 lines (47 loc) · 1.58 KB
/
zoomctrl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// zoomctrl.h
//---------------------------------------------------------------------
#ifndef _H_ZoomCtrl
#define _H_ZoomCtrl
#include "scrollhelper.h"
//---------------------------------------------------------------------
class CZoomCtrl : public CWnd
{
public:
CZoomCtrl();
~CZoomCtrl();
double GetZoomFactor() const { return m_zoomFactor; }
void SetZoomFactor(double d) { m_zoomFactor = d; }
void AdjustScrollbars();
//Loads an image from a file
BOOL LoadFromFile(CString &szFilePath);
//Frees the image data
void FreeData();
UINT m_Sx, m_Sy, m_Error, m_Page;
bool m_IsMultiPage, m_ResetPage, m_About;
CString m_ImageName;
//{{AFX_MSG(CDendroCtl)
afx_msg void OnPaint();
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
LRESULT WindowProc(UINT mess, WPARAM wParam, LPARAM lParam);
afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
protected:
virtual void Draw(CDC *pDC);
void PrepDC(CDC *pDC, const CRect& rVirt, const CRect& rScreen);
CRect m_rVirt, m_rScreen;
CScrollHelper m_scrollHelper;
double m_zoomFactor;
private:
//Internal image stream buffer
IStream* m_pStream;
//Control flag if a pic is loaded
BOOL m_bIsPicLoaded;
//GDI Plus Token
ULONG_PTR m_gdiplusToken;
};
//---------------------------------------------------------------------
#endif // _H_ZoomCtrl