CanvasContext

Struct CanvasContext 

Source
pub struct CanvasContext(/* private fields */);

Implementations§

Source§

impl CanvasContext

Source

pub fn from_element(element: &ExternRef) -> Self

Source

pub fn set_fill_style(&self, style: &str)

Source

pub fn fill_rect(&self, x: f64, y: f64, width: f64, height: f64)

Source

pub fn clear_rect(&self, x: f64, y: f64, width: f64, height: f64)

Source

pub fn set_font(&self, font: &str)

Source

pub fn set_text_align(&self, align: &str)

Source

pub fn set_text_baseline(&self, baseline: &str)

Source

pub fn fill_text(&self, text: &str, x: f64, y: f64)

Source

pub fn measure_text(&self, text: &str) -> f64

Source

pub fn set_line_width(&self, width: f64)

Source

pub fn set_stroke_style(&self, style: &str)

Source

pub fn stroke_rect(&self, x: f64, y: f64, width: f64, height: f64)

Source

pub fn begin_path(&self)

Source

pub fn move_to(&self, x: f64, y: f64)

Source

pub fn line_to(&self, x: f64, y: f64)

Source

pub fn stroke(&self)

Source

pub fn close_path(&self)

Source

pub fn fill(&self)

Source

pub fn arc(&self, x: f64, y: f64, radius: f64, start_angle: f64, end_angle: f64)

Source

pub fn arc_to(&self, x1: f64, y1: f64, x2: f64, y2: f64, radius: f64)

Source

pub fn bezier_curve_to( &self, cp1x: f64, cp1y: f64, cp2x: f64, cp2y: f64, x: f64, y: f64, )

Source

pub fn quadratic_curve_to(&self, cpx: f64, cpy: f64, x: f64, y: f64)

Source

pub fn rect(&self, x: f64, y: f64, width: f64, height: f64)

Source

pub fn clip(&self)

Source

pub fn draw_image(&self, image: &ExternRef, dx: f64, dy: f64)

Source

pub fn draw_image_with_size( &self, image: &ExternRef, dx: f64, dy: f64, dwidth: f64, dheight: f64, )

Source

pub fn draw_image_with_source( &self, image: &ExternRef, sx: f64, sy: f64, swidth: f64, sheight: f64, dx: f64, dy: f64, dwidth: f64, dheight: f64, )

Auto Trait Implementations§

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.