Trait components::CanvasContext[]

pub trait CanvasContext {
    type Pattern;
Show methods pub fn get_direction(&self) -> Direction;
pub fn set_direction(&self, value: Direction) -> String;
pub fn set_fill_color(&self, value: Color<f64>);
pub fn set_fill_gradient(&self, value: &Gradient);
pub fn set_fill_pattern(&self, value: &Self::Pattern);
pub fn get_filter(&self) -> String;
pub fn set_filter(&self, value: &str);
pub fn get_font(&self) -> String;
pub fn set_font(
        &self,
        family: &str,
        style: TextStyle,
        weight: TextWeight,
        size: f64
    );
pub fn get_global_alpha(&self) -> f64;
pub fn set_global_alpha(&self, value: f64);
pub fn get_global_composite_operation(&self) -> String;
pub fn set_global_composite_operation(&self, value: &str);
pub fn is_image_smoothing_enabled(&self) -> bool;
pub fn set_image_smoothing(&self, value: bool);
pub fn get_line_cap(&self) -> LineCap;
pub fn set_line_cap(&self, value: LineCap);
pub fn get_line_dash_offset(&self) -> f64;
pub fn set_line_dash_offset(&self, value: f64);
pub fn get_line_join(&self) -> LineJoin;
pub fn set_line_join(&self, value: LineJoin);
pub fn get_line_width(&self) -> f64;
pub fn set_line_width(&self, value: f64);
pub fn get_miter_limit(&self) -> f64;
pub fn set_miter_limit(&self, value: f64);
pub fn get_shadow_blur(&self) -> f64;
pub fn set_shadow_blur(&self, value: f64);
pub fn get_shadow_color(&self) -> Color<f64>;
pub fn set_shadow_color(&self, value: Color<f64>);
pub fn get_shadow_offset_x(&self) -> f64;
pub fn set_shadow_offset_x(&self, value: f64);
pub fn get_shadow_offset_y(&self) -> f64;
pub fn set_shadow_offset_y(&self, value: f64);
pub fn set_stroke_color(&self, value: Color<f64>);
pub fn set_stroke_gradient(&self, value: &Gradient);
pub fn set_stroke_pattern(&self, value: &Self::Pattern);
pub fn get_text_align(&self) -> TextAlign;
pub fn set_text_align(&self, value: TextAlign);
pub fn get_text_baseline(&self) -> BaseLine;
pub fn set_text_baseline(&self, value: BaseLine);
pub fn arc(
        &self,
        x: f64,
        y: f64,
        radius: f64,
        start_angle: f64,
        end_angle: f64,
        anticlockwise: bool
    );
pub fn arc_to(&self, x1: f64, y1: f64, x2: f64, y2: f64, radius: f64);
pub fn begin_path(&self);
pub fn bezier_curve_to(
        &self,
        cp1x: f64,
        cp1y: f64,
        cp2x: f64,
        cp2y: f64,
        x: f64,
        y: f64
    );
pub fn clear_rect(&self, x: f64, y: f64, width: f64, height: f64);
pub fn close_path(&self);
pub fn ellipse(
        &self,
        x: f64,
        y: f64,
        radius_x: f64,
        radius_y: f64,
        rotation: f64,
        start_angle: f64,
        end_angle: f64,
        anticlockwise: bool
    );
pub fn fill(&self);
pub fn fill_rect(&self, x: f64, y: f64, width: f64, height: f64);
pub fn fill_text(&self, text: &str, x: f64, y: f64);
pub fn get_line_dash(&self) -> Vec<f64, Global>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
;
pub fn line_to(&self, x: f64, y: f64);
pub fn measure_text(&self, text: &str) -> TextMetrics;
pub fn move_to(&self, 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 reset_transform(&self);
pub fn restore(&self);
pub fn rotate(&self, angle: f64);
pub fn save(&self);
pub fn scale(&self, x: f64, y: f64);
pub fn set_line_dash(&self, dash: &Vec<f64, Global>);
pub fn set_transform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64);
pub fn stroke(&self);
pub fn stroke_rect(&self, x: f64, y: f64, width: f64, height: f64);
pub fn stroke_text(&self, text: &str, x: f64, y: f64);
pub fn transform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64);
pub fn translate(&self, x: f64, y: f64);
}

Associated Types

type Pattern

Loading content...

Required methods

pub fn get_direction(&self) -> Direction

Get direction

pub fn set_direction(&self, value: Direction) -> String

Set direction

pub fn set_fill_color(&self, value: Color<f64>)

Set fill color

