Rubber Band technology has three processes:
1. Click the left mouse button to record the start point.
2. Move the mouse: draw a straight line from the starting point to the existing point, and delete the previous line.
3. left-click release: draw a straight line from the start point to the existing point.
I perform the following operations:
DC. setrop2 (r2_not );
Process 1:
Void cdraw_line_rubber_band_skillview: onmbuttondown (uint nflags, cpoint point)
{
// Todo: Add message processing hereProgramCodeAnd/or call the default value
Flag = true;
M_ptold = m_ptorigin = point;
Cview: onmbuttondown (nflags, point );
}
Process 2:
Void cdraw_line_rubber_band_skillview: onmousemove (uint nflags, cpoint point)
{
// Todo: add the message processing program code and/or call the default value here
If (FLAG ){
Cclientdc DC (this );
DC. setrop2 (r2_not );
DC. moveTo (m_ptorigin );
DC. lineto (m_ptold );
DC. moveTo (m_ptorigin );
DC. lineto (point );
M_ptold = point;
Cview: onmousemove (nflags, point );
}
}
Process 3:
Void cdraw_line_rubber_band_skillview: onmbuttonup (uint nflags, cpoint point)
{
// Todo: add the message processing program code and/or call the default value here
Flag = false;
Cclientdc DC (this );
DC. moveTo (m_ptorigin );
DC. lineto (point );
Cview: onmbuttonup (nflags, point );
}