Expand/Shrink

cdCanvasMark

Definition: include pGUI.e

cdCanvasMark(cdCanvas canvas, atom x, y)
-- or --
wdCanvasMark(cdCanvas canvas, atom x, y)
Description: Draws a mark in (x,y) using the current foreground color.
It is not possible to use this function between a call to functions cdCanvasBegin and cdCanvasEnd if the type of mark is set to CD_DIAMOND.
If the active driver does not include this primitive, it will be simulated using other primitives from the library, such as cdCanvasLine.

Should you intend to invoke this function many times, performance will be improved by first changing the filling and line attributes to those used by this function (so obviously it does not feel the need to set and reset them on every call):

cdCanvasSetInteriorStyle(canvas, CD_SOLID)
cdCanvasSetLineStyle(canvas, CD_CONTINUOUS)
cdCanvasSetLineWidth(canvas, 1)

Also, if the mark is very small, we suggest using the cdCanvasPixel() function instead, which again should achieve better performance.

The C function cdfCanvasMark() is not separately wrapped, just delete the f.
pwa/p2js: Supported - currently only partially implemented [cd not yet wd], but it should be straightforward to finish the job as needs and therefore suitable test cases arise.
Attributes: integer prev = cdCanvasMarkType(cdCanvas canvas, integer mark_type)

Configures the current mark type for: CD_PLUS, CD_STAR, CD_CIRCLE, CD_X, CD_BOX, CD_DIAMOND, CD_HOLLOW_CIRCLE, CD_HOLLOW_BOX or CD_HOLLOW_DIAMOND.
Returns the previous value. Default value: CD_STAR. Value CD_QUERY simply returns the current value.

Mark Types


integer prev = cdCanvasMarkSize(cdCanvas canvas, integer mark_size)
-- or --
atom prev = wdCanvasMarkSize(cdCanvas canvas, atom mark_size)

Configures the mark size in pixels. Returns the previous value. Default value: 10. Value CD_QUERY simply returns the current value. Valid width interval: >= 1.

In WC, it configures the current line width in millimeters.