Giter VIP home page Giter VIP logo

Comments (4)

boblemarin avatar boblemarin commented on August 10, 2024

It shouldn't be a problem since the toDataURL() method of the canvas allows to get the encoded png or jpeg data.

This functionality is not yet present in the plugin, though. I'm wondering if it might not be out of its scope.
Maybe a method exposing the canvas or context used by the eraser would allow you to easily implement what you need.
What you think ?

from jquery.eraser.

matj avatar matj commented on August 10, 2024

Yes yes, toDataUrl() is good solution. Thank you very much.

I need to merge the top layer after erase, with the background. But I solved it quickly by your tip.

from jquery.eraser.

boblemarin avatar boblemarin commented on August 10, 2024

great !
is there any modification to do to the plugin to ease the process or is it good as it is ?

from jquery.eraser.

matj avatar matj commented on August 10, 2024

A good idea is to add two methods:

First select the top layer as PNG

function getpng(event){
var canvas = document.getElementById("kabelka"); // best $("#kabelka").get(0).toDataUrl();
var dataUrl = canvas.toDataURL();
$("textarea[name=image]").val(dataUrl);
$("form").submit();
event.preventDefault();
}

Second merges with the FG and BG chooses them as common picture (here is needed to canvas BG) - this is only idea

My simple test: http://test.matj.sk/eraser/

I creating Facebook app for handbag seller. I need dynamically change handbag from the left menu and user can erase area on hand. User also can with drag&drop change position of handbag. Result is shared to Facebook or Email as image.

Sorry for my bad english :)

from jquery.eraser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.