pub fn set_fill_gradient(&self, value: &Gradient)

Set fill gradient

pub fn set_fill_pattern(&self, value: &Self::Pattern)

Set fill pattern

pub fn get_filter(&self) -> String

Get filter

pub fn set_filter(&self, value: &str)

Set filter

pub fn get_font(&self) -> String

Get font

pub fn set_font(
    &self,
    family: &str,
    style: TextStyle,
    weight: TextWeight,
    size: f64
)

Set direction

pub fn get_global_alpha(&self) -> f64

Get global alpha

pub fn set_global_alpha(&self, value: f64)

Set global alpha

pub fn get_global_composite_operation(&self) -> String

Get global composite operation

pub fn set_global_composite_operation(&self, value: &str)

Set global composite operation

pub fn is_image_smoothing_enabled(&self) -> bool

Whether images and patterns on this canvas will be smoothed when this canvas is scaled.

pub fn set_image_smoothing(&self, value: bool)

Set image smoothing

pub fn get_line_cap(&self) -> LineCap

Get line cap

pub fn set_line_cap(&self, value: LineCap)

Set line cap

pub fn get_line_dash_offset(&self) -> f64

Get line dash offset

pub fn set_line_dash_offset(&self, value: f64)

Set line dash offset

pub fn get_line_join(&self) -> LineJoin

Get line join

pub fn set_line_join(&self, value: LineJoin)

Set line dash

pub fn get_line_width(&self) -> f64

Get line width

pub fn set_line_width(&self, value: f64)

Set line width

pub fn get_miter_limit(&self) -> f64

Get miter limit

pub fn set_miter_limit(&self, value: f64)

Set miter limit

pub fn get_shadow_blur(&self) -> f64

Get shadow blur

pub fn set_shadow_blur(&self, value: f64)

Set shadow blur

pub fn get_shadow_color(&self) -> Color<f64>

Get shadow color

pub fn set_shadow_color(&self, value: Color<f64>)

Set shadow color

pub fn get_shadow_offset_x(&self) -> f64

Get shadow offset x

pub fn set_shadow_offset_x(&self, value: f64)

Set shadow offset x

pub fn get_shadow_offset_y(&self) -> f64

Get shadow offset y

pub fn set_shadow_offset_y(&self, value: f64)

Set shadow offset y

pub fn set_stroke_color(&self, value: Color<f64>)

Set stroke color

pub fn set_stroke_gradient(&self, value: &Gradient)

Set stroke gradient

pub fn set_stroke_pattern(&self, value: &Self::Pattern)

Set stroke pattern

pub fn get_text_align(&self) -> TextAlign

Get text align

pub fn set_text_align(&self, value: TextAlign)

Set text align

pub fn get_text_baseline(&self) -> BaseLine

Get text baseline

pub fn set_text_baseline(&self, value: BaseLine)

Set text baseline

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

Add arc to current path with anticlockwise param

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

Add arc to current path

pub fn begin_path(&self)

Begin the path

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

Add bezier curve to current path

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

Clear rectangle on current canvas

pub fn close_path(&self)

Close the current path

pub fn ellipse(
    &self,
    x: f64,
    y: f64,
    radius_x: f64,
    radius_y: f64,
    rotation: f64,
    start_angle: f64,
    end_angle: f64,
    anticlockwise: bool
)

Add ellipse to current path

pub fn fill(&self)

Fill current path

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

Fill rectangle

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

Draws text to the canvas.

pub fn get_line_dash(&self) -> Vec<f64, Global>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator

Get line dash

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

Add line to path from current position

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

Measure text using current font face and font size

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

Move cursor to position

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

Add quadratic curve to current path

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

Add rectangle to current path

pub fn reset_transform(&self)

Reset current transformations

pub fn restore(&self)

Restore transformations

pub fn rotate(&self, angle: f64)

Add rotate to current transformations

pub fn save(&self)

Save current transformations

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

Add scle to current transformations

pub fn set_line_dash(&self, dash: &Vec<f64, Global>)

Set line dash

pub fn set_transform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64)

Set transform matrix

pub fn stroke(&self)

Stroke current path

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

Stroke rectangle

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

Stroke text

pub fn transform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64)

Add transform matrix to current transformations

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

Add translate to current transformations

Loading content...

Implementors

impl<'a> CanvasContext for Canvas<'a>[src]

type Pattern = Pattern

impl<'a, C> CanvasContext for RoughCanvas<'a, C> where
    C: CanvasContext<Pattern = Pattern>, 
[src]

type Pattern = Pattern

Loading content...