strokeRect - method of the CanvasCtx object
Description:
Draws a hollow rectangle (no fill).
Syntax:
Object strokeRect(Long x, Long y, Long width, Long height)
Parameters:
x | (Long) The x-coordinate of the left upper corner of the rectangle |
y | (Long) The y-coordinate of the left upper corner of the rectangle |
width | (Long) The rectangle width (in pixels). |
height | (Long) The rectangle height (in pixels). |
---|
Example:
The
ctx variable represents the drawing canvas (
CanvasCtx). The setup is done on the "
Draw" tab at the beginning of the script of drawing event
onDraw as follows:
var ctx =
pEvent.
GetCtx(1);
JavaScriptSelect and copy to clipboard
ctx.beginPath();
ctx.lineWidth = 5;
ctx.strokeRect(50, 50, 150, 80);