Go Back   Technology Questions > Hardware Questions > Mobile Computers > Tablet PC > Tablet PC Software > Tablet PC Developers

Tablet PC Developers Show off your work while discussing with others how to create ink enabled applications.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 05-19-2008, 02:20 PM
Amr Bekhit
Tablet PC Guest
 
Posts: n/a
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 05-19-2008, 02:20 PM
Xploder HD Movie Player for PS3. Manage, convert and transfer media files between the PC and PS3.
  #2 (permalink)  
Old 05-19-2008, 09:00 PM
Christian Stapfer
Tablet PC Guest
 
Posts: n/a
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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -8. The time now is 10:43 AM.


2003 - 2008 All Rights Reserved. Technology Questions

SEO by vBSEO 3.1.0