資源簡(jiǎn)介
MFC控件繪二維坐標(biāo),包括放大縮小,鼠標(biāo)平移,坐標(biāo)點(diǎn)tip。
代碼片段和文件信息
//?hnPointsShow.cpp?:?實(shí)現(xiàn)文件
//
#include?“stdafx.h“
#include?“hniTE.h“
#include?“hnPointsShow.h“
#include?
#include?“MainFrm.h“
//?hnPointsShow
IMPLEMENT_DYNAMIC(hnPointsShow?CStatic)
hnPointsShow::hnPointsShow()
{
InitialVars();
}
hnPointsShow::~hnPointsShow()
{
for?(int?i?=?0;?i? {
delete?[]m_points[i].x;
delete?[]m_points[i].y;
}
m_points.swap(std::vector());
}
BEGIN_MESSAGE_MAP(hnPointsShow?CStatic)
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
ON_WM_MOUSEMOVE()
ON_WM_MOUSEWHEEL()
ON_WM_LBUTTONUP()
ON_WM_RBUTTONDOWN()
ON_WM_RBUTTONUP()
ON_WM_LBUTTONDBLCLK()
ON_WM_MOUSEHOVER()
ON_WM_MOUSELEAVE()
END_MESSAGE_MAP()
//?hnPointsShow?消息處理程序
void?hnPointsShow::OnPaint()
{
CPaintDC?dc(this);?//?device?context?for?painting
//?TODO:?在此處添加消息處理程序代碼
//?不為繪圖消息調(diào)用?CStatic::OnPaint()
DrawCoordinate(dc);
}
void?hnPointsShow::DrawCoordinate(CPaintDC?&dc)
{
CRect rt;
GetClientRe
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????12605??2018-03-23?15:19??hnPointsShow.cpp
?????文件????????2155??2018-03-23?15:21??hnPointsShow.h
評(píng)論
共有 條評(píng)論