Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tablet SDK Ink Collector
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Tablet SDK Ink Collector
Divers
Thread ID:
00838482
Message ID:
00838482
Vues:
85
I have a form that I have placed the Ink Collector from Microsoft's Tablet XP SDK 1.5

*!* Code Snippet
oInk = CREATEOBJECT('msinkaut.InkCollector')
WITH oInk
.HWND = HWND && defined in code not pasted here
.DefaultDrawingAttributes.WIDTH = 35
.ENABLED = .T.
ENDWITH

*!* end snippet


This works great. I am able to collect pen strokes (Ink) all day long.

I then need to persist this data to a GIF file. This should be a breeze as the ink.save() method should allow for that as per the MSDN information on the control. I can do that like this

*!* first parameter 2 = GIF, second parameter 1 = Use Compression
SavedInk2 = oInk.Ink.SAVE(2,1)

SavedInk2 then becomes a very large single dimensional array of integers. That in and of itself shouldn't be a problem. In the examples of this control (In C# or VB6) it appears that this is fine. they use constants instead of litteral values like I am using but no biggie.

The issue is with the next step. In C# and VB 6 the example uses the Database.FileStream object (example below)

using (FileStream gifFile = File.OpenWrite(nameBase + "_files\\signature.gif"))
{

// Generate the fortified GIF represenation of the ink
fortifiedGif = ic.Ink.Save(PersistenceFormat.Gif);

// Write and close the gif file
gifFile.Write(fortifiedGif, 0, fortifiedGif.Length);
}


First I simply tried using FCreate and Fwrite to dump the values in the array to a file, it seemed easier than messing with yet another non-VFP object. That file cannot be opend as a gif file even if I include the proper header information. really it is just a file full of integer values. I then converted the values to HEX with no change.

so I try to use the same object that is used in the example like this:

*!* Use the FileStream object as it seems to be the only way
loFileStream = createobject('Database.FileStream')

This object is indeed registered on my system and I thought it should work just fine.. but I get the following error
OLE error code 0x80004002: No such interface supported.

I am at a loss. I need to get this file into a .gif file

here is the documentation on the ink.save() method just in case I missed something..

Thanks in advance for any help at all.
TS
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform