drawImage method
void
drawImage()
Implementation
void drawImage(int argumentCount, Image? img, double sx, double sy, double sWidth, double sHeight, double dx, double dy, double dWidth, double dHeight) {
if (img == null) return;
addAction((Canvas canvas, Size size) {
// ctx.drawImage(image, dx, dy);
if (argumentCount == 3) {
canvas.drawImage(img, Offset(dx, dy), Paint());
} else {
if (argumentCount == 5) {
// ctx.drawImage(image, dx, dy, dWidth, dHeight);
sx = 0;
sy = 0;
sWidth = img.width.toDouble();
sHeight = img.height.toDouble();
}
canvas.drawImageRect(img,
Rect.fromLTWH(sx, sy, sWidth, sHeight),
Rect.fromLTWH(dx, dy, dWidth, dHeight),
Paint());
}
});
}