1

I have a JavaScript function bound to an ASP button's click event which uses the HTML5 toDataURL function to grab the canvas:

function getimg ()
{
    try
    {
        var img = canvas.toDataURL('image/jpeg', 0.9).split(',')[1];
    } 
    catch(e) 
    {
        var img = canvas.toDataURL().split(',')[1];
    }
}

What's the best way to take the resulting img and pass it to a code-behind method? I found this post among others and experimented successfully with using a hidden field, but I'm hoping there's a more direct (less indirect?) way.

1 Answer 1

0

Try using the canvaspixelarray property.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.