Drawing points
Two methods are used to draw points. A point is a single pixel in a drawable.
drawPoint:x:y:
Draws a single point
drawPoints:points:mode:
Draws multiple points
Note:
The point "0@0" is in the upper left corner.
The following example draws a point at 20@20 on the default root window using the default GC.
CgWindow default
drawPoint: CgGC default
x: 20
y: 20.
The following example draws a series of points, specified as an Array of Points. The constant CoordModeOrigin is used to indicate that each point should be drawn relative to the origin. Passing CoordModePrevious as the mode specifies that the coordinates of each point (except the first) are relative to the previous point.
| points |
points := Array new: 10.
1 to: 10 do: [:i |
points at: i put: (i*3)@(i*6)].
CgWindow default
drawPoints: CgGC default
points: points
mode: CoordModeOrigin.
Last modified date: 01/29/2015