Struct native_windows_gui::Canvas
[−]
[src]
pub struct Canvas<ID: Clone + Hash> { /* fields omitted */ }
A blank control that can be painted to
Methods
impl<ID: Clone + Hash> Canvas<ID>
[src]
fn renderer<'a>(&'a mut self) -> Result<CanvasRenderer<'a, ID>, Error>
Make the canvas "paint ready" and return an object to paint to it. In very very very rare case, the renderer creation can fail.
fn create_solid_brush(
&mut self,
name: &ID,
brush: &SolidBrush
) -> Result<(), Error>
&mut self,
name: &ID,
brush: &SolidBrush
) -> Result<(), Error>
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
fn create_pen(&mut self, name: &ID, pen: &Pen) -> Result<(), Error>
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
fn redraw(&self)
Redraw the canvas
fn set_render_size(&mut self, w: u32, h: u32)
Set the render target resolution.
If the control size do not match the render target size, the result will be upscaled or downscaled
fn get_dpi(&mut self) -> (f32, f32)
Return the render target's dots per inch (DPI).
fn set_dpi(&mut self, dpix: f32, fpiy: f32)
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.
fn get_visibility(&self) -> bool
fn set_visibility(&self, visible: bool)
fn get_position(&self) -> (i32, i32)
fn set_position(&self, x: i32, y: i32)
fn get_size(&self) -> (u32, u32)
fn set_size(&self, w: u32, h: u32)
fn get_enabled(&self) -> bool
fn set_enabled(&self, e: bool)
Methods from Deref<Target = ID2D1HwndRenderTarget>
unsafe fn CheckWindowState(&mut self) -> D2D1_WINDOW_STATE
unsafe fn Resize(&mut self, pixelSize: *const D2D_SIZE_U) -> i32
unsafe fn GetHwnd(&mut self) -> *mut HWND__
Trait Implementations
impl<ID: Clone + Hash> Control for Canvas<ID>
[src]
fn handle(&self) -> AnyHandle
Should return the underlying handle to the object
fn control_type(&self) -> ControlType
Should return the type of the control. For custom controls, the return value should be Undefined
(the default).
fn free(&mut self)
If specified, should free any ressource allocated in the template build
function. This includes functions like DestroyWindow
.
impl<'a, ID: Clone + Hash> Deref for Canvas<ID>
[src]
type Target = ID2D1HwndRenderTarget
The resulting type after dereferencing
fn deref(&self) -> &ID2D1HwndRenderTarget
The method called to dereference a value
impl<'a, ID: Clone + Hash> DerefMut for Canvas<ID>
[src]
fn deref_mut(&mut self) -> &mut ID2D1HwndRenderTarget
The method called to mutably dereference a value