Struct stdweb::web::CanvasRenderingContext2d
[−]
[src]
pub struct CanvasRenderingContext2d(_);
Used for drawing rectangles, text, images and other objects onto the canvas element.
Methods
impl CanvasRenderingContext2d
[src]
fn fill_rect(&self, x: f64, y: f64, width: f64, height: f64)
[src]
Draws a filled rectangle whose starting point is at the coordinates (x, y) with the specified width and height and whose style is determined by the fillStyle attribute.
fn fill_text(&self, text: &str, x: f64, y: f64, max_width: Option<f64>)
[src]
Draws a text string at the specified coordinates, filling the string's characters with the current foreground color. An optional parameter allows specifying a maximum width for the rendered text, which the user agent will achieve by condensing the text or by using a lower font size.
Trait Implementations
impl Clone for CanvasRenderingContext2d
[src]
fn clone(&self) -> CanvasRenderingContext2d
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for CanvasRenderingContext2d
[src]
impl PartialEq for CanvasRenderingContext2d
[src]
fn eq(&self, __arg_0: &CanvasRenderingContext2d) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &CanvasRenderingContext2d) -> bool
[src]
This method tests for !=
.
impl Eq for CanvasRenderingContext2d
[src]
impl InstanceOf for CanvasRenderingContext2d
[src]
fn instance_of(reference: &Reference) -> bool
[src]
Checks whenever a given Reference if of type Self
.
impl AsRef<Reference> for CanvasRenderingContext2d
[src]
impl ReferenceType for CanvasRenderingContext2d
[src]
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[src]
Converts a given reference into a concrete reference-like wrapper. Doesn't do any type checking; highly unsafe to use! Read more
impl TryFrom<Reference> for CanvasRenderingContext2d
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl<'_r> TryFrom<&'_r Reference> for CanvasRenderingContext2d
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl TryFrom<Value> for CanvasRenderingContext2d
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl<'_r> TryFrom<&'_r Value> for CanvasRenderingContext2d
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl JsSerialize for CanvasRenderingContext2d
[src]
impl RenderingContext for CanvasRenderingContext2d
[src]
type Error = ConversionError
Type of error which can occur whilst creating this context
fn from_canvas(canvas: &CanvasElement) -> Result<Self, ConversionError>
[src]
Name which identifies this kind of rendering context.