Canvas object
Event | Description |
---|---|
Canvas.onPaint() | Event fired when canvas need to be redrawn |
Canvas.onShow() | Event fired when canvas is shown |
Canvas.onHide() | Event fired when canvas is hidden |
Canvas.onClick() | Event fired when the user clicks on the Canvas |
Canvas.onContext() | Event fired when the user right click on the Canvas |
Canvas.onHover() | Event fired when the user moves the mouse pointer over the Canvas |
Canvas.onCreate() | Event fired when Canvas has just been created |
Canvas.onMouseDown() | Event fired when the user presses a mouse button over the Canvas |
Canvas.onMouseUp() | Event fired when the user releases a mouse button over the Canvas |
Canvas.onLeave() | Event fired when the mouse cursor leaves the Canvas |
Property | Description | Access | Type |
---|---|---|---|
Canvas.parent | Get the Canvas's parent widget | readonly | Window | Groupbox | TabItem |
Canvas.x | Get/set the canvas's horizontal position | readwrite | number |
Canvas.y | Get/set the canvas's vertical position | readwrite | number |
Canvas.width | Get/set the canvas's width | readwrite | number |
Canvas.height | Get/set the canvas's height | readwrite | number |
Canvas.align | Align the canvas relative to its parent | readwrite | boolean |
Canvas.enabled | Enable/disable the canvas widget | readwrite | boolean |
Canvas.visible | Controls whether the canvas appears on screen | readwrite | boolean |
Canvas.color | Get/set the canvas actual color for drawing | readwrite | string |
Canvas.bgcolor | Get/set the canvas actual background color | readwrite | string |
Canvas.font | Get/set the canvas current font | readwrite | string |
Canvas.fontsize | Get/set the canvas current font size | readwrite | boolean |
Canvas.fontweight | Get/set the canvas current font weigth | readwrite | number |
Canvas.fontstretch | Get/set the canvas current font stretch | readwrite | boolean |
Canvas.fontstyle | Get/set the canvas current font style | readwrite | boolean |
Method | Description | Return value |
---|---|---|
Canvas.constructor() | Canvas object constructor | Canvas |
Canvas:Image() | Create a new Image | Image |
Canvas:LinearGradient() | Create a new linear gradient brush | LinearGradient |
Canvas:RadialGradient() | Create a new radial gradient brush | RadialGradient |
Canvas:center() | Centers the canvas on the parent widget | - |
Canvas:show() | Shows the canvas | - |
Canvas:hide() | Hides the canvas | - |
Canvas:clear() | Clears the canvas surface and prepare it for drawing | - |
Canvas:print() | Draws text on the Canvas | - |
Canvas:measure() | Measures the text size on the Canvas | - |
Canvas:point() | Draws a point | - |
Canvas:line() | Draws a line | - |
Canvas:rect() | Draws a rectangle | - |
Canvas:roundrect() | Draws a rounded rectangle | - |
Canvas:circle() | Draws a circle | - |
Canvas:ellipse() | Draws an ellipse | - |
Canvas:fillrect() | Draws a filled-in rectangle | - |
Canvas:fillroundrect() | Draws a filled-in rounded rectangle | - |
Canvas:fillcircle() | Draws a filled-in circle | - |
Canvas:fillellipse() | Draws a fillled-in ellipse | - |
Canvas:identity() | Resets Canvas transformations | - |
Canvas:rotate() | Rotates the Canvas | - |
Canvas:scale() | Scales the Canvas | - |
Canvas:skew() | Skews the Canvas | - |
Canvas:translate() | Translates the Canvas | - |