Struct native_windows_gui::CanvasRenderer [] [src]

pub struct CanvasRenderer<'a, ID: Clone + Hash + 'a> { /* fields omitted */ }

Object that offers a light wrapper over the D2D1 api.

Methods

impl<'a, ID: Clone + Hash> CanvasRenderer<'a, ID>
[src]

Clears the drawing area to the specified color.

Arguments:
r: Red component. 0.0 - 1.0
g: Green component. 0.0 - 1.0
b: Blue component. 0.0 - 1.0
a: Alpha component. 0.0 - 1.0

Return the render target size in a tuple of (width, height)

Set the transformation matrix of the renderer

Arguments:
m: The 3x2 matrix.

Return the transformation matrix of the renderer

Fill a rectangle shape defined by r using the brush identified by brush

Arguments:
brush: Id of the brush saved in the canvas
r: The rectangle shape to draw

Fill a rounded rectangle shape defined by r using the brush identified by brush

Arguments:
brush: Id of the brush saved in the canvas
r: The rectangle shape to draw
radius: Amount of rounding on the rectangle border. (width, height)

Fill an ellipse shape defined by e using the brush identified by brush

Arguments:
brush: Id of the brush saved in the canvas
e: The ellipse shape to draw

Draw the outline of a rectangle shape defined by r using the brush identified by brush and the pen identifed by pen.

Arguments:
brush: Id of the brush saved in the canvas
pen: Id of the pen saved in the canvas
r: The rectangle shape to draw
width: Width of the outline to draw

Draw the outline of a rounded rectangle shape defined by r using the brush identified by brush and the pen identifed by pen.

Arguments:
brush: Id of the brush saved in the canvas
pen: Id of the pen saved in the canvas
r: The rectangle shape to draw
width: Width of the outline to draw
radius: Amount of rounding on the rectangle border. (width, height)

Draw the outline of an ellipse shape defined by e using the brush identified by brush and the pen identifed by pen.

Arguments:
brush: Id of the brush saved in the canvas
pen: Id of the pen saved in the canvas
e: The ellipse shape to draw
width: Width of the outline to draw

Methods from Deref<Target = Canvas<ID>>

Make the canvas "paint ready" and return an object to paint to it. In very very very rare case, the renderer creation can fail.

Create a solid brush into the canvas and add it under the selected name.

Errors:
Error::System if the canvas could not create the brush.
Error::KeyExists if the a resource with the specified name already exists

Create a pen into the canvas and add it under the selected name.

Errors:
Error::System if the canvas could not create the brush.
Error::KeyExists if the a resource with the specified name already exists

Redraw the canvas

Set the render target resolution.
If the control size do not match the render target size, the result will be upscaled or downscaled

Return the render target's dots per inch (DPI).

Sets the dots per inch (DPI) of the render target.

Arguments:
dpix: A value greater than or equal to zero that specifies the horizontal DPI of the render target.
dpiy: A value greater than or equal to zero that specifies the vertical DPI of the render target.

Trait Implementations

impl<'a, ID: Clone + Hash> Deref for CanvasRenderer<'a, ID>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<'a, ID: Clone + Hash> DerefMut for CanvasRenderer<'a, ID>
[src]

The method called to mutably dereference a value

impl<'a, ID: Clone + Hash> Drop for CanvasRenderer<'a, ID>
[src]

A method called when the value goes out of scope. Read more