www.pudn.com > MyImageDB(imageobject).rar > MyImageDBView.h


// MyImageDBView.h : interface of the CMyImageDBView class 
// 
///////////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_MYIMAGEDBVIEW_H__2FB847F8_D070_493F_B8EC_6B685BFA7673__INCLUDED_) 
#define AFX_MYIMAGEDBVIEW_H__2FB847F8_D070_493F_B8EC_6B685BFA7673__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
#include "myimagedbdoc.h" 
#include  
#include "mymath.h" 
#include "mytexture.h" 
 
//训练点 
typedef struct tagTrainPt{ 
	LONG  id; 
	CString  regionclass; 
	CString  imagename; 
	INT posx; 
	INT posy; 
}TrainPt; 
 
class CMyImageDBView : public CScrollView 
{ 
protected: // create from serialization only 
	CMyImageDBView(); 
	DECLARE_DYNCREATE(CMyImageDBView) 
	void UpdatePostion(); 
	void UpdateColorPalette();//刷新当前象素数据面板; 
 
// Attributes 
public: 
	CMyImageDBDoc* GetDocument(); 
 
 
// Operations 
public: 
    BYTE* GetNeiMatrixAtCursor(INT& width, INT& height); 
	BOOL GetColorAtCursor(RGBQUAD& color); 
	BOOL GetLuvAtCursor(MyLUV& outluv); 
	void SetCurSelTrainPoint(LONG pointid, CString imagename, INT posx, INT posy, CString regionclass);//设置当前选择的训练点; 
	void ClearCurTrainPt();//清除当前选择的训练点; 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CMyImageDBView) 
	public: 
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view 
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 
	virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point); 
	virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point); 
	virtual void OnDragLeave(); 
	virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point); 
	virtual void OnInitialUpdate(); 
	virtual BOOL OnScroll(UINT nScrollCode, UINT nPos, BOOL bDoScroll = TRUE); 
	protected: 
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); 
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); 
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); 
	virtual BOOL OnScrollBy(CSize sizeScroll, BOOL bDoScroll = TRUE); 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	virtual ~CMyImageDBView(); 
#ifdef _DEBUG 
	virtual void AssertValid() const; 
	virtual void Dump(CDumpContext& dc) const; 
#endif 
 
protected: 
	INT sX, sY;//卷屏位置; 
	INT iX, iY;//图像显示位置, 这四个变量用来将当前光标位置转换为图像栅格位置; 
	INT cX, cY;//当前光标在图像中的位置; 
	COleDropTarget myDropTarget; 
	BOOL isCtrlKeyDown, isDrawCurSelTrainPt; 
	TrainPt curSelTrainPt; 
	INT neiWidth, neiHeight;//邻域宽高; 
	MyMath myMath; 
	CMyTexture myTexture; 
 
// Generated message map functions 
protected: 
	//{{AFX_MSG(CMyImageDBView) 
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); 
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); 
	afx_msg void OnMouseMove(UINT nFlags, CPoint point); 
	afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); 
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
#ifndef _DEBUG  // debug version in MyImageDBView.cpp 
inline CMyImageDBDoc* CMyImageDBView::GetDocument() 
   { return (CMyImageDBDoc*)m_pDocument; } 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_MYIMAGEDBVIEW_H__2FB847F8_D070_493F_B8EC_6B685BFA7673__INCLUDED_)