Draw another canvas, replaying its contents as vectors.
Unlike CanvasRenderingContext2D.drawImage, which rasterizes the source first, this keeps text as text and paths as paths -- so an SVG or PDF export of the result stays selectable and scalable.
The replay is clipped to the destination rectangle, so anything that
spreads -- an imageFilter blur, a shadow -- stops at its edge instead of
bleeding past it the way it does through drawImage. Give the destination
room if you want the spread. This is inherited behaviour, matching
upstream, not a rule the Canvas standard sets: drawCanvas has no
standard counterpart, and drawImage does let a filter spread.
🧪 Not in the HTML Canvas standard.
As above, scaled to fill the dw by dh rectangle at (dx, dy), and
clipped to it.
🧪 Not in the HTML Canvas standard.
As above, replaying only the sw by sh region of image at
(sx, sy) into the destination rectangle.
🧪 Not in the HTML Canvas standard.
Draws image at its natural size, with its top-left corner at
(dx, dy).
Draws image scaled to fill the dw by dh rectangle at (dx, dy).
Draws the sw by sh region of image at (sx, sy), scaled to fill
the dw by dh rectangle at (dx, dy).
Drawing one image, canvas or pixel buffer into another.