CanvasContext.strokeRect

Draw a none-filled rect.

Parameters

It is Object type.

PropertyTypeDescription
xNumberThe x coordinate of left-upper corner of rect.
yNumberThe y coordinate of left-upper corner of rect.
widthNumberThe width of rect.
heightNumberThe height of rect.

Sample Code

copy
//.js
const ctx = my.createCanvasContext('awesomeCanvas')
ctx.setStrokeStyle('blue')
ctx.strokeRect(20, 20, 250, 80)
ctx.draw()