ICanvasRenderingContext2D.DrawImage

DrawImage(HTMLImageElement, double, double)

Draws the specified image.

public void DrawImage(HTMLImageElement image, double dx, double dy)
ParameterTypeDescription
imageHTMLImageElementThe HTMLImageElement to draw into the context.
dxDoubleThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyDoubleThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.

See Also


DrawImage(HTMLCanvasElement, double, double)

Draws the specified image.

public void DrawImage(HTMLCanvasElement image, double dx, double dy)
ParameterTypeDescription
imageHTMLCanvasElementThe HTMLCanvasElement to draw into the context.
dxDoubleThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyDoubleThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.

See Also


DrawImage(HTMLImageElement, double, double, double, double)

Draws the specified image.

public void DrawImage(HTMLImageElement image, double dx, double dy, double dw, double dh)
ParameterTypeDescription
imageHTMLImageElementThe HTMLImageElement to draw into the context.
dxDoubleThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyDoubleThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.
dwDoubleThe width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.
dhDoubleThe height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.

See Also


DrawImage(HTMLCanvasElement, double, double, double, double)

Draws the specified image.

public void DrawImage(HTMLCanvasElement image, double dx, double dy, double dw, double dh)
ParameterTypeDescription
imageHTMLCanvasElementThe HTMLCanvasElement to draw into the context.
dxDoubleThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyDoubleThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.
dwDoubleThe width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.
dhDoubleThe height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.

See Also


DrawImage(HTMLImageElement, double, double, double, double, double, double, double, double)

Draws the specified image.

public void DrawImage(HTMLImageElement image, double sx, double sy, double sw, double sh, 
    double dx, double dy, double dw, double dh)
ParameterTypeDescription
imageHTMLImageElementThe HTMLImageElement to draw into the context.
sxDoubleThe X coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
syDoubleThe Y coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
swDoubleThe width of the sub-rectangle of the source image to draw into the destination context. If not specified, the entire rectangle from the coordinates specified by sx and sy to the bottom-right corner of the image is used.
shDoubleThe height of the sub-rectangle of the source image to draw into the destination context.
dxDoubleThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyDoubleThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.
dwDoubleThe width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.
dhDoubleThe height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.

See Also


DrawImage(HTMLCanvasElement, double, double, double, double, double, double, double, double)

Draws the specified image.

public void DrawImage(HTMLCanvasElement image, double sx, double sy, double sw, double sh, 
    double dx, double dy, double dw, double dh)
ParameterTypeDescription
imageHTMLCanvasElementThe HTMLCanvasElement to draw into the context.
sxDoubleThe X coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
syDoubleThe Y coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
swDoubleThe width of the sub-rectangle of the source image to draw into the destination context. If not specified, the entire rectangle from the coordinates specified by sx and sy to the bottom-right corner of the image is used.
shDoubleThe height of the sub-rectangle of the source image to draw into the destination context.
dxDoubleThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyDoubleThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.
dwDoubleThe width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.
dhDoubleThe height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.

See Also