472,373 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

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;
objXMLDOM.loadXML(sBaseXML);

//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
objXMLHTTP.open("POST","InkGetter.aspx",false);

//send XML to Server
objXMLHTTP.Send(objXMLDOM);

}

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

The InputStream (Verified) is something like this:
<Signature>
<Ink>Base64:blahblahblahblah</Ink>
</Signature>

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

My PROBLEM is:

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();
xmldoc.Load(Request.InputStream);
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));
bw.Close();
}
}

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 :)

Thanks.


Nov 15 '05 #1
0 1600

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mjcast | last post by:
I have been working on an ActiveX control in C#. It is packaged in a Windows Control library and the code is in a user control. The control is used as an automation receiver that is used to update a...
1
by: stegada | last post by:
Hi, i must determine if client's browsers support ActiveX controls. Is it possible to obtain this information using Javascript? Thank's a lot. Stefano
0
by: Kunal | last post by:
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) ...
5
by: Andrew | last post by:
Hi all, I am still getting into ASP/VB.net and have a concern about something I see coming. Currently our entire website is classic ASP, yet the feelings from on high is that we need to start...
2
by: Joe | last post by:
I have an ActiveX control in my web page and the control doesn't install on a XP machine. It works fine on Win2k pro. The warning dialog box does appear on both machine and does allow yes to be...
3
by: Jeffery Franzen | last post by:
Anyone know where the documentation is regarding Activex controls in asp web forms? I'm using VS.NET 2002 enterprise and am trying to use Activex controls in vb.net web form app. I do the add...
1
by: kret | last post by:
Hi, this is my first post so first of all I would like to say hello :) Now getting to my problem. In my job I have to create an ActiveX control in .NET 1.1 that can be lunched from IE....
3
by: =?Utf-8?B?R3JlZyBN?= | last post by:
Hello, I'm running an asp.net, intranet web application using .net framework 1.1 on IIS5.1 / 6.0. Through the web application, I would like to press a button on the web page, have another window...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.