| |||||||
| Tablet PC Developers Show off your work while discussing with others how to create ink enabled applications. |
![]() |
| | LinkBack | Thread Tools |
| |||
| Creating Ink strokes in code. Hello all, I'm using the Tablet PC SDK to write an Ink-based whiteboarding application. One of the tasks I need to perform is to be able to take the data that represents a stroke, send it to other users and then reconstruct that stroke. The only way I've been able to do that is by the CreateStroke method using an array of points. However, although this method seems to create the stroke, the stroke itself isn't displayed unless I refresh whatever drawing surface I'm using (e.g. a picture box). This produces an undesireable flickering effect each time it's refreshed. I was wondering whether this is the right way to go about doing this, or if there are other methods that I can use to create strokes in code? Thanks --Amr |
| |||
| Re: Creating Ink strokes in code. "Amr Bekhit" <Amr Bekhit@discussions.microsoft.com> schrieb im Newsbeitrag news:D42EBB4D-025A-4CCD-83F9-DDFFF337F106@microsoft.com... > Hello all, > > I'm using the Tablet PC SDK to write an Ink-based whiteboarding > application. > One of the tasks I need to perform is to be able to take the data that > represents a stroke, send it to other users and then reconstruct that > stroke. > > The only way I've been able to do that is by the CreateStroke method using > an array of points. I don't think it is a good idea to re-construct a stroke from a mere array of points: because you lose too much data (e.g. pressure information) in the process. Instead, you should create a new Ink object, insert the stroke(s) you want to send, and convert it to an array of bytes using the Ink.save() method (which gives you the Ink object in isf-format). On the receiving side, you re-create the entire auxiliary Ink object from the byte array with the Ink.load() method, and then use AddStrokesAtRectangle() to add the strokes contained in the auxiliary Ink object to the Ink object you already have attached to your picture box. In order to be able to do that you probably need to transmit the bounds rectangle along with the auxiliary Ink object (that has been converted to isf-format). > However, although this method seems to create the stroke, > the stroke itself isn't displayed unless I refresh whatever drawing > surface > I'm using (e.g. a picture box). This produces an undesireable flickering > effect each time it's refreshed. Surely, you have to invalidate the bounds of the stroke that has been newly added. But maybe by "refresh" you mean invalidating the *entire* picture box? - That's not required: just invalidate the pixel-rectangle that contains the newly added stroke (you will have to convert ink-coordinates to pixel-coordinates for that purpose). Regards, Christian |
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Strokes from Individual Letters | Eli Gibson | Tablet PC Developers | 1 | 12-31-2007 06:00 AM |
| Shortcut Key Strokes | Dewayne | Windows XP | 7 | 06-07-2007 02:40 AM |
| Disposing Ink Strokes | tony@heavyenergy.com | Tablet PC Developers | 1 | 05-06-2007 06:32 AM |
| Creating Data Sources (ODBC) via code | John | Windows XP | 3 | 04-29-2007 08:15 AM |
| Record Ink Strokes? | Amy Blankenship | Windows XP Tablet PC Newsgroup | 0 | 12-28-2006 02:27 PM |