pub struct GraphicsContext { /* private fields */ }Implementations§
Source§impl GraphicsContext
impl GraphicsContext
pub fn new() -> Self
pub fn move_to(&mut self, x: f64, y: f64) -> &mut Self
pub fn line_to(&mut self, x: f64, y: f64) -> &mut Self
pub fn curve_to( &mut self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, ) -> &mut Self
pub fn rect(&mut self, x: f64, y: f64, width: f64, height: f64) -> &mut Self
pub fn circle(&mut self, cx: f64, cy: f64, radius: f64) -> &mut Self
pub fn close_path(&mut self) -> &mut Self
pub fn stroke(&mut self) -> &mut Self
pub fn fill(&mut self) -> &mut Self
pub fn fill_stroke(&mut self) -> &mut Self
pub fn set_stroke_color(&mut self, color: Color) -> &mut Self
pub fn set_fill_color(&mut self, color: Color) -> &mut Self
pub fn set_line_width(&mut self, width: f64) -> &mut Self
pub fn set_line_cap(&mut self, cap: LineCap) -> &mut Self
pub fn set_line_join(&mut self, join: LineJoin) -> &mut Self
Sourcepub fn set_opacity(&mut self, opacity: f64) -> &mut Self
pub fn set_opacity(&mut self, opacity: f64) -> &mut Self
Set the opacity for both fill and stroke operations (0.0 to 1.0)
Sourcepub fn set_fill_opacity(&mut self, opacity: f64) -> &mut Self
pub fn set_fill_opacity(&mut self, opacity: f64) -> &mut Self
Set the fill opacity (0.0 to 1.0)
Sourcepub fn set_stroke_opacity(&mut self, opacity: f64) -> &mut Self
pub fn set_stroke_opacity(&mut self, opacity: f64) -> &mut Self
Set the stroke opacity (0.0 to 1.0)
pub fn save_state(&mut self) -> &mut Self
pub fn restore_state(&mut self) -> &mut Self
pub fn translate(&mut self, tx: f64, ty: f64) -> &mut Self
pub fn scale(&mut self, sx: f64, sy: f64) -> &mut Self
pub fn rotate(&mut self, angle: f64) -> &mut Self
pub fn transform( &mut self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64, ) -> &mut Self
pub fn rectangle( &mut self, x: f64, y: f64, width: f64, height: f64, ) -> &mut Self
pub fn draw_image( &mut self, image_name: &str, x: f64, y: f64, width: f64, height: f64, ) -> &mut Self
Sourcepub fn uses_transparency(&self) -> bool
pub fn uses_transparency(&self) -> bool
Check if transparency is used (opacity != 1.0)
Sourcepub fn generate_graphics_state_dict(&self) -> Option<String>
pub fn generate_graphics_state_dict(&self) -> Option<String>
Generate the graphics state dictionary for transparency
Sourcepub fn fill_color(&self) -> Color
pub fn fill_color(&self) -> Color
Get the current fill color
Sourcepub fn stroke_color(&self) -> Color
pub fn stroke_color(&self) -> Color
Get the current stroke color
Sourcepub fn line_width(&self) -> f64
pub fn line_width(&self) -> f64
Get the current line width
Sourcepub fn fill_opacity(&self) -> f64
pub fn fill_opacity(&self) -> f64
Get the current fill opacity
Sourcepub fn stroke_opacity(&self) -> f64
pub fn stroke_opacity(&self) -> f64
Get the current stroke opacity
Sourcepub fn operations(&self) -> &str
pub fn operations(&self) -> &str
Get the operations string
Trait Implementations§
Source§impl Clone for GraphicsContext
impl Clone for GraphicsContext
Source§fn clone(&self) -> GraphicsContext
fn clone(&self) -> GraphicsContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GraphicsContext
impl RefUnwindSafe for GraphicsContext
impl Send for GraphicsContext
impl Sync for GraphicsContext
impl Unpin for GraphicsContext
impl UnwindSafe for GraphicsContext
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