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

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

Post 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?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post