Canvas

Struct Canvas 

Source
pub struct Canvas;

Implementations§

Source§

impl Canvas

Source

pub fn save(&self) -> usize

Source

pub fn restore(&self)

Source

pub fn restore_to_count(&self, layer: usize)

Source

pub fn concat(&self, _matrix: &Matrix)

Source

pub fn clip_rect(&self, _rect: Rect, _clip: ClipOp, _: bool)

Source

pub fn clip_rrect(&self, _rect: RRect, _clip: ClipOp, _: bool)

Source

pub fn draw_image_nine( &self, _image: Image, _center: IRect, _dst: Rect, _filter_mode: FilterMode, _paint: Option<&Paint>, ) -> &Self

Source

pub fn draw_image_rect( &self, image: impl AsRef<Image>, src: Option<(&Rect, SrcRectConstraint)>, dst: impl AsRef<Rect>, paint: &Paint, ) -> &Self

Source

pub fn draw_image_rect_with_sampling_options( &self, image: impl AsRef<Image>, src: Option<(&Rect, SrcRectConstraint)>, dst: impl AsRef<Rect>, sampling_options: impl Into<SamplingOptions>, paint: &Paint, ) -> &Self

Source

pub fn draw_rect(&self, _rect: Rect, _paint: &Paint) -> &Self

Source

pub fn draw_drrect( &self, outer: impl AsRef<RRect>, inner: impl AsRef<RRect>, paint: &Paint, ) -> &Self

Source

pub fn draw_path(&self, _path: &Path, _paint: &Paint) -> &Self

Source

pub fn clip_path( &self, _path: &Path, _op: impl Into<Option<ClipOp>>, _do_anti_alias: impl Into<Option<bool>>, ) -> &Self

Source

pub fn translate(&self, _d: impl Into<Point>) -> &Self

Source

pub fn scale(&self, _: impl Into<Point>)

Source

pub fn clear(&self, _: Color)

Source

pub fn draw_paint(&self, _: &Paint) -> &Self

Source

pub fn draw_line( &self, _p1: impl Into<Point>, _p2: impl Into<Point>, _paint: &Paint, ) -> &Self

Source

pub fn draw_circle( &self, _center: impl Into<Point>, _radius: f32, _paint: &Paint, ) -> &Self

Source

pub fn save_layer(&self, layer_rec: &SaveLayerRec) -> usize

Source

pub fn save_layer_alpha_f( &self, bounds: impl Into<Option<Rect>>, alpha: f32, ) -> usize

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.