An object that can be drawn to a 2D canvas rendering context.
The image drawn to the canvas depends on the type of this object:
-
If this object is an ImageElement, then this element's image isdrawn to the canvas. If this element is an animated image, then thiselement's poster frame is drawn. If this element has no poster frame, thenthe first frame of animation is drawn.
-
If this object is a VideoElement, then the frame at this element's currentplayback position is drawn to the canvas.
-
If this object is a CanvasElement, then this element's bitmap is drawn tothe canvas.
Note: Currently all versions of Internet Explorer do not support drawing a video element to a canvas. You may also encounter problems drawing a video to a canvas in Firefox if the source of the video is a data URL.
See also
- CanvasRenderingContext2D.drawImage
- CanvasRenderingContext2D.drawImageToRect
- CanvasRenderingContext2D.drawImageScaled
- CanvasRenderingContext2D.drawImageScaledFromSource
Other resources
- Image sources for 2D rendering contexts from WHATWG.
- Drawing images from WHATWG.
- Implemented by
Constructors
Properties
- hashCode → int
-
Get a hash code for this object.
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited