开发者

Wpf inkcanvas Save and Retrieve text

开发者 https://www.devze.com 2023-01-12 01:48 出处:网络
Hi I am trying to implement a mspaint like application in wpf.I have successfully implemented most of the basic drawing functionalities by implementing a custom stroke class.Now I am trying to impleme

Hi I am trying to implement a mspaint like application in wpf.I have successfully implemented most of the basic drawing functionalities by implementing a custom stroke class.Now I am trying to implement the Text inserting option from mspaint.I have tried to implement using DrawingContext.DrawText,it is working alright but when I save the st开发者_StackOverflow社区rokes to an isf file and reloading the drawing,all the drawing is loaded but the text is not restored.Please help me on the same.


I'm afraid the Text is a member of the Children collection. Your StrokeCollection, which is what you're asking to do the serializing and deserializing, doesn't know anything about it. You're going to have to build serialization logic yourself, or go through a DataContractFormatter, or whatever permutation of same you prefer.

0

精彩评论

暂无评论...
验证码 换一张
取 消