Canvas
Offscreen drawing.
Module | require("yue.gui") |
Type | Class |
Class methods
create(size, scalefactor)
Create a new canvas with specified size and scale factor.
Parameters
SizeF
sizenumber
scalefactor
Return
Canvas
createformainscreen(size)
Create a new canvas with size
using default scale factor.
This is strongly discouraged for using, since it does not work well with multi-monitor setup. Only use it when you do not care about per-monitor DPI.
Parameters
SizeF
size
Return
Canvas
Methods
getscalefactor()
Return the scale factor of the canvas.
Return
number
getpainter()
Return the Painter that can be used to draw on the canvas.
Return
Painter
getsize()
Return the DIP size of canvas.
Return
SizeF