cdCanvasBegin

Definition: include pGUI.e

cdCanvasBegin(cdCanvas hCdCanvas, integer mode)
Description: Starts defining a polygon to be drawn (or filled) according to the mode: CD_CLOSED_LINES, CD_OPEN_LINES, CD_FILL, CD_CLIP, CD_REGION or CD_BEZIER.
  • CD_OPEN_LINES: connects all the points at cdEnd. Depends on line width and line style attributes.
  • CD_CLOSED_LINES: connects all the points at cdEnd and connects the last point to the first. Depends on line width and line style attributes.
  • CD_FILL: connects the last point to the first and fills the resulting polygon according to the current interior style. When the interior style CD_HOLLOW is defined the it behaves as if the mode were CD_CLOSED_LINES.
  • CD_CLIP: instead of creating a polygon to be drawn, creates a polygon to define a polygonal clipping region.
  • CD_BEZIER: defines the points of a bezier curve. There must be at least 4 points: start, control, control and end. To specify a sequence of curves use 3 more points for each curve: control, control, end, control, control, end, ... The end point is used as start point for the next curve.
  • CD_REGION: starts the creation of a complex region for clipping. All calls to cdBox, cdSector, cdChord, Filled Polygons and cdText will be composed in a region for clipping. See Regions documentation.
  • CD_PATH: creates a path composed of several primitives that can be line draw, filled or used as clipping. Must call cdCanvasPathSet to configure the action between sequences of cdCanvasVertex.
Open, Closed and Filled Polygons

Bezier Lines

Do not create embedded polygons, that is, do not call function cdCanvasBegin twice without a call to cdCanvasEnd in between.
See Also: cdCanvasVertex, cdCanvasEnd