We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const { promises } = require('node:fs') const { join } = require('node:path') const { createCanvas, loadImage, Image } = require('./index.js') const width = 500 const height = 500 const canvas = createCanvas(width, height) const ctx = canvas.getContext('2d') async function main() { const catImage = await loadImage("./img.jpg") const tempCanvas = createCanvas(width, height); const tempCtx = tempCanvas.getContext('2d'); tempCtx.drawImage(catImage, 0, 0, catImage.width, catImage.height); const pattern = ctx.createPattern(catImage, "repeat"); const pattern2 = ctx.createPattern(tempCanvas, "repeat"); ctx.fillStyle = pattern; ctx.fillRect(0, 0, width/2, height); ctx.fillStyle = pattern2; ctx.fillRect(width/2, 0, width/2, height); const output2 = await canvas.encode('png') await promises.writeFile('res.png', output2) } main()
result:
expected result:
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
result:
expected result:
The text was updated successfully, but these errors were encountered: