c++ GDI +图像问题
voidCtest1View::OnMouseMove(UINTnFlags,CPointpoint){if(flag==true){CDC*dc=GetDC();Gra...
void Ctest1View::OnMouseMove(UINT nFlags, CPoint point)
{
if(flag == true)
{
CDC *dc = GetDC();
Graphics m_Graphics(dc->m_hDC);
Pen m_pen(Color(255,0,0));
m_Graphics.Clear(Color(255,255,255));
m_Graphics.DrawLine(&m_pen,m_Oldpt.x,m_Oldpt.y,point.x,point.y);
m_Origin = point;
}
CView::OnMouseMove(nFlags, point);
}
void Ctest1View::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
flag = true;
m_Origin = m_Oldpt = point;
CView::OnLButtonDown(nFlags, point);
}
我的线一画出来就被清了 我想知道怎么保存 展开
{
if(flag == true)
{
CDC *dc = GetDC();
Graphics m_Graphics(dc->m_hDC);
Pen m_pen(Color(255,0,0));
m_Graphics.Clear(Color(255,255,255));
m_Graphics.DrawLine(&m_pen,m_Oldpt.x,m_Oldpt.y,point.x,point.y);
m_Origin = point;
}
CView::OnMouseMove(nFlags, point);
}
void Ctest1View::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
flag = true;
m_Origin = m_Oldpt = point;
CView::OnLButtonDown(nFlags, point);
}
我的线一画出来就被清了 我想知道怎么保存 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询