1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
<!doctype HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Marks</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>
<body>
<h2 align="center">Marks</h2>
<p>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.</p>
<p>All marks in all drivers are simulated using other CD primitives, except
<strong>cdCanvasPixel</strong>.</p>
<hr>
<div class="function"><pre class="function"><span class="mainFunction">void <a name="cdPixel">cdCanvasPixel</a>(cdCanvas* canvas, int x, int y, long int color); [in C]</span>
void wdCanvasPixel(cdCanvas* canvas, double x, double y, long int color); (WC) [in C]
canvas:Pixel(x, y: number, color: lightuserdata) [in Lua]
canvas:wPixel(x, y: number, color: lightuserdata) (WC) [in Lua]</pre>
<p>Configures the pixel <b>(x,y)</b> with the color defined by <b>color</b>. It is the smallest element of the canvas. It depends only
on global attributes of the canvas. It can be very slow on some drivers.
Sometimes it is implemented as a rectangle with size 1x1.</p>
</div><div class="function"><pre class="function"><span class="mainFunction">void <a name="cdMark">cdCanvasMark</a>(cdCanvas* canvas, int x, int y); [in C]</span>
void wdCanvasMark(cdCanvas* canvas, double x, double y); (WC) [in C]
canvas:Mark(x, y: number) [in Lua]
canvas:wMark(x, y: number) (WC) [in Lua]</pre>
<p>Draws a mark in <b><b>(x,y)</b> </b>using the current foreground color.
It is not possible to use this function between a call to functions
<font><b>cdCanvasBegin</b></font> and <font><b>cdCanvasEnd</b></font>
if the type of mark is set to <b>CD_DIAMOND</b>. If the active driver
does not include this primitive, it will be simulated using other primitives
from the library, such as <strong><font>cdCanvasLine</font></strong>.</p>
<p>If you will call this function several times in a
sequence, then it is recommended that the application changes the filling and
line attributes to those used by this
function:</p>
<pre>cdCanvasInteriorStyle(canvas, CD_SOLID);
cdCanvasLineStyle(canvas, CD_CONTINUOUS);
cdCanvasLineWidth(canvas, 1);</pre>
<p>This will greatly increase this function's performance. Also in this case,
if the mark is very small, we suggest using the <font><strong>cdCanvasPixel</strong></font>
function so that the application itself draws the mark. In many cases, this
also increases this function's performance.</p>
</div>
<h3>Attributes</h3>
<div class="function"><pre class="function"><span class="mainFunction">int <a name="cdMarkType">cdCanvasMarkType</a>(cdCanvas* canvas, int type); [in C]</span>
canvas:MarkType(type: number) -> (old_type: number) [in Lua]</pre>
<p>Configures the current mark type for: <b>CD_PLUS</b>, <b>
CD_STAR</b>, <b>CD_CIRCLE</b>, <b>CD_X</b>, <b>
CD_BOX</b>, <b>CD_DIAMOND</b>, <b>CD_HOLLOW_CIRCLE</b>,
<b>CD_HOLLOW_BOX</b> or <b>CD_HOLLOW_DIAMOND</b>. Returns
the previous value. Default value: <b>CD_STAR</b>. Value <b><b>
CD_QUERY</b> </b>simply returns the current value.</p>
<p align="center"><font size="4">Mark Types</font><br>
<img src="../../img/marks.gif" border="2" width="148" height="193"></p>
</div><div class="function"><pre class="function"><span class="mainFunction">int <a name="cdMarkSize">cdCanvasMarkSize</a>(cdCanvas* canvas, int size); [in C]</span>
double wdCanvasMarkSize(cdCanvas* canvas, double size); (WC) [in C]
canvas:MarkSize(size: number) -> (old_size: number) [in Lua]
canvas:wMarkSize(size: number) -> (old_size: number) (WC) [in Lua]</pre>
<p>Configures the mark size in pixels. Returns the previous value. Default
value: 10. Value <b><b>CD_QUERY</b> </b>simply returns the current value.
Valid width interval: >= 1.</p>
<p>In WC, it configures the current line width in millimeters. </p>
</div>
</body>
</html>
|