views:

24

answers:

1

The (short) question:

Are there currently an API's for manually creating images from the DOM using Javascript? If not are there any plans for browser to expose API's for this?

The (longer) explanation:

I've partially implemented the drag & drop support for rows and columns in the Cappuccino tableview. Currently we have to re-create the rows / columns when the user attempts a drag. It would be great to just snap an image of the area we want to include in the drag.

I'm aware that browsers will automatically generate the drag image when using the native drag & drop API, but even then there are situations where you actually might want to (dynamically) customize that image.

+1  A: 

You are looking for the new canvas API in HTML5. If you need cross-browser support, before HTML5 is implemented, try this.

Jesse Dhillon
Yeah this would work if Cappuccino would draw everything using Canvas. Unfortunately it doesn't yet, it's dynamically creating DOM elements. It would be great if I could overlay a canvas over the DOM and just snap an image of what it's covering. I'm fairly certain that's not possible.
klaaspieter