将.emf转换为xaml [英] Convert .emf to xaml

查看:125
本文介绍了将.emf转换为xaml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我有一些(超过2000个).emf图片。这些是非常简单的图像,比方说,在每个.emf文件中只有一个圆圈。



现在我想要每个圆圈都有一个xaml路径。



我知道如何手动获取此路径:有一个工具Paste2Xaml.exe(可免费下载),可以进行此转换。



有没有人有想法,如何以编程方式执行此操作,还是有其他解决方案,而不是真正对所有2000个文件进行此转换?





感谢您的帮助!

Hi all

I have some (more than 2000) .emf images. These are very simple images, say, in each .emf file there is only a circle.

Now i want for every circle a xaml path.

I know how to get this path manually: There is a tool Paste2Xaml.exe (downloadable for free) which can make this conversion.

Has anyone an idea, how to do this programmatically, or is there another solution than really to this conversion for all 2000 files?


Thanks for any help!

推荐答案

请阅读我对该问题的评论。



以下是一个想法:

快速入门:访问文件以编程方式(XAML) [ ^ ]

何w to:加载和显示图元文件 [ ^ ]
Please, read my comment to the question.

Here is an idea:
Quickstart: Accessing files programmatically (XAML)[^]
How to: Load and Display Metafiles[^]


好的,我找到了一个解决方案:



我下载了dll ReaderWmf。将此dll添加到项目后,以下代码适用于我(我知道,.emf文件中只有2个路径。)





Viewbox box = Ab2d.ReaderWmf.Instance.Read(@C:\ Users \tkr\Desktop\16A-00.emf);



Canvas canvas =(Canvas)box.Child;

Path path1 =(Path)canvas.Children [0];

Path path2 =(Path) canvas.Children [1];





thx给所有帮助我找到解决方案的人!
Ok, i found a solution:

I downloaded the dll ReaderWmf. After adding this dll to the project, the following code works for me ( i know, that there are exactly 2 paths in a .emf file.)


Viewbox box = Ab2d.ReaderWmf.Instance.Read(@"C:\Users\tkr\Desktop\16A-00.emf");

Canvas canvas = (Canvas)box.Child;
Path path1 = (Path)canvas.Children[0];
Path path2 = (Path)canvas.Children[1];


thx to all which helped me finding a solution!


这篇关于将.emf转换为xaml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