Automattic / Automattic/node-canvas
How to create image object using node-canvas as doing into fabric js ?
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
I would like to do the same process in the nodejs as I am doing using fabric js from the fronend application.
```
var imgObj = new Image();
imgObj.src = "http://www.w3schools.com/css/img_fjords.jpg";
imgObj.onload = function ()
{
var image = new fabric.Image(imgObj);
image.set({
angle: 0,
padding: 0,
originX: "center",
originY: "center"
});
}
```
Using this implementation the JSON object is generated that is as like this
```
[
{
type: 'image', version: '4.3.1', originX: 'left', originY: 'top', left: 175, top: 194.53, width: 512, height: 351, fill: 'rgb(0,0,0)', stroke: null, strokeWidth: 0, strokeDashArray: null, strokeLineCap: 'butt', strokeDashOffset: 0,
strokeLineJoin: 'miter', strokeUniform: false, strokeMiterLimit: 4, scaleX: 0.29, scaleY: 0.32, angle: 0,
flipX: false, flipY: false, opacity: 1, shadow: null, visible: true, backgroundColor: '', fillRule: 'nonzero',
paintFirst: 'fill', globalCompositeOperation: 'source-over', skewX: 0, skewY: 0, cropX: 0, cropY: 0, cacheKey: 56,
id: 56, filename: ${canvasInfo.filename}, src: ${canvasInfo.src}, crossOrigin: null, filters: []
}
]
```
So, how can i manage same thing from node-canvas ?
I have tried this sample example https://github.com/Automattic/node-canvas#quick-example but that is not generating the object.
Mentioning the authors so that they can notify.
@tj @LinusU @zbjornson @TooTallNate @kangax @chearon @kkoopa
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.