get_image_data method

get_image_data

Returns an ImageData object representing the underlying pixel data for the area of the canvas denoted by the rectangle which starts at (sx, sy) and has an sw width and sh height. This method is not affected by the canvas transformation matrix.

Returns

An ImageData object containing the image data for the given rectangle of the canvas.

def get_image_data(self, sx, sy, sw, sh):
    ...
ParameterTypeDescription
sxfloatThe x coordinate of the upper left corner of the rectangle from which the ImageData will be extracted.
syfloatThe y coordinate of the upper left corner of the rectangle from which the ImageData will be extracted.
swfloatThe width of the rectangle from which the ImageData will be extracted.
shfloatThe height of the rectangle from which the ImageData will be extracted.

See Also