1. Track generation:
Beginpath (HDC); // start trajectory
Textout (...);
Movetoex (HDC, 40, 25, null );
Lineto (HDC, 50, 75 );
Lineto (HDC, 60, 25 );
Closefigure (); // use a straight line to close the trajectory
Endpath (HDC); // end trajectory
Strokepath (HDC); // draw the trajectory
Ii. Track handling:
Strokepath // draw the trajectory
Fillpath // fill
Strokeandfillpath // draw and fill
Pathtoregion // convert to Region
Selectclippath // select the cut area
For fields with fill or area, it must be automatically closed in a straight line.
3. Extended paint brush
Logbrush Lb;
LB. lbstyle = bs_solid;
LB. lbcolor = RGB (128,128,128 );
LB. lbhatch = 0;
SelectObject (HDC,
Extcreatepen (ps_solid | ps_geometric | ps_endcap_round | ps_join_round, & Lb, 0, null ));
Iv. CDC: selectclippath
Bool selectclippath (INT nmode );
Return Value: if the operation is successful, a non-zero value is returned. Otherwise, the return value is 0.
Parameters:
Nmode |
Specify the path to use. The following values are allowed:
· |
Rgn_and |
The new cut area, including the current cut area and the current path. |
· |
Rgn_copy |
The new cut area is the current path. |
· |
Rgn_diff |
The new cut area is the current path, but does not include the current path. |
· |
Rgn_or |
The new cut area, including the combined area and current path of the current cut area. |
· |
Rgn_xor |
The new cut area includes the combined area and current path of the current cut area, but does not include the overwrite part. |
|
Note:
Select the current path as the cut area for the device context, and use the specified mode to combine the new area with the existing cut area. The device context must contain a closed path.