drawImageArea method
void
drawImageArea(
- PCanvasImage image,
- int srcX,
- int srcY,
- int srcWidth,
- int srcHeight,
- num dstX,
- num dstY,
- num dstWidth,
- num dstHeight,
override
Draw an image
part (srcX
,srcY
, srcWidth
x srcHeight
) to a
destiny area (dstX
,dstY
, dstWidth
x dstHeight
).
Implementation
@override
void drawImageArea(PCanvasImage image, int srcX, int srcY, int srcWidth,
int srcHeight, num dstX, num dstY, num dstWidth, num dstHeight) {
checkImageLoaded(image);
dstX = transform.x(dstX);
dstY = transform.y(dstY);
dstX = canvasX(dstX);
dstY = canvasY(dstY);
dstWidth = canvasX(dstWidth);
dstHeight = canvasY(dstHeight);
if (image is _PCanvasImageElement) {
_ctx.drawImageScaledFromSource(image.imageElement, srcX, srcY, srcWidth,
srcHeight, dstX, dstY, dstWidth, dstHeight);
} else {
throw ArgumentError("Can't handle image type: $image");
}
}