一家设计公司2年前在WPF中进行了应用程序设计,现在我们正在考虑更改其中一个图像上的文本。没有提供SVG文件,只使用了XAML代码,在设计公司工作的开发人员不再在那里工作。我知道他使用Expression Blend进行设计。
任何有关将XAML转换为SVG 的可能方法的帮助都会有所帮助,甚至是用于生成此XAML的工具的建议。我看到{{3但看起来这些工具只能转换最初在其工具中转换的SVG。
资源字典包含用于通过应用程序显示图像的所有DrawingImage对象。这是我们正在编辑的图像之一:
<DrawingImage x:Key="MotorControlBackground">
<DrawingImage.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#FF466280" Geometry="F1 M -1138.47,3547.06C -1128.45,3557.08 -1112.14,3557.17 -1102.23,3547.25L -1024.29,3469.32L -1118.83,3374.78L -1214.79,3470.74L -1138.47,3547.06 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="2.5" MiterLimit="2.75" Brush="#FF212121"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M -1131.22,3533.84L -1138.68,3533.84L -1138.68,3532.34L -1135.91,3532.34L -1135.91,3521.89L -1138.68,3521.89L -1138.68,3520.4C -1137.64,3520.4 -1136.87,3520.25 -1136.38,3519.95C -1135.88,3519.65 -1135.6,3519.09 -1135.54,3518.26L -1133.99,3518.26L -1133.99,3532.34L -1131.22,3532.34L -1131.22,3533.84 Z "/>
<!-- ... Heavily shortened. Expect around 100 more lines here ... -->
<GeometryDrawing Geometry="F1 M -1175.94,3268.96L -1057.64,3475.82">
<GeometryDrawing.Pen>
<Pen Thickness="1.33333" MiterLimit="2.75" Brush="#88C7C7C7"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M -1086.99,3255.92L -1147.5,3485.59">
<GeometryDrawing.Pen>
<Pen Thickness="1.33333" MiterLimit="2.75" Brush="#88C7C7C7"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF0C407C" Geometry="F1 M -1025.41,3324.46C -1035.45,3304.48 -1051.7,3288.14 -1071.58,3278.06C -1085.54,3270.98 -1101.28,3266.99 -1117.91,3266.99C -1131.79,3266.99 -1145.06,3269.78 -1157.2,3274.82C -1182.66,3285.41 -1203.09,3305.94 -1213.63,3331.52C -1218.64,3343.71 -1221.42,3357.05 -1221.42,3371C -1221.42,3385.48 -1218.44,3399.29 -1213.06,3411.83C -1202.56,3436.34 -1182.94,3456.06 -1158.55,3466.61C -1146.05,3472.01 -1132.31,3475.02 -1117.91,3475.02C -1103.67,3475.02 -1090.09,3472.09 -1077.72,3466.81C -1052.97,3456.24 -1033.07,3436.25 -1022.56,3411.38C -1017.3,3398.95 -1014.39,3385.3 -1014.39,3371C -1014.39,3354.3 -1018.37,3338.48 -1025.41,3324.46 Z "/>
<!-- ... shortened some more ... -->
<GeometryDrawing Geometry="F1 M -1021.98,3324.73C -1021.98,3355.74 -1069.88,3368.43 -1117.29,3372.09C -1117.75,3372.13 -1120.57,3372.05 -1120.57,3372.05C -1167.81,3368.32 -1215.32,3355.62 -1215.32,3324.73C -1215.32,3286.57 -1170.4,3255.35 -1115.48,3255.35L -1121.82,3255.35C -1066.92,3255.35 -1021.98,3286.57 -1021.98,3324.73 Z ">
<GeometryDrawing.Brush>
<LinearGradientBrush StartPoint="0.548505,0.143509" EndPoint="0.548505,0.805904">
<LinearGradientBrush.GradientStops>
<GradientStop Color="#7FFFFFFF" Offset="0"/>
<GradientStop Color="#00FFFFFF" Offset="1"/>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
答案 0 :(得分:5)
Inkscape(SVG编辑器)对XAML的支持有限。
上次我尝试过,XAML支持并不完美,但那可能是6个月前。从那时起它可能有所改善。
答案 1 :(得分:-1)
可能是通过http://www.codeproject.com/Articles/422523/Convert-XAML-Vector-Graphic-to-PNG将XAML转换为PNG然后将PNG转换为SVG的解决方案。在转换方面,PNG和SVG之间有更多选项。我已经用这种方法将我的XAML绘图转换为EMF。