April 28th, 1999, 10:00 AM
New to VC++ and looking for kind person to assist me. Trying to create an array for a drawing program that will store up to 200 points as mouse moves across screen. Also need to serialize these points and maintain drawing when window is resized. Already have code for drawing done as shown below:
void CSimpleAppView::OnLButtonDown(UINT nFlags, CPoint point)
{
m_ptFrom = point;
if ((!m_bCaptured) && (m_bEnable))
{
m_bCaptured = TRUE;
SetCapture();
}
CView::OnLButtonDown(nFlags, point);
}
void CSimpleAppView::OnMouseMove(UINT nFlags, CPoint point)
{
if (m_bCaptured)
{
CClientDC dc(this);
CPen cPen;
cPen.CreatePen(PS_SOLID,1,m_Color);
CPen *pOldPen;
pOldPen = dc.SelectObject(&cPen);
dc.MoveTo(m_ptFrom);
dc.LineTo(point);
m_ptFrom = point;
}
CView::OnMouseMove(nFlags, point);
}
void CSimpleAppView::OnRButtonDown(UINT nFlags, CPoint point)
{
if (m_bCaptured)
{
ReleaseCapture();
m_bCaptured = FALSE;
m_bEnable = FALSE;
}
CView::OnRButtonDown(nFlags, point);
}
void CSimpleAppView::OnLButtonDown(UINT nFlags, CPoint point)
{
m_ptFrom = point;
if ((!m_bCaptured) && (m_bEnable))
{
m_bCaptured = TRUE;
SetCapture();
}
CView::OnLButtonDown(nFlags, point);
}
void CSimpleAppView::OnMouseMove(UINT nFlags, CPoint point)
{
if (m_bCaptured)
{
CClientDC dc(this);
CPen cPen;
cPen.CreatePen(PS_SOLID,1,m_Color);
CPen *pOldPen;
pOldPen = dc.SelectObject(&cPen);
dc.MoveTo(m_ptFrom);
dc.LineTo(point);
m_ptFrom = point;
}
CView::OnMouseMove(nFlags, point);
}
void CSimpleAppView::OnRButtonDown(UINT nFlags, CPoint point)
{
if (m_bCaptured)
{
ReleaseCapture();
m_bCaptured = FALSE;
m_bEnable = FALSE;
}
CView::OnRButtonDown(nFlags, point);
}