Promotic
WikipediaLinkedInYoutubeTwitterFacebook

rect - method of object CanvasCtx

Description:
Creates a rectangle.
Syntax:
rect(x As Long, y As Long, width As Long, height As Long) As Object
Calling:
ctx.rect(x, y, width, height);
Parameters:
x(Long) The x-coordinate of the upper-left corner of the rectangle
y(Long) The y-coordinate of the upper-left corner of the rectangle
width(Long) Lenght of the rectangle (in pixels).
height(Long) Height of the rectangle (in pixels).
Note:
The method creates a path. Therefore before this method is called the beginPath method should be called. For the rendering itself the stroke or fill method is used.
 
The method can also be called in the graphic item events for Web Panels.
See also:
Example:
// Blue rectangle
ctx.strokeStyle = "blue";
ctx.rect(50, 50, 150, 80);
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice