pub trait CanvasRenderingContext2DMethods {
Show 75 methods // Required methods fn Canvas(&self) -> Root<Dom<HTMLCanvasElement>>; fn GlobalAlpha(&self) -> f64; fn SetGlobalAlpha(&self, value: f64); fn GlobalCompositeOperation(&self) -> DOMString; fn SetGlobalCompositeOperation(&self, value: DOMString); fn DrawImage( &self, image: HTMLImageElementOrHTMLCanvasElementOrOffscreenCanvasOrCSSStyleValue, dx: f64, dy: f64, ) -> Result<(), Error>; fn DrawImage_( &self, image: HTMLImageElementOrHTMLCanvasElementOrOffscreenCanvasOrCSSStyleValue, dx: f64, dy: f64, dw: f64, dh: f64, ) -> Result<(), Error>; fn DrawImage__( &self, image: HTMLImageElementOrHTMLCanvasElementOrOffscreenCanvasOrCSSStyleValue, sx: f64, sy: f64, sw: f64, sh: f64, dx: f64, dy: f64, dw: f64, dh: f64, ) -> Result<(), Error>; fn BeginPath(&self); fn Fill(&self, fillRule: CanvasFillRule); fn Stroke(&self); fn Clip(&self, fillRule: CanvasFillRule); fn IsPointInPath(&self, x: f64, y: f64, fillRule: CanvasFillRule) -> bool; fn StrokeStyle(&self) -> StringOrCanvasGradientOrCanvasPattern; fn SetStrokeStyle( &self, value: StringOrCanvasGradientOrCanvasPattern, _can_gc: CanGc, ); fn FillStyle(&self) -> StringOrCanvasGradientOrCanvasPattern; fn SetFillStyle( &self, value: StringOrCanvasGradientOrCanvasPattern, _can_gc: CanGc, ); fn CreateLinearGradient( &self, x0: Finite<f64>, y0: Finite<f64>, x1: Finite<f64>, y1: Finite<f64>, ) -> Root<Dom<CanvasGradient>>; fn CreateRadialGradient( &self, x0: Finite<f64>, y0: Finite<f64>, r0: Finite<f64>, x1: Finite<f64>, y1: Finite<f64>, r1: Finite<f64>, ) -> Result<Root<Dom<CanvasGradient>>, Error>; fn CreatePattern( &self, image: HTMLImageElementOrHTMLCanvasElementOrOffscreenCanvasOrCSSStyleValue, repetition: DOMString, ) -> Result<Option<Root<Dom<CanvasPattern>>>, Error>; fn CreateImageData( &self, sw: i32, sh: i32, _can_gc: CanGc, ) -> Result<Root<Dom<ImageData>>, Error>; fn CreateImageData_( &self, imagedata: &ImageData, _can_gc: CanGc, ) -> Result<Root<Dom<ImageData>>, Error>; fn GetImageData( &self, sx: i32, sy: i32, sw: i32, sh: i32, _can_gc: CanGc, ) -> Result<Root<Dom<ImageData>>, Error>; fn PutImageData(&self, imagedata: &ImageData, dx: i32, dy: i32); fn PutImageData_( &self, imagedata: &ImageData, dx: i32, dy: i32, dirtyX: i32, dirtyY: i32, dirtyWidth: i32, dirtyHeight: i32, ); fn ImageSmoothingEnabled(&self) -> bool; fn SetImageSmoothingEnabled(&self, value: bool); fn ClosePath(&self); fn MoveTo(&self, x: f64, y: f64); fn LineTo(&self, x: f64, y: f64); fn QuadraticCurveTo(&self, cpx: f64, cpy: f64, x: f64, y: f64); fn BezierCurveTo( &self, cp1x: f64, cp1y: f64, cp2x: f64, cp2y: f64, x: f64, y: f64, ); fn ArcTo( &self, x1: f64, y1: f64, x2: f64, y2: f64, radius: f64, ) -> Result<(), Error>; fn Rect(&self, x: f64, y: f64, w: f64, h: f64); fn Arc( &self, x: f64, y: f64, radius: f64, startAngle: f64, endAngle: f64, anticlockwise: bool, ) -> Result<(), Error>; fn Ellipse( &self, x: f64, y: f64, radius_x: f64, radius_y: f64, rotation: f64, startAngle: f64, endAngle: f64, anticlockwise: bool, ) -> Result<(), Error>; fn LineWidth(&self) -> f64; fn SetLineWidth(&self, value: f64); fn LineCap(&self) -> CanvasLineCap; fn SetLineCap(&self, value: CanvasLineCap); fn LineJoin(&self) -> CanvasLineJoin; fn SetLineJoin(&self, value: CanvasLineJoin); fn MiterLimit(&self) -> f64; fn SetMiterLimit(&self, value: f64); fn ClearRect(&self, x: f64, y: f64, w: f64, h: f64); fn FillRect(&self, x: f64, y: f64, w: f64, h: f64); fn StrokeRect(&self, x: f64, y: f64, w: f64, h: f64); fn ShadowOffsetX(&self) -> f64; fn SetShadowOffsetX(&self, value: f64); fn ShadowOffsetY(&self) -> f64; fn SetShadowOffsetY(&self, value: f64); fn ShadowBlur(&self) -> f64; fn SetShadowBlur(&self, value: f64); fn ShadowColor(&self) -> DOMString; fn SetShadowColor(&self, value: DOMString, _can_gc: CanGc); fn Save(&self); fn Restore(&self); fn Reset(&self); fn FillText( &self, text: DOMString, x: f64, y: f64, maxWidth: Option<f64>, _can_gc: CanGc, ); fn MeasureText( &self, text: DOMString, _can_gc: CanGc, ) -> Root<Dom<TextMetrics>>; fn Font(&self) -> DOMString; fn SetFont(&self, value: DOMString, _can_gc: CanGc); fn TextAlign(&self) -> CanvasTextAlign; fn SetTextAlign(&self, value: CanvasTextAlign); fn TextBaseline(&self) -> CanvasTextBaseline; fn SetTextBaseline(&self, value: CanvasTextBaseline); fn Direction(&self) -> CanvasDirection; fn SetDirection(&self, value: CanvasDirection); fn Scale(&self, x: f64, y: f64); fn Rotate(&self, angle: f64); fn Translate(&self, x: f64, y: f64); fn Transform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64); fn GetTransform(&self, _can_gc: CanGc) -> Root<Dom<DOMMatrix>>; fn SetTransform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64); fn ResetTransform(&self);
}

Required Methods§

source

fn Canvas(&self) -> Root<Dom<HTMLCanvasElement>>

source

fn GlobalAlpha(&self) -> f64

source

fn SetGlobalAlpha(&self, value: f64)

source

fn GlobalCompositeOperation(&self) -> DOMString

source

fn SetGlobalCompositeOperation(&self, value: DOMString)

source

fn DrawImage( &self, image: HTMLImageElementOrHTMLCanvasElementOrOffscreenCanvasOrCSSStyleValue, dx: f64, dy: f64, ) -> Result<(), Error>

source

fn DrawImage_( &self, image: HTMLImageElementOrHTMLCanvasElementOrOffscreenCanvasOrCSSStyleValue, dx: f64, dy: f64, dw: f64, dh: f64, ) -> Result<(), Error>

source

fn DrawImage__( &self, image: HTMLImageElementOrHTMLCanvasElementOrOffscreenCanvasOrCSSStyleValue, sx: f64, sy: f64, sw: f64, sh: f64, dx: f64, dy: f64, dw: f64, dh: f64, ) -> Result<(), Error>

source

fn BeginPath(&self)

source

fn Fill(&self, fillRule: CanvasFillRule)

source

fn Stroke(&self)

source

fn Clip(&self, fillRule: CanvasFillRule)

source

fn IsPointInPath(&self, x: f64, y: f64, fillRule: CanvasFillRule) -> bool

source

fn StrokeStyle(&self) -> StringOrCanvasGradientOrCanvasPattern

source

fn SetStrokeStyle( &self, value: StringOrCanvasGradientOrCanvasPattern, _can_gc: CanGc, )

source

fn FillStyle(&self) -> StringOrCanvasGradientOrCanvasPattern

source

fn SetFillStyle( &self, value: StringOrCanvasGradientOrCanvasPattern, _can_gc: CanGc, )

source

fn CreateLinearGradient( &self, x0: Finite<f64>, y0: Finite<f64>, x1: Finite<f64>, y1: Finite<f64>, ) -> Root<Dom<CanvasGradient>>

source

fn CreateRadialGradient( &self, x0: Finite<f64>, y0: Finite<f64>, r0: Finite<f64>, x1: Finite<f64>, y1: Finite<f64>, r1: Finite<f64>, ) -> Result<Root<Dom<CanvasGradient>>, Error>

