1

Possible Duplicate:
Get image data in Javascript?

Hello,

I've got a single div, which has a background already defined (note: its a single layer, on tag, or body background-image), and has an overlaying HTML5 canvas element which will let me draw on top of the background image.

I'd like to know how (if its possible) to create a button which when clicked, will save a snapshot of the div on the server side.

Example situation: I load page - > I draw something within the div -> I click save - > I go to repository - > I see my drawing (with the background and the user created overlay).

My current server side infrastucture is WinServer 2008 R2, IIS7.5, MSSQL 2000 RTM DBMS, Classic ASP application layer... Anything else you'd like to know?

Thanks for the assist in advance... :-)

Community
  • 1
  • 1
Abhishek
  • 4,190
  • 11
  • 39
  • 52

2 Answers2

0

For as far as I know, there is no standard .Net function to capture HTML to an image. What you could do is taking a snapshot with an extension.

Maybe this article can help you out.

Steven Ryssaert
  • 1,989
  • 15
  • 25
  • Thanks for the info, but from what I can tell, that's a .NET solution, and I'm running classic ASP (Correct me if my presumption that the two aren't bedfellows is wrong). Additionally, it saves a snapshot of the entire page, I want just the div in question... :-( – Abhishek Mar 16 '11 at 09:03
  • Someone correct me if I am mistaken, but I don't think it's possible with Classic ASP. You can call a .exe from ASP, with the Shell ( see this link: http://classicasp.aspfaq.com/general/how-do-i-execute-a-dos-command/batch-file/exe-from-asp.html), however, this will not allow you to pass the right arguments. Is it possible to use .Net just for that part of the website ? – Steven Ryssaert Mar 16 '11 at 09:11
  • Heh, I would hope it is possible, but knowing the rest of the development team, I'd rather not propose it unless I'm in a corner... – Abhishek Mar 16 '11 at 10:02
0

Alternatively, I managed to scrounge up an indirect answer from StackOverflow (Mods - I is sorry, please don't be banning me for not searching first...)

Answer source: "http://stackoverflow.com/questions/934012/get-image-data-in-javascript"

Once again, thanks to "Uw Concept" for the prompt responses, and thanks to "Mathew Crumley" for the original answer...

Again, mods, I is sorry... :-(

Abhishek
  • 4,190
  • 11
  • 39
  • 52