469,648 Members | 1,143 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

ASP.NET + C# + TabletPC ActiveX Control + JavaScript = Base64 to GIF

[Sorry for cross post- involves both C# and ASP.net - I desperately need help]

Hi all,

I have run into a problem that I can't quite figure out.

Here is the situation:

I have to capture a signature from a WebForm. (The ASP.NET application is running on a TabletPC)

Currently only an ActiveX control is available for WebForms, so I embedded it using the "<object>" tag.

I have a regular input button, that when clicked (onclick), triggers a Javascript function called SendInk

the SendInk Function is as follows:

function SendInk()
//Setup XML structure used to Capture Signature
var sBaseXML = "<Signature><Ink /></Signature>";

//Create XML dom object
var objXMLDOM = new ActiveXObject("Msxml.DOMDocument");

//set to wait for response and load structure
objXMLDOM.async = false;

//Fill XML structure with Form Data;
objXMLDOM.selectSingleNode("/Signature/Ink").text = document.all.MSRSignature.Ink.Save(1);

//create XMLHttpobject
var objXMLHTTP = new ActiveXObject("Msxml2.XMLHTTP");

//Open Connection To Server

//send XML to Server


Pretty simple, and it works pretty well, I get the stream sent to the Page InkGetter.aspx.

The InputStream (Verified) is something like this:

The Base64 string is the XML representation of the strokes on the ActiveX control where I signed my name. This is all well.


I want to reconstruct the image and save it as a GIF file. This is what I am doing on the Page_Load of InkGetter.aspx:

I Get the CORRECT Base64 string..HOW Do I get it convert it to a GIF and save it. [Have been trying for 1.5 days now :-( ]

public void Page_Load(object sender, System.EventArgs e)
XmlDocument xmldoc = new XmlDocument();
if (Request.InputStream != null)
BinaryWriter bw = new BinaryWriter(File.Create("C:\\CheckList\\MySignatu re.GIF"));

//path and filename is hardcoded now just while I am trying to get this working

bw.Write(Convert.FromBase64String(xmldoc.SelectSin gleNode("//Ink").InnerText));

The GIF File is created, but its empty..in WindowsForms this is trivial, but I have no other recourse except using the ActiveX control becoz of WEBFORM.

Can anyone see anything wrong with the Code under Page_Load??

HELP me Obi Wan Kenobi, You're my only hope :)


Nov 15 '05 #1
0 1520

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by stegada | last post: by
5 posts views Thread by Andrew | last post: by
2 posts views Thread by Joe | last post: by
3 posts views Thread by Jeffery Franzen | last post: by
3 posts views Thread by =?Utf-8?B?R3JlZyBN?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.