How to Serialize a WPF Drawing?
maybe I'm missing something.
I believed that WPF vector-based Drawings (like Drawing开发者_C百科Group, DrawingGeometry, etc.) were ready to be serialized. But they are not. So, should I navigate all these drawing childrens, and store they points, lines, brushes (that also are not serializable) and so on, and then made my custom serialization?
Is really that difficult or I'm missing something pretty obvious?
I mean, even serializing Bitmap images is easy. I thinked serializing vector-based drawings were easier (no quality loss, just descriptive info, no massive data).
Thanks for your practical answers, alternate-way suggestions and comments!
You can use the XamlWriter.Save method to save the drawing as XAML
This is just an idea: What about serializing it as a byte array?
精彩评论