pub struct Canvas { /* private fields */ }Expand description
A canvas for drawing images.
Implementations§
Source§impl Canvas
impl Canvas
Sourcepub fn set_transform(&mut self, transform: &Transform)
pub fn set_transform(&mut self, transform: &Transform)
Sets the transformation matrix for the canvas.
Sourcepub fn draw_image(&mut self, image: &ImageRef, dst_rect: Rect)
pub fn draw_image(&mut self, image: &ImageRef, dst_rect: Rect)
Draws an image onto the canvas.
Sourcepub fn copy_image(&mut self, image: &ImageRef, src_rect: Rect, dst_rect: Rect)
pub fn copy_image(&mut self, image: &ImageRef, src_rect: Rect, dst_rect: Rect)
Copies an area of the canvas onto another area.
Sourcepub fn stroke(&mut self, path: &Path, style: &StrokeStyle)
pub fn stroke(&mut self, path: &Path, style: &StrokeStyle)
Strokes a path with a given style.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Canvas
impl RefUnwindSafe for Canvas
impl Send for Canvas
impl Sync for Canvas
impl Unpin for Canvas
impl UnwindSafe for Canvas
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more