关于GDI+ 的问题 C++中的容器
我想实现保存坐标然后就是像画图一样线跟着鼠标鼠标点确定线就确定了可是我的程序老师清除保存不起来想请教怎么保存显示以前的图呢voidCtest1View::OnMouseM...
我想实现 保存坐标 然后 就是像画图一样 线跟着鼠标 鼠标点确定线就确定了
可是我的程序 老师清除 保存不起来 想请教怎么保存 显示以前的图呢
void Ctest1View::OnMouseMove(UINT nFlags, CPoint point)
{
::SetCursor(::AfxGetApp()->LoadStandardCursor(IDC_CROSS));
if(flag == true)
{
CDC *dc = GetDC();
Graphics m_Graphics(dc->m_hDC);
Pen m_pen(Color(255,0,0));
RedrawWindow();
m_Graphics.DrawLine(&m_pen,m_Origin.x,m_Origin.y,point.x,point.y);
m_Oldpt = point;
}
CView::OnMouseMove(nFlags, point);
}
void Ctest1View::OnLButtonDown(UINT nFlags, CPoint point)
{
::SetCursor(::AfxGetApp()->LoadStandardCursor(IDC_CROSS));
// TODO: Add your message handler code here and/or call default
flag = true;
m_Origin = m_Oldpt = point;
if (m_ptSave.empty())
m_ptSave.push_back(CPoint(m_Origin.x, m_Origin.y));
CView::OnLButtonDown(nFlags, point);
} 展开
可是我的程序 老师清除 保存不起来 想请教怎么保存 显示以前的图呢
void Ctest1View::OnMouseMove(UINT nFlags, CPoint point)
{
::SetCursor(::AfxGetApp()->LoadStandardCursor(IDC_CROSS));
if(flag == true)
{
CDC *dc = GetDC();
Graphics m_Graphics(dc->m_hDC);
Pen m_pen(Color(255,0,0));
RedrawWindow();
m_Graphics.DrawLine(&m_pen,m_Origin.x,m_Origin.y,point.x,point.y);
m_Oldpt = point;
}
CView::OnMouseMove(nFlags, point);
}
void Ctest1View::OnLButtonDown(UINT nFlags, CPoint point)
{
::SetCursor(::AfxGetApp()->LoadStandardCursor(IDC_CROSS));
// TODO: Add your message handler code here and/or call default
flag = true;
m_Origin = m_Oldpt = point;
if (m_ptSave.empty())
m_ptSave.push_back(CPoint(m_Origin.x, m_Origin.y));
CView::OnLButtonDown(nFlags, point);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询