Convert SVG to bitmap canvas at specified dimensions
Tries multiple loading strategies (data URLs, blob URL) for cross-browser compatibility. This is a public utility that can be used independently of the overlay operations.
SVG markup string
Target width in pixels
Target height in pixels
Promise resolving to canvas with rendered SVG
const canvas = await svgToBitmap('<svg>...</svg>', 48, 48);ctx.drawImage(canvas, 0, 0); Copy
const canvas = await svgToBitmap('<svg>...</svg>', 48, 48);ctx.drawImage(canvas, 0, 0);
Convert SVG to bitmap canvas at specified dimensions
Tries multiple loading strategies (data URLs, blob URL) for cross-browser compatibility. This is a public utility that can be used independently of the overlay operations.