[][src]Struct native_windows_gui::Canvas

pub struct Canvas<ID: Clone + Hash> { /* fields omitted */ }

A blank control that can be painted to

Methods

impl<ID: Clone + Hash> Canvas<ID>[src]

pub fn renderer<'a>(&'a mut self) -> Result<CanvasRenderer<'a, ID>, Error>[src]

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

pub fn create_solid_brush(
    &mut self,
    name: &ID,
    brush: &SolidBrush
) -> Result<(), Error>
[src]

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

pub fn create_pen(&mut self, name: &ID, pen: &Pen) -> Result<(), Error>[src]

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

pub fn redraw(&self)[src]

Redraw the canvas

pub fn set_render_size(&mut self, w: u32, h: u32)[src]

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

pub fn get_dpi(&mut self) -> (f32, f32)[src]

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

pub fn set_dpi(&mut self, dpix: f32, fpiy: f32)[src]

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.

pub fn get_visibility(&self) -> bool[src]

pub fn set_visibility(&self, visible: bool)[src]

pub fn get_position(&self) -> (i32, i32)[src]

pub fn set_position(&self, x: i32, y: i32)[src]

pub fn get_size(&self) -> (u32, u32)[src]

pub fn set_size(&self, w: u32, h: u32)[src]

pub fn get_enabled(&self) -> bool[src]

pub fn set_enabled(&self, e: bool)[src]

Methods from Deref<Target = ID2D1HwndRenderTarget>

pub unsafe fn CheckWindowState(&mut self) -> D2D1_WINDOW_STATE[src]

pub unsafe fn Resize(&mut self, pixelSize: *const D2D_SIZE_U) -> i32[src]

pub unsafe fn GetHwnd(&mut self) -> *mut HWND__[src]

Trait Implementations

impl<ID: Clone + Hash> Control for Canvas<ID>[src]

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

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

type Target = ID2D1HwndRenderTarget

The resulting type after dereferencing.

Auto Trait Implementations

impl<ID> !Send for Canvas<ID>

impl<ID> !Sync for Canvas<ID>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]