Skip to main content
Home Forums General Silverlight Getting Started Save changes on inkpresenter
14 replies. Latest Post by sheetalsarfare on November 6, 2008.
(1)
sheetals...
Member
6 points
16 Posts
10-18-2008 7:48 AM |
Hi,
I used inkpresenter to draw. User able to draw on ink presenter.
Now I want to save text written with ink presenter. All the coding done with C#.
Please guide me for storing this text on server.
Thanks ,
Sheetal
simbuaar...
Participant
1172 points
405 Posts
10-18-2008 8:00 AM |
You Go through this one for developing ink presenter by using silverlight beta 1
http://pendsevikram.blogspot.com/2008/05/ink-presenter-using-microsoft_09.html
10-18-2008 8:03 AM |
Hi You also Go through these all
surely you will get a solutions
Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}
http://www.thedatafarm.com/silverlightink/
http://www.thedatafarm.com/blog/2008/01/31/ConvertingSilverlightInkPresenterImagesToAPNGFile.aspx
http://blogs.devsource.com/devlife/content/silverlight/drawing_in_silverlight_a_quick_comparison_between_10_and_11.html
http://blogs.devsource.com/devlife/content/silverlight/silverlight_inkpresenter_staying_inside_the_lines_1.html
http://msdn.microsoft.com/en-us/magazine/cc721604.aspx
StefanWick
Contributor
2864 points
438 Posts
10-18-2008 1:03 PM |
To answer the specific question about saving the ink:
Unlike WPF, Silverlight does not currently support ISF (Ink Serialized Format), which is Microsoft's standard format to persist ink. So in order to persist your user's handwriting and ink drawings, you will have to write code to persist all relevant properties of the strokes in the InkPresenter's stroke collection. So in pseudo-code, here is what you do:
For-each stroke in Inkpresenter.Strokes:
Serialize stroke.DrawingAttributes property values (to save the appearance of the stroke, like color, thickness)
For-each stylusPoint in stroke.StylusPoints
Serialize X, Y, PressureFacture property values (to save the geometry of the stroke)
End-for
Then you can send the serialized ink data to the server for storage.
Thanks, Stefan Wick
10-20-2008 7:40 AM |
Thanks for your reply. I work on serialization and deserialization but I stuck inbetween. I won't be able to collect strokecollection eg: var tempstroke = strokeCollection.GetItem(i);
It gives me error on getitem(i). State that system.windows.ink.stroke does not contain definition of getitem.
Please help me to resolve this.
Thanks,
10-20-2008 12:29 PM |
Are you writing C# code? In that case you should use 'strokeCollection' to access individual stroke objects from the collection.
10-21-2008 6:39 AM |
Thanx Stefan.
My code i sin C#. I am handlig strokeCollection.
While handling strokeCollection, I don't hav access on getitem.
As I mentioned earlier I used strokeCollection.Getitem(i);
How to resolve it?
10-21-2008 10:42 AM |
Looks like the HTML interface of the forum software messed up my previous post
Here is how you do the equivalent in C#, to access an individual stroke object from the collection:
Stroke stroke = strokeCollection[ i ];
11-03-2008 7:48 AM |
Hi Stefan,
Once again I need your help. I got the idea of serialization and deserilaization. After serialization we need to send xml as a string to web-service.
Instead of using web service Is it ok to use exe file? How to handle exe in silverlight?
I want to save changes on the image we need to handle WPF ink. At this point I am confused. How to handle WPF with the exe file.
The code is in C#. Please guide me on the same.
11-03-2008 9:48 AM |
I am not sure I understand your scenario. Please explain a bit more.
Do you want to run the WPF exe on the client computer or on the server computer?
11-04-2008 11:38 PM |
My application's basic need is save editted image on the server. After saving image user must be able to see those editted image.
I plan that after creating xml of the generated stroke I want to pass this on server and server do all the saving of new image.
* Here new Image = original image + user's drawing.
So I want to run WPF exe on server. cause I thimk that calling service will slow down the server.
Please suggest me the best way to perform task. I am newbie so I don't have any idea regarding performance and effective working of silverlight.
I am referring following link :
http://msdn.microsoft.com/en-gb/magazine/cc721604.aspx?pr=blog and
But still I am cofused with sending stroke collection's xml file on service.
Sheetal.
11-06-2008 1:22 AM |
I would recommend using a webservice (like in Julie's example). Otherwise you would have to write all the communication logic yourself for little or no benefit.
What problem are you facing with sending strokes a stroke collection to the server? Once you have serialized the strokes to a string, you just need to send that string to server.
11-06-2008 3:19 AM |
Thanks Stefan,
I created a cross domain WCF web service. I am trying to use it with silverlight application. Include a crossdomainaccesspolicy.xml file in the root directory . Still I am not able to handle the web-service in my application I get an error.
ERROR :
An error occurred while trying to make a request to URI 'http://~/WCFServiceDZC/Service.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. Please see the inner exception for more details.
I don't have ne idea to resolve it.
11-06-2008 9:58 AM |
Since this problem appears to be unrelated to the original topic of this thread, I would suggest opening a new thread to discuss this one. From the information you provided so far it's a bit hard to diagnose, so any additional information or code snippets would be helpful.
Out of curiosity: why does this have to be cross-domain? Couldn't you run the service on the same site where the Silverlight app resides?
11-06-2008 11:23 PM |
I prefer cross domain because in future I am able to access the service for various applicatins.
Thanks for your guidance.
Hope this issue resolve early ......
Thanks , sheetal