Drawing Lines and Curves

The types of lines and curves included in graphic output are geometric lines, cosmetic lines, and Bezier curves.

For line and curve output, a driver may support DrvStrokePath, DrvFillPath, DrvStrokeAndFillPath, and DrvPaint. The driver must support DrvStrokePath for drawing lines if the surface is device-managed; drivers are not required to support curves. For a DIB surface, the function is called only if the driver has hooked it through EngAssociateSurface.

When GDI draws a line or curve with any set of attributes, GDI can call DrvStrokePath. At a minimum, the DrvStrokePath function must support the drawing of solid and styled cosmetic lines with a solid color brush and arbitrary clipping. The GDI PATHOBJ and CLIPOBJ service functions make this possible by breaking down the lines into a set of lines one pixel wide with precomputed clipping. DrvStrokePath provides a pointer, plineattrs, to the LINEATTRS structure which defines the various line attributes.

When the path or clipping is too complex for the driver to process on the device, the driver can punt the call back to GDI. In this case, GDI can break the DrvStrokePath call into a set of lines one pixel wide with precomputed clipping.

By calling the CLIPOBJ services from GDI, a driver can have GDI enumerate all the lines in the path and perform all of the line clipping calculations. In addition, a driver can use the PATHOBJ, CLIPOBJ, or XFORMOBJ services to simplify the graphics operations. For example, a driver can use CLIPOBJ_cEnumStart and CLIPOBJ_bEnum to enumerate the rectangles in a clip region, send this region down to the printer, and clip to it. The driver can also use PATHOBJ_vEnumStart and PATHOBJ_bEnum to enumerate lines or curves in the path, and can then send the path to the device, and stroke it.