pub trait CanvasRenderingContext2DMethods<D: DomTypes> {
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);
}