Does WPF support reading/writing WMF/EMF files natively?

社会主义新天地 提交于 2019-11-30 13:24:09

A quick search on MSDN reveals a thread containing a post by Peggi Goodwin, a PM at Microsoft:

WPF does not support the EMF and WMF image formats. These formats are more susceptible to security vulnerabilities than other image formats, so we do not intend to support them.

I did it !!!

I'm using ComponentOne's WPF chart in my real code but to keep the example simple I just did a button. But it DOES work on Complex wpf widgets. Fonts, Transparency, AntiAlias etc. everything works. And I can paste into Word and change labels on charts etc.

Basically I decimate the XAML to XPS then import it back into XAML.

Then I used an open source project that converts XAML to WMF called XAMLToys.

XAMLToys would fail 99% of the time because you cannot serial complex XAML objects

http://softronix.com/download/WpfToWmfClipboard.zip

Big kudos to these two projects

http://xamltoys.codeplex.com/

http://khason.net/blog/converting-fixeddocument-xpsdocument-too-to-flowdocument/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!