Skip to content

Associate dataURL to an image variable #1064

@rachits123

Description

@rachits123

Hello sir,

i am using Kinetic.js to create a dynamic image with random shapes

This works fine

Later, i want to save that data generated to a image variable in a way similar to this:
img = canvas.toDataURL()

i tried to do

var image
stage.toDataURL({
callback: function(dataUrl) {
kineticdataURL = dataUrl;

image= dataURL.toDataURL

or

image =kineticdataURL

window.open(image) // i am able to see the image generated

}
});
window.open(image); // i am unable to see the image generated outside the stage.toDataURL()

all that i get is a blank screen.

Please help !!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions