Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save just the image of the canvas and not all canvas

I have a canvas 800x600 for example and I use fabricjs to add one image (200 x 200).

I apply several filters on my image and I would like to save it, but for the moment, I save the canvas 800x600 and I would like just save my picture after effects.

Is it possible?

like image 386
user2823968 Avatar asked Mar 22 '23 06:03

user2823968


1 Answers

From the latest version (download and compile it from GitHub), and this one is what you want:

canvas.toDataURL(left, top, width, height);

Check the question fabric.js - create Image object from ImageData object of canvas API for kangax’s comment only.

like image 199
Tom Avatar answered Apr 08 '23 11:04

Tom