pub trait CanvasDevice {
Show 22 methods
// Required methods
fn restore(&self);
fn save(&self);
fn set_transform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64);
fn set_fill_style_str(&self, value: &str);
fn fill_rect(&self, x: f64, y: f64, w: f64, h: f64);
fn put_image_data(&self, imagedata: &ImageData, dx: f64, dy: f64);
fn global_composite_operation(&self) -> String;
fn set_global_composite_operation(&self, value: &str);
fn draw_image_with_offscreen_canvas(
&self,
image: &OffscreenCanvas,
dx: f64,
dy: f64,
);
fn clip_with_path_2d(&self, path: &Path2d);
fn set_stroke_style_str(&self, value: &str);
fn stroke_with_path(&self, path: &Path2d);
fn draw_image_with_image_bitmap_and_dw_and_dh(
&self,
image: &ImageBitmap,
dx: f64,
dy: f64,
dw: f64,
dh: f64,
);
fn draw_image_with_offscreen_canvas_and_dw_and_dh(
&self,
image: &OffscreenCanvas,
dx: f64,
dy: f64,
dw: f64,
dh: f64,
);
fn set_line_width(&self, value: f64);
fn set_line_cap(&self, value: &str);
fn set_line_join(&self, value: &str);
fn set_miter_limit(&self, value: f64);
fn set_line_dash_offset(&self, value: f64);
fn set_line_dash(&self, segments: &JsValue);
fn fill_with_path_2d(&self, path: &Path2d);
fn fill_with_path_2d_and_winding(
&self,
path: &Path2d,
winding: CanvasWindingRule,
);
}Required Methods§
Sourcefn set_transform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64)
fn set_transform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64)
The setTransform() method.
Sourcefn set_fill_style_str(&self, value: &str)
fn set_fill_style_str(&self, value: &str)
Setter for the fillStyle field of this object.
Sourcefn put_image_data(&self, imagedata: &ImageData, dx: f64, dy: f64)
fn put_image_data(&self, imagedata: &ImageData, dx: f64, dy: f64)
The putImageData() method.
Sourcefn global_composite_operation(&self) -> String
fn global_composite_operation(&self) -> String
Getter for the globalCompositeOperation field of this object.
Sourcefn set_global_composite_operation(&self, value: &str)
fn set_global_composite_operation(&self, value: &str)
Setter for the globalCompositeOperation field of this object.
Sourcefn draw_image_with_offscreen_canvas(
&self,
image: &OffscreenCanvas,
dx: f64,
dy: f64,
)
fn draw_image_with_offscreen_canvas( &self, image: &OffscreenCanvas, dx: f64, dy: f64, )
The drawImage() method.
Sourcefn clip_with_path_2d(&self, path: &Path2d)
fn clip_with_path_2d(&self, path: &Path2d)
The clip() method.
Sourcefn set_stroke_style_str(&self, value: &str)
fn set_stroke_style_str(&self, value: &str)
Setter for the strokeStyle field of this object.
Sourcefn stroke_with_path(&self, path: &Path2d)
fn stroke_with_path(&self, path: &Path2d)
The stroke() method.
Sourcefn draw_image_with_image_bitmap_and_dw_and_dh(
&self,
image: &ImageBitmap,
dx: f64,
dy: f64,
dw: f64,
dh: f64,
)
fn draw_image_with_image_bitmap_and_dw_and_dh( &self, image: &ImageBitmap, dx: f64, dy: f64, dw: f64, dh: f64, )
The drawImage() method.
Sourcefn draw_image_with_offscreen_canvas_and_dw_and_dh(
&self,
image: &OffscreenCanvas,
dx: f64,
dy: f64,
dw: f64,
dh: f64,
)
fn draw_image_with_offscreen_canvas_and_dw_and_dh( &self, image: &OffscreenCanvas, dx: f64, dy: f64, dw: f64, dh: f64, )
The drawImage() method.
Sourcefn set_line_width(&self, value: f64)
fn set_line_width(&self, value: f64)
Setter for the lineWidth field of this object.
Sourcefn set_line_cap(&self, value: &str)
fn set_line_cap(&self, value: &str)
Setter for the lineCap field of this object.
Sourcefn set_line_join(&self, value: &str)
fn set_line_join(&self, value: &str)
Setter for the lineJoin field of this object.
Sourcefn set_miter_limit(&self, value: f64)
fn set_miter_limit(&self, value: f64)
Setter for the miterLimit field of this object.
Sourcefn set_line_dash_offset(&self, value: f64)
fn set_line_dash_offset(&self, value: f64)
Setter for the lineDashOffset field of this object.
Sourcefn set_line_dash(&self, segments: &JsValue)
fn set_line_dash(&self, segments: &JsValue)
The setLineDash() method.
Sourcefn fill_with_path_2d(&self, path: &Path2d)
fn fill_with_path_2d(&self, path: &Path2d)
The fill() method.
Sourcefn fill_with_path_2d_and_winding(
&self,
path: &Path2d,
winding: CanvasWindingRule,
)
fn fill_with_path_2d_and_winding( &self, path: &Path2d, winding: CanvasWindingRule, )
The fill() method.