source

fn CreatePattern( &self, image: HTMLImageElementOrHTMLCanvasElementOrOffscreenCanvasOrCSSStyleValue, repetition: DOMString, ) -> Result<Option<Root<Dom<CanvasPattern>>>, Error>

source

fn CreateImageData( &self, sw: i32, sh: i32, _can_gc: CanGc, ) -> Result<Root<Dom<ImageData>>, Error>

source

fn CreateImageData_( &self, imagedata: &ImageData, _can_gc: CanGc, ) -> Result<Root<Dom<ImageData>>, Error>

source

fn GetImageData( &self, sx: i32, sy: i32, sw: i32, sh: i32, _can_gc: CanGc, ) -> Result<Root<Dom<ImageData>>, Error>

source

fn PutImageData(&self, imagedata: &ImageData, dx: i32, dy: i32)

source

fn PutImageData_( &self, imagedata: &ImageData, dx: i32, dy: i32, dirtyX: i32, dirtyY: i32, dirtyWidth: i32, dirtyHeight: i32, )

source

fn ImageSmoothingEnabled(&self) -> bool

source

fn SetImageSmoothingEnabled(&self, value: bool)

source

fn ClosePath(&self)

source

fn MoveTo(&self, x: f64, y: f64)

source

fn LineTo(&self, x: f64, y: f64)

source

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

source

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

source

fn ArcTo( &self, x1: f64, y1: f64, x2: f64, y2: f64, radius: f64, ) -> Result<(), Error>

source

fn Rect(&self, x: f64, y: f64, w: f64, h: f64)

source

fn Arc( &self, x: f64, y: f64, radius: f64, startAngle: f64, endAngle: f64, anticlockwise: bool, ) -> Result<(), Error>

source

fn Ellipse( &self, x: f64, y: f64, radius_x: f64, radius_y: f64, rotation: f64, startAngle: f64, endAngle: f64, anticlockwise: bool, ) -> Result<(), Error>

source

fn LineWidth(&self) -> f64

source

fn SetLineWidth(&self, value: f64)

source

fn LineCap(&self) -> CanvasLineCap

source

fn SetLineCap(&self, value: CanvasLineCap)

source

fn LineJoin(&self) -> CanvasLineJoin

source

fn SetLineJoin(&self, value: CanvasLineJoin)

source

fn MiterLimit(&self) -> f64

source

fn SetMiterLimit(&self, value: f64)

source

fn ClearRect(&self, x: f64, y: f64, w: f64, h: f64)

source

fn FillRect(&self, x: f64, y: f64, w: f64, h: f64)

source

fn StrokeRect(&self, x: f64, y: f64, w: f64, h: f64)

source

fn ShadowOffsetX(&self) -> f64

source

fn SetShadowOffsetX(&self, value: f64)

source

fn ShadowOffsetY(&self) -> f64

source

fn SetShadowOffsetY(&self, value: f64)

source

fn ShadowBlur(&self) -> f64

source

fn SetShadowBlur(&self, value: f64)

source

fn ShadowColor(&self) -> DOMString

source

fn SetShadowColor(&self, value: DOMString, _can_gc: CanGc)

source

fn Save(&self)

source

fn Restore(&self)

source

fn Reset(&self)

source

fn FillText( &self, text: DOMString, x: f64, y: f64, maxWidth: Option<f64>, _can_gc: CanGc, )

source

fn MeasureText(&self, text: DOMString, _can_gc: CanGc) -> Root<Dom<TextMetrics>>

source

fn Font(&self) -> DOMString

source

fn SetFont(&self, value: DOMString, _can_gc: CanGc)

source

fn TextAlign(&self) -> CanvasTextAlign

source

fn SetTextAlign(&self, value: CanvasTextAlign)

source

fn TextBaseline(&self) -> CanvasTextBaseline

source

fn SetTextBaseline(&self, value: CanvasTextBaseline)

source

fn Direction(&self) -> CanvasDirection

source

fn SetDirection(&self, value: CanvasDirection)

source

fn Scale(&self, x: f64, y: f64)

source

fn Rotate(&self, angle: f64)

source

fn Translate(&self, x: f64, y: f64)

source

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

source

fn GetTransform(&self, _can_gc: CanGc) -> Root<Dom<DOMMatrix>>

source

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

source

fn ResetTransform(&self)

Implementors§