Skip to content

geekduck/docker-node-canvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

node-canvas

node-canvas

Node canvas is a Cairo backed Canvas implementation for NodeJS.

node-canvas Docker Images

node-canvas docker image

Usage

Example:

$ cat index.js
const { createCanvas } = require('canvas');
const canvas = createCanvas(200, 200);
const ctx = canvas.getContext('2d');
// Write "Awesome!"
ctx.font = '30px Impact';
ctx.rotate(0.1);
ctx.fillText('Awesome!', 50, 100);
// Draw line under text
const text = ctx.measureText('Awesome!');
ctx.strokeStyle = 'rgba(0,0,0,0.5)';
ctx.beginPath();
ctx.lineTo(50, 102);
ctx.lineTo(50 + text.width, 102);
ctx.stroke();
console.log('<img src="' + canvas.toDataURL() + '" />');

$ docker run --rm -v `pwd`:/opt/node/js geekduck/node-canvas index.js 2>/dev/null
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAABmJLR0QA/wD/AP+gvaeTAAAMDUlEQVR4nO3ceZAcVR3A8W8IkEAC5AAEAgYQBIJyS5Aop5SgFJ7hUA4vRFFRwELxAgELRYgnyn0IKqCgVSBQJYIcYgBFLjnlxnAEWEgIIdeuf/y67Te93T2zIWR3k++nqmtn+r153TPbv37nDEiSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJGmQGdLfJ7AITQbGAc8AjwK39O/pSAPHGOBloCfb5gEr9+sZaYmwTH+fwCJyBK0BsSywYz+dizSgpLXH8xS1yE/786SkgeJ4iqD4AvB49vje/jwpaSAYBXQRAfEMsALwK4qAWaf/Tk1LgsHeBzmSCBKAk4HZwHVJ+q6L/YykAWIM8BJF32Nktn9dihrk1w2vXxeYCKwNDH2jTlLqL8dRBMJ3SmmPUDS76uZ69kle/76aPKOBvYBtgLUa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jliRATE/1TZA/KVA9VVVIJWfjyIu+HaBlH/DsVOrEcv1P0SMxuUTrfOJZUBXEBd9Xa21E8VvN19D+6VC1iDqs0VZI/U1kKYT662mEDf3UVk5z1I/xJ3qS98IsAZR/6sLpHTfCCKQumgOpnxFc50NiIWrbyJW//6+3ckZIBoMhhLLcqqac+nz4UTtVlUL9SWQ/s8A0ZJkKMVauhHZ35HJ3zyohhFBMoMigJ6jYqW0fRAtSRYQczp1X2vIpYGUB05fBgskSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSVp6/Q843TzX3fIK+AAAAABJRU5ErkJggg==" />

About

node-canvas docker image

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published