draw_image method

draw_image

Draws the specified image.

def draw_image(self, image, dx, dy):
    ...
ParameterTypeDescription
imageHTMLImageElementThe HTMLImageElement to draw into the context.
dxfloatThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyfloatThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.

draw_image

Draws the specified image.

def draw_image(self, image, dx, dy):
    ...
ParameterTypeDescription
imageHTMLCanvasElementThe HTMLCanvasElement to draw into the context.
dxfloatThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyfloatThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.

draw_image

Draws the specified image.

def draw_image(self, image, dx, dy, dw, dh):
    ...
ParameterTypeDescription
imageHTMLImageElementThe HTMLImageElement to draw into the context.
dxfloatThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyfloatThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.
dwfloatThe 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.
dhfloatThe 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.

draw_image

Draws the specified image.

def draw_image(self, image, dx, dy, dw, dh):
    ...
ParameterTypeDescription
imageHTMLCanvasElementThe HTMLCanvasElement to draw into the context.
dxfloatThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyfloatThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.
dwfloatThe 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.
dhfloatThe 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.

draw_image

Draws the specified image.

def draw_image(self, image, sx, sy, sw, sh, dx, dy, dw, dh):
    ...
ParameterTypeDescription
imageHTMLImageElementThe HTMLImageElement to draw into the context.
sxfloatThe X coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
syfloatThe Y coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
swfloatThe 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.
shfloatThe height of the sub-rectangle of the source image to draw into the destination context.
dxfloatThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyfloatThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.
dwfloatThe 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.
dhfloatThe 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.

draw_image

Draws the specified image.

def draw_image(self, image, sx, sy, sw, sh, dx, dy, dw, dh):
    ...
ParameterTypeDescription
imageHTMLCanvasElementThe HTMLCanvasElement to draw into the context.
sxfloatThe X coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
syfloatThe Y coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
swfloatThe 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.
shfloatThe height of the sub-rectangle of the source image to draw into the destination context.
dxfloatThe X coordinate in the destination canvas at which to place the top-left corner of the source image.
dyfloatThe Y coordinate in the destination canvas at which to place the top-left corner of the source image.
dwfloatThe 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.
dhfloatThe 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