Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you convert a XAML DrawingImage back into an SVG for editting?

Tags:

c#

svg

xaml

A design company made an application design in WPF 2 years ago, and now we're looking at changing the text on one of the images. No SVG files were provided, only the XAML code used, and the developer who worked on the project at the design company no longer works there. I know he used Expression Blend for the design.

Any help with possible ways to convert XAML like this to SVG would help, or even suggestions on what tools were used to generate this XAML. I saw this topic on converting XAML to SVG, but it looked like the tools only did conversions with SVGs originally converted in their tool.

A resource dictionary contains all the DrawingImage objects used to display images through the application. Here is one of the images we're looking at editting:

<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>
like image 790
Will Eddins Avatar asked Jun 03 '09 20:06

Will Eddins


People also ask

Can an image be converted to SVG?

Convert your image to an SVG for free. The free SVG converter tool from Adobe Express lets you upload any JPG or PNG image and convert it to a vector in seconds.

What file types can be converted to SVG?

You can use jpg or png image files and turn them into svg files to use with your cutting machine. Learn how you can convert a basic image file, for example a jpg or png file, to svg format that you can use in your Cricut or Silhouette cutting machine.

Does WPF support SVG?

The WPF SVG render engine supports the following SVG elements: Path - <path>


1 Answers

Inkscape (an SVG editor) has limited support for XAML.

Last time I tried it, the XAML support wasn't perfect, but that was maybe 6 months ago. It may have improved since then.

like image 116
Joseph Avatar answered Oct 05 '22 23:10

Joseph