-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
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
Add image to the editor #3
Comments
hey @emorling, do you mean the fabric canvas instance ? from this |
I am not sure I understand how to do this. I understand that we can add an Image object using: editor.canvas.add( ... ) But how do we for example do this prior to adding it: fabric.Image.fromURL('my_image.png',(oImg) => { }); |
Ah alright you are almost there, from your project you have to regular install the fabric dependency because
You can use this boilerplate we created https://codesandbox.io/s/flamboyant-wind-ff3x8 |
Fabulous! You are one of the smartest people on the planet! BTW do you have any consulting hours this weekend, to solve this: fabricjs/fabric.js#6883 |
You are welcome will add that use case to readme thank you, well let confirm you later today not sure
Sent from Yahoo Mail for iPhone
On Saturday, February 20, 2021, 9:20 AM, emorling <[email protected]> wrote:
Fabulous! You are one of the smartest people on the planet!
BTW do you have any consulting hours this weekend, to solve this: fabricjs/fabric.js#6883
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi. I tested the above code to render an image on the canvas, but there are multiple images being rendered. Like a million. What am I doing wrong? Here's the sandbox: https://y0rq7.csb.app/ and here's the code:
|
I need to add the ability to add an image to the editor, and in the future other things.
For example:
fabric.Image.fromURL('my_image.png', function(oImg) { // scale image down, and flip it, before adding it onto canvas oImg.scale(0.5).set('flipX', true); canvas.add(oImg); });
Is there a way to access the fabric object? Or should we be approaching this in another way?
The text was updated successfully, but these errors were encountered: