Wednesday, March 21, 2012

Perplexing Problem

Hello all,

I've got a page that displays a java applet written by an external company (basically displays a mapping application).

I need to be able to take snapshots of these maps and save them in an image format up to the server.

The applets allows me to copy the current view of the map to the clipboard. No problem there - I have coded a button on the form to do this. The button then sends the browser to another page in which I want to save the contents of the clipboard to an image file and upload it to the server.

The Clipboard.GetDataObject returns null however. I guess it's because the image object on the clipboard was not placed there by my ASP.NET app, but by the Java applet.

Does anybody have any idea how I can achieve this?

TIA.I have done a similar type project. Below is the code I used. The clipboard is the clipboard be it from ASP or Java.

Dim data As IDataObject
data = Clipboard.GetDataObject()
Dim bmap As Bitmap
If data.GetDataPresent(GetType(System.Drawing.Bitmap)) Then
Try
bmap = CType(data.GetData(GetType(System.Drawing.Bitmap)), Bitmap)
Catch
Beep()
edSysMessage.Text = "Error capturing photo."
End Try
Else
Beep()
edSysMessage.Text = "No image to capture."
End If

0 comments:

Post a Comment