pub struct CanvasContext(/* private fields */);
Implementations§
Source§impl CanvasContext
impl CanvasContext
pub fn from_element(element: &ExternRef) -> Self
pub fn set_fill_style(&self, style: &str)
pub fn fill_rect(&self, x: f64, y: f64, width: f64, height: f64)
pub fn clear_rect(&self, x: f64, y: f64, width: f64, height: f64)
pub fn set_font(&self, font: &str)
pub fn set_text_align(&self, align: &str)
pub fn set_text_baseline(&self, baseline: &str)
pub fn fill_text(&self, text: &str, x: f64, y: f64)
pub fn measure_text(&self, text: &str) -> f64
pub fn set_line_width(&self, width: f64)
pub fn set_stroke_style(&self, style: &str)
pub fn stroke_rect(&self, x: f64, y: f64, width: f64, height: f64)
pub fn begin_path(&self)
pub fn move_to(&self, x: f64, y: f64)
pub fn line_to(&self, x: f64, y: f64)
pub fn stroke(&self)
pub fn close_path(&self)
pub fn fill(&self)
pub fn arc(&self, x: f64, y: f64, radius: f64, start_angle: f64, end_angle: f64)
pub fn arc_to(&self, x1: f64, y1: f64, x2: f64, y2: f64, radius: f64)
pub fn bezier_curve_to( &self, cp1x: f64, cp1y: f64, cp2x: f64, cp2y: f64, x: f64, y: f64, )
pub fn quadratic_curve_to(&self, cpx: f64, cpy: f64, x: f64, y: f64)
pub fn rect(&self, x: f64, y: f64, width: f64, height: f64)
pub fn clip(&self)
pub fn draw_image(&self, image: &ExternRef, dx: f64, dy: f64)
pub fn draw_image_with_size( &self, image: &ExternRef, dx: f64, dy: f64, dwidth: f64, dheight: f64, )
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§
impl Freeze for CanvasContext
impl RefUnwindSafe for CanvasContext
impl Send for CanvasContext
impl Sync for CanvasContext
impl Unpin for CanvasContext
impl UnwindSafe for CanvasContext
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