Page 1 of 1

Ändern Sie die Farbe des SVG -Bildes für Drawimage auf Leinwand

Posted: 07 Feb 2025, 04:16
by Guest
Ich habe ein solches Skript, es wird SVG-Datei verwendet.import exclamationSolid from "../images/exclamation-solid.svg";

const canvas = document.getElementById("canvas");
const ctx = canvas.getContext("2d");
const img = new Image();
img.src = exclamationSolid;
img.onload = function(){
ctx.drawImage(img,0,0,12, 50);
}
< /code>
Es zeigt das Bild richtig an Canvas?