Canvas
Offscreen drawing.
| Header | #include "nativeui/gfx/canvas.h" |
| Namespace | namespace nu |
| Type | class (RefCounted) |
Constructors
Canvas(const SizeF& size, float scale_factor)
Create a new canvas with specified size and scale factor.
Parameters
const SizeF&sizefloatscale_factor
Canvas(const SizeF& 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
const SizeF&size
Methods
float GetScaleFactor() const
Return the scale factor of the canvas.
Return
floatPainter* GetPainter()
Return the Painter that can be used to draw on the canvas.
Return
Painter*SizeF GetSize() const
Return the DIP size of canvas.
Return
SizeF