473,624 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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><In k /></Signature>";

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

//set to wait for response and load structure
objXMLDOM.async = false;
objXMLDOM.loadX ML(sBaseXML);

//Fill XML structure with Form Data;
objXMLDOM.selec tSingleNode("/Signature/Ink").text = document.all.MS RSignature.Ink. Save(1);

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

//Open Connection To Server
objXMLHTTP.open ("POST","InkGet ter.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:bla hblahblahblah</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(objec t sender, System.EventArg s e)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(Req uest.InputStrea m);
if (Request.InputS tream != null)
{
BinaryWriter bw = new BinaryWriter(Fi le.Create("C:\\ CheckList\\MySi gnature.GIF"));

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

bw.Write(Conver t.FromBase64Str ing(xmldoc.Sele ctSingleNode("//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 1710

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

Similar topics

1
3033
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 page dynamically through the use of event listeners in javascript That works, the problem is that when I run the test webpage that runs the ActiveX control, the socket does not start listening for about a minute and a half, after which it runs fine....
1
5577
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
1426
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) Currently only an ActiveX control is available for WebForms, so I embedded it using the "<object>" tag.
5
1807
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 looking into updating the site to ASP.net. For the most part I am in favor of this, but I am concerned about the ActiveX objects we are using. For example: I needed to provide the means for a user to upload multiple files via a webpage. To...
2
1510
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 clicked. I checked the security settings and they're the same on both machines. NOTE: <object tag> is used just for this posting because I couldn't use the actual tag due to outlook trying to embed the object. <object tag> id="Ctl"...
3
2510
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 control to pallete and then add a reference. I get the interop dll added to bin folder. I did this with the MediaPlayer activex control as a simple case to to try and get it working. I set the control to autostart via the html parameter tag for...
1
8277
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. This part is done but next requirement is that after closing ActiveX I have to redirect parent page to location X or Y depending on how the
3
2781
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 (not web-based or part of current application) brought to the front and focused (findwindow api) and have the button scrape the contents of the focused window so the contents can be parsed and entered into the web application. Ideally, I would...
0
8234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8172
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8677
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.