CD - Canvas Draw

Marks

A mark is a punctual representation. It can have different sizes and types. All types are affected only by mark attributes and by the foreground color.


void cdPixel(int x, int y, long int color); [in C]
void wdPixel(double x, double y, long int color); (WC) [in C]
cd.Pixel(x, y: number, color: color_tag) [in Lua]
cd.wPixel(x, y: number, color: color_tag)
(WC) [in Lua]

Configures the pixel (x,y) with the color defined by color. It is the smallest element of the canvas. It depends only on global attributes of the canvas.

void cdMark(int x, int y); [in C]
void wdMark(double x, double y); (WC) [in C]
cd.Mark(x, y: number) [in Lua]
cd.wMark(x, y: number)
(WC) [in Lua]

Draws a mark in (x,y) using the current foreground color. It is not possible to use this function between a call to functions cdBegin and cdEnd 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 cdLine.

If you will call function cdMark or wdMark several times in a sequence, then it is recommended that the application changes the filling and line attributes to those used by the cdMark function:

cdInteriorStyle(CD_SOLID);
cdLineStyle(CD_CONTINUOUS);
cdLineWidth(1);

This will greatly increase this function's performance. Also in this case, if the mark is very small, we suggest using the cdPixel function so that the application itself draws the mark. In many cases, this also increases this function's performance.


Attributes

int cdMarkType(int type); [in C]
cd.MarkType(type: number) -> (old_type: number) [in Lua]

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

int cdMarkSize(int size); [in C]
double
cdMarkSize(double size); (WC) [in C]
cd.MarkSize(size: number) -> (old_size: number) [in Lua]
cd.wMarkSize(size: number) -> (old_size: number) (WC) [in Lua]

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.