pub struct Canvas<T: CanvasBackend> { /* private fields */ }
Implementations§
Source§impl<T: CanvasBackend> Canvas<T>
impl<T: CanvasBackend> Canvas<T>
pub fn from_layer( context: Option<&DeviceContext<T::DeviceContextType>>, layer: &Layer<T::LayerType>, ) -> Result<Self, GraphicsError>
pub fn from_window( context: Option<&DeviceContext<T::DeviceContextType>>, window: &Window, ) -> Result<Self, GraphicsError>
pub fn device_context(&self) -> Option<DeviceContext<T::DeviceContextType>>
pub fn size(&self) -> FSize
pub fn pixel_size(&self) -> ISize
pub fn bounds(&self) -> FRect
pub fn save(&mut self) -> bool
pub fn restore(&mut self) -> bool
pub fn begin_draw(&mut self)
pub fn end_draw(&mut self)
pub fn get_opacity(&self) -> Float
pub fn set_opacity(&mut self, opacity: Float)
pub fn get_blend_mode(&self) -> BlendMode
pub fn set_blend_mode(&mut self, mode: BlendMode)
pub fn get_draw_mode(&self) -> DrawMode
pub fn set_draw_mode(&mut self, mode: DrawMode)
pub fn get_line_dash(&self) -> (Option<Vec<Float>>, Float)
pub fn set_line_dash(&mut self, dashes: &[Float], offset: Float)
pub fn get_matrix(&self) -> Matrix<T::MatrixType>
pub fn set_matrix(&mut self, matrix: &Matrix<T::MatrixType>)
pub fn concat_matrix(&mut self, matrix: &Matrix<T::MatrixType>)
pub fn get_miter_limit(&self) -> Float
pub fn set_miter_limit(&mut self, miter_limit: Float)
pub fn get_smooth(&self) -> bool
pub fn set_smooth(&mut self, smooth: bool)
pub fn get_stroke_cap(&self) -> Cap
pub fn set_stroke_cap(&mut self, cap: Cap)
pub fn get_stroke_join(&self) -> Join
pub fn set_stroke_join(&mut self, join: Join)
pub fn get_stroke_width(&self) -> Float
pub fn set_stroke_width(&mut self, width: Float)
pub fn set_brush(&mut self, brush: &Brush<T::BrushType>)
pub fn get_font_family(&self) -> &str
pub fn set_font_family(&mut self, family: &str)
pub fn get_font_size(&self) -> Float
pub fn set_font_size(&mut self, size: Float)
pub fn get_font_style(&self) -> FontStyle
pub fn set_font_style(&mut self, style: FontStyle)
pub fn get_font_weight(&self) -> FontWeight
pub fn set_font_weight(&mut self, weight: FontWeight)
pub fn get_text_alignment(&self) -> TextAlignment
pub fn set_text_alignment(&mut self, alignment: TextAlignment)
pub fn get_text_color(&self) -> Color
pub fn set_text_color(&mut self, color: Color)
pub fn rotate(&mut self, angle: Float)
pub fn scale(&mut self, x: Float, y: Float)
pub fn translate(&mut self, x: Float, y: Float)
pub fn clear(&mut self, color: Color)
pub fn clip_to_rect(&mut self, rect: FRect)
pub fn clip_to_path(&mut self, path: &Path<T::PathType>)
pub fn draw_line(&mut self, x1: Float, y1: Float, x2: Float, y2: Float) -> bool
pub fn draw_rect( &mut self, x: Float, y: Float, width: Float, height: Float, ) -> bool
pub fn draw_rounded_rect( &mut self, x: Float, y: Float, width: Float, height: Float, radius: Float, ) -> bool
pub fn draw_circle(&mut self, x: Float, y: Float, radius: Float) -> bool
pub fn draw_ellipse( &mut self, x: Float, y: Float, width: Float, height: Float, ) -> bool
pub fn draw_path(&mut self, path: &Path<T::PathType>) -> bool
pub fn draw_bitmap( &mut self, bitmap: &Bitmap<T::BitmapType>, source_rect: Option<FRect>, dest_rect: FRect, ) -> bool
pub fn draw_layer( &mut self, layer: &Layer<T::LayerType>, dest_rect: FRect, ) -> bool
pub fn draw_text(&mut self, text: &str, rect: FRect) -> bool
pub fn draw_text_at(&mut self, text: &str, x: Float, y: Float) -> bool
pub fn map_rect(&self, rect: FRect) -> FRect
pub fn fill_rect( &mut self, x: Float, y: Float, width: Float, height: Float, mask: Option<&Bitmap<T::BitmapType>>, ) -> bool
Source§impl Canvas<DefaultCanvas>
impl Canvas<DefaultCanvas>
pub fn default_from_layer( context: Option<&DeviceContext<DefaultDeviceContext>>, layer: &Layer<DefaultLayer>, ) -> Result<Self, GraphicsError>
pub fn default_from_window( context: Option<&DeviceContext<DefaultDeviceContext>>, window: &Window, ) -> Result<Self, GraphicsError>
Auto Trait Implementations§
impl<T> Freeze for Canvas<T>where
T: Freeze,
impl<T> RefUnwindSafe for Canvas<T>where
T: RefUnwindSafe,
impl<T> Send for Canvas<T>where
T: Send,
impl<T> Sync for Canvas<T>where
T: Sync,
impl<T> Unpin for Canvas<T>where
T: Unpin,
impl<T> UnwindSafe for Canvas<T>where
T: UnwindSafe,
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