Browse DevX
Sign up for e-mail newsletters from DevX


Using Ink on the Web : Page 4

One of the more interesting and challenging places to use Ink is in Web applications. But how can this technology, which is dependent on the physical relationship between the stylus, the digitizer, and the operating system, work over the Internet?




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Deploying your Inkable Web Application
So far, you have been working with all of this code in the Visual Studio IDE. There is one more important step to ink-enabling your applications and that is getting them out onto the Web. The Web application gets deployed just as you would any other Web application.

However, the dll for your Windows Forms control is a little different. With yet another reminder that this is not server-side code, you only need to copy it into the directory along with the Web page that it gets embedded on, just like you would do with an image file. It is possible to tuck it into a folder, but be sure to modify the classid of the <object> tag so that the dll can be found. For example, if you place the dll into a folder called inkControls on the server, the classid would look like this:

Classid=inkControls/CoDe_InkControl.dll# CoDe_InkControl.InkontheWeb.InkWebControl

Some Basic Rules
Now that you've seen the process, here are some basic rules for using Ink on the Internet:

  • Use in Internet Explorer only.
  • Use a custom WinForms control.
  • Do not use any objects in the control that require Full Trust, including all unmanaged objects such as Windows pointers.
  • Remember to dispose objects in the control.
  • Embed the control on a Web page using the <object> tag.
  • Copy the control to the same location as the Web page, or to a subfolder.
Be sure to use the latest Tablet PC SDK, version 1.7. You can download it from the Mobile Developer Center.

There are many ways to move Ink around on the Web. You need to consider postbacks, and sending ink data to another page, to a database, to a Web service, or just saving it as an image. See "Persisting Ink on the Web" on the Mobile Developer Center for more information.

This article has introduced you to the key steps of adding Ink to your Web applications. You have learned some important concepts about security that will help you with troubleshooting. You have also learned how to build functionality into the control for internal use or to be exposed to the Web page.

With these new tools, you can now give even more power, creativity, and enterprise solutions to your Tablet PC users.

Be sure to check out my two inkable Web applications, "Doodling on the Web" and "Virtual Earth Does Ink!" at http://www.thedatafarm.com/ink.aspx. You can also download the code samples for this article from that link.

Julia Lerman is an independent consultant who has been designing and writing software applications for 20 years. She lives in Vermont where she runs the Vermont.NET User Group. Julia is well known in the .NET community as an INETA Board member, .NET MVP, ASPInsider, conference speaker, and prolific blogger. You can read Julia's blog at thedatafarm.com/blog.
Thanks for your registration, follow us on our social networks to keep up-to-date