Skip to content

$drawImage

Draws an image on the canvas.

Usage

$drawImage[canvas;path;x;y;width?;height?;...radius?]

Parameters

FieldTypeDescriptionRequired
canvasStringName of the canvas.True
pathPath | URL | Canvas | ImagePath or url to the image.True
xNumberThe X coordinate of the image.True
yNumberThe Y coordinate of the image.True
widthNumberThe image width.False
heightNumberThe image height.False
radiusNumberThe image corners radius.False

Example(s)

No examples for this function.

meow

Raw Info

{
"name": "$drawImage",
"description": "Draws an image on the canvas.",
"params": [
{
"name": "canvas",
"description": "Name of the canvas.",
"type": "String",
"required": true
},
{
"name": "path",
"description": "Path or url to the image.",
"type": "Path | URL | Canvas | Image",
"required": true
},
{
"name": "x",
"description": "The X coordinate of the image.",
"type": "Number",
"required": true
},
{
"name": "y",
"description": "The Y coordinate of the image.",
"type": "Number",
"required": true
},
{
"name": "width",
"description": "The image width.",
"type": "Number",
"required": false
},
{
"name": "height",
"description": "The image height.",
"type": "Number",
"required": false
},
{
"name": "radius",
"description": "The image corners radius.",
"type": "Number",
"required": false
}
],
"usage": "$drawImage[canvas;path;x;y;width?;height?;...radius?]",
"category": "canvas",
"src": "https://github.com/devlordduck/aoi.canvas/tree/v2/src/functions/canvas/drawImage.ts",
"docs": "https://aoicanvas.vercel.app/functions/drawimage"
}