Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

Uncaught TypeError: CanvasRenderingContext2D.drawImage: Argument 1 could not be converted to any of: HTMLImageElement, SVGImageElement, HTMLCanvasElement, HTMLVideoElement, OffscreenCanvas, ImageBitmap

ctx.drawImage(img, 0,0); //normal drawing
ctx.drawImage(img, //draw stretched
    0,0,66,66, //source (x,y,w,h)
    100,0,100,100//destination (x,y,w,h)
    );
ctx.drawImage(img, //draw a slice
    20,10,20,20, //source coords (x,y,w,h)
    250,0,250,50//destination coords (x,y,w,h)
    );
Source by joshondesign.com #
 
PREVIOUS NEXT
Tagged: #Uncaught #Argument #converted #ImageBitmap
ADD COMMENT
Topic
Name
1+9 =