Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Convert XAML Vector Graphic to PNG

, 23 Oct 2012 CPOL
An introduction to the usage of vector graphics as a source of bitmap graphics.
OpenIconLibrary.zip
PNG
XAML
arrow-down-dash-small.backup
TangoProject.zip
XAMLtoPNG.zip
XAMLtoPNG
Properties
XAMLtoPNG.csproj.user
XAMLToPNG_Sample.zip
00_Go up
980b4f92-db2c-46f8-83ca-042b70ced31a.png
go-up.Canvas.backup
01_mail forward
bc241dff-27e2-42a4-b252-35a170dc68d6.png
02_tango network wireless encrypted
9d7bd680-e0c7-4038-ab20-cb7bf590f0ef.png
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"><Canvas.Background>  <DrawingBrush><DrawingBrush.Drawing><DrawingGroup>
  <DrawingGroup x:Name="DrawingLayer">
    <DrawingGroup.ClipGeometry>
      <RectangleGeometry Rect="0,0,160,160" />
    </DrawingGroup.ClipGeometry>
    <GeometryDrawing x:Name="path208">
      <GeometryDrawing.Brush>
        <RadialGradientBrush Center="7.86081,1.31835" RadiusX="0.563946" RadiusY="0.563946" GradientOrigin="7.86081,1.31835" MappingMode="RelativeToBoundingBox" SpreadMethod="Pad" Opacity="0.99">
          <RadialGradientBrush.Transform>
            <TransformGroup>
              <MatrixTransform>1.18884,0.249702,0,0.841157,0.2,0.299442</MatrixTransform>
              <MatrixTransform>0.376674,-0.0915178,0,0.44405,33.3526,-83.6463</MatrixTransform>
            </TransformGroup>
          </RadialGradientBrush.Transform>
          <GradientStop Color="#E15F9EB2" Offset="0" />
          <GradientStop Color="#DE0C5C7D" Offset="1" />
        </RadialGradientBrush>
      </GeometryDrawing.Brush>
      <GeometryDrawing.Pen>
        <Pen Thickness="9.27151" StartLineCap="Round" EndLineCap="Round" LineJoin="Round">
          <Pen.Brush>
            <SolidColorBrush Color="#FF0C5C7D" Opacity="0.99" />
          </Pen.Brush>
        </Pen>
      </GeometryDrawing.Pen>
      <GeometryDrawing.Geometry>
        <PathGeometry FillRule="Nonzero" Transform="0.376674,-0.0915178,0,0.44405,33.3526,-83.6463" Figures="M-49.21,250.253C-50.4531,237.758,-40.2031,227.28,-26.5727,228.549L281.811,293.495C293.021,296.711,300.174,303.367,303.271,318.626L303.001,556.999 271.496,574.417 -20.6248,515.348 -49.1325,483.196 -49.21,250.253z" />
      </GeometryDrawing.Geometry>
    </GeometryDrawing>
    <GeometryDrawing x:Name="path230">
      <GeometryDrawing.Brush>
        <LinearGradientBrush StartPoint="0.0434782,0.101563" EndPoint="0.900621,1.03125" MappingMode="RelativeToBoundingBox" SpreadMethod="Pad" Opacity="0.699301">
          <LinearGradientBrush.Transform>
            <TransformGroup>
              <MatrixTransform>1,0,0,1,1.75173E-09,-1.08106E-08</MatrixTransform>
              <MatrixTransform>0.341557,-0.106441,0,0.377152,67.042,-16.847</MatrixTransform>
            </TransformGroup>
          </LinearGradientBrush.Transform>
          <GradientStop Color="#FFF5F5F5" Offset="0" />
          <GradientStop Color="#FF949494" Offset="1" />
        </LinearGradientBrush>
      </GeometryDrawing.Brush>
      <GeometryDrawing.Pen>
        <Pen Thickness="8.96855" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter">
          <Pen.Brush>
            <SolidColorBrush Color="#FF1C2942" Opacity="0.992157" />
          </Pen.Brush>
        </Pen>
      </GeometryDrawing.Pen>
      <GeometryDrawing.Geometry>
        <PathGeometry FillRule="Nonzero" Transform="0.341557,-0.106441,0,0.377152,67.042,-16.847" Figures="M-46.2318,305.669L141.393,358.659 143.013,470.95 -47.4986,417.316 -46.2318,305.669z" />
      </GeometryDrawing.Geometry>
    </GeometryDrawing>
    <GeometryDrawing x:Name="path313">
      <GeometryDrawing.Brush>
        <SolidColorBrush Color="#FFFFFFFF" Opacity="0.992157" Transform="-0.0205959,0.0210272,-0.000227304,-0.0794206,29.0843,49.5847" />
      </GeometryDrawing.Brush>
      <GeometryDrawing.Pen>
        <Pen Thickness="39.1707" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter">
          <Pen.Brush>
            <SolidColorBrush Color="#FF1C2942" Opacity="0.992157" />
          </Pen.Brush>
        </Pen>
      </GeometryDrawing.Pen>
      <GeometryDrawing.Geometry>
        <PathGeometry FillRule="Nonzero" Transform="-0.0205959,0.0210272,-0.000227304,-0.0794206,29.0843,49.5847" Figures="M-54.9317,113.669L347.321,224.163 346.804,333.491 -55.046,228.132 -54.9317,113.669z" />
      </GeometryDrawing.Geometry>
    </GeometryDrawing>
    <GeometryDrawing x:Name="path412">
      <GeometryDrawing.Brush>
        <LinearGradientBrush StartPoint="0.107623,0.133438" EndPoint="1.00448,0.986385" MappingMode="RelativeToBoundingBox" SpreadMethod="Pad" Opacity="0.699301">
          <LinearGradientBrush.Transform>
            <TransformGroup>
              <MatrixTransform>1,-5.11905E-06,0,1,-8.06426E-09,2.67899E-08</MatrixTransform>
              <MatrixTransform>0.482789,-0.133883,0,0.474385,59.016,-129.836</MatrixTransform>
            </TransformGroup>
          </LinearGradientBrush.Transform>
          <GradientStop Color="#FFFCFCFC" Offset="0" />
          <GradientStop Color="#FFAFB2B5" Offset="1" />
        </LinearGradientBrush>
      </GeometryDrawing.Brush>
      <GeometryDrawing.Pen>
        <Pen Thickness="6.63037" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter">
          <Pen.Brush>
            <SolidColorBrush Color="#FF0C5C7D" Opacity="0.992157" />
          </Pen.Brush>
        </Pen>
      </GeometryDrawing.Pen>
      <GeometryDrawing.Geometry>
        <PathGeometry FillRule="Nonzero" Transform="0.482789,-0.133883,0,0.474385,59.016,-129.836" Figures="M-46.2318,305.669L141.393,358.659 143.013,470.95 -47.4986,417.316 -46.2318,305.669z" />
      </GeometryDrawing.Geometry>
    </GeometryDrawing>
    <GeometryDrawing x:Name="path414">
      <GeometryDrawing.Brush>
        <SolidColorBrush Color="#FF1C2942" Opacity="0.992157" Transform="0.466341,-0.00328428,0.117494,0.671004,-17.153,-17.3599" />
      </GeometryDrawing.Brush>
      <GeometryDrawing.Pen>
        <Pen Thickness="2.5" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter">
          <Pen.Brush>
            <SolidColorBrush Color="#FF0C5D7D" Opacity="0.99" />
          </Pen.Brush>
        </Pen>
      </GeometryDrawing.Pen>
      <GeometryDrawing.Geometry>
        <PathGeometry FillRule="Nonzero" Transform="0.466341,-0.00328428,0.117494,0.671004,-17.153,-17.3599" Figures="M147.259,91.7372L267.273,92.474 265.636,100.679 145.264,100.165 147.259,91.7372z" />
      </GeometryDrawing.Geometry>
    </GeometryDrawing>
    <GeometryDrawing x:Name="path415">
      <GeometryDrawing.Brush>
        <SolidColorBrush Color="#FF1C2942" Opacity="0.992157" Transform="-0.038896,0.0759893,-0.000429274,-0.287016,75.7215,178.38" />
      </GeometryDrawing.Brush>
      <GeometryDrawing.Geometry>
        <PathGeometry FillRule="Nonzero" Transform="-0.038896,0.0759893,-0.000429274,-0.287016,75.7215,178.38" Figures="M-40.0588,122.695L347.321,224.163 346.804,333.491 -40.0941,229.996 -40.0588,122.695z" />
      </GeometryDrawing.Geometry>
    </GeometryDrawing>
    <GeometryDrawing x:Name="path417">
      <GeometryDrawing.Brush>
        <LinearGradientBrush StartPoint="0.240647,1.19614" EndPoint="0.248069,-0.301604" MappingMode="RelativeToBoundingBox" SpreadMethod="Pad" Opacity="1">
          <LinearGradientBrush.Transform>
            <TransformGroup>
              <MatrixTransform>0.945877,-1.683E-07,5.89965E-08,1.05722,0.264368,0.249996</MatrixTransform>
              <MatrixTransform>0.731873,-0.00515433,0.184395,1.05307,-86.736,-73.2747</MatrixTransform>
            </TransformGroup>
          </LinearGradientBrush.Transform>
          <GradientStop Color="#FDFBDDB2" Offset="0" />
          <GradientStop Color="#F3EFA81A" Offset="1" />
        </LinearGradientBrush>
      </GeometryDrawing.Brush>
      <GeometryDrawing.Pen>
        <Pen Thickness="2.5" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter">
          <Pen.Brush>
            <SolidColorBrush Color="#FF580400" Opacity="0.992157" />
          </Pen.Brush>
        </Pen>
      </GeometryDrawing.Pen>
      <GeometryDrawing.Geometry>
        <PathGeometry FillRule="Nonzero" Transform="0.731873,-0.00515433,0.184395,1.05307,-86.736,-73.2747" Figures="M147.259,91.7372L267.273,92.474 265.636,100.679 145.264,100.165 147.259,91.7372z" />
      </GeometryDrawing.Geometry>
    </GeometryDrawing>
    <GeometryDrawing x:Name="path419">
      <GeometryDrawing.Brush>
        <SolidColorBrush Color="#FF1C2942" Opacity="0.992157" Transform="0.466341,-0.00328428,0.117494,0.671004,-17.153,-4.54748" />
      </GeometryDrawing.Brush>
      <GeometryDrawing.Pen>
        <Pen Thickness="2.5" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter">
          <Pen.Brush>
            <SolidColorBrush Color="#FF0C5D7D" Opacity="0.99" />
          </Pen.Brush>
        </Pen>
      </GeometryDrawing.Pen>
      <GeometryDrawing.Geometry>
        <PathGeometry FillRule="Nonzero" Transform="0.466341,-0.00328428,0.117494,0.671004,-17.153,-4.54748" Figures="M147.259,91.7372L267.273,92.474 265.636,100.679 145.264,100.165 147.259,91.7372z" />
      </GeometryDrawing.Geometry>
    </GeometryDrawing>
    <GeometryDrawing x:Name="path420">
      <GeometryDrawing.Brush>
        <SolidColorBrush Color="#FFFFFFFF" Opacity="0.992157" Transform="-0.0205959,0.0210272,-0.000227304,-0.0794206,140.553,48.944" />
      </GeometryDrawing.Brush>
      <GeometryDrawing.Pen>
        <Pen Thickness="39.1707" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter">
          <Pen.Brush>
            <SolidColorBrush Color="#FF1C2942" Opacity="0.992157" />
          </Pen.Brush>
        </Pen>
      </GeometryDrawing.Pen>
      <GeometryDrawing.Geometry>
        <PathGeometry FillRule="Nonzero" Transform="-0.0205959,0.0210272,-0.000227304,-0.0794206,140.553,48.944" Figures="M-54.9317,113.669L347.321,224.163 346.804,333.491 -55.046,228.132 -54.9317,113.669z" />
      </GeometryDrawing.Geometry>
    </GeometryDrawing>
  </DrawingGroup>
      </DrawingGroup></DrawingBrush.Drawing></DrawingBrush></Canvas.Background></Canvas>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Dirkster99

Germany Germany
The Windows Presentation Foundation (WPF) and C# are one of my favorite past time hobbies since I started developing Edi:
 
https://edi.codeplex.com/
 
and a few other sub-projects on Codeplex. I am normally an algorithms and structure type person but WPF has such interesting sides that I cannot help myself but get into this and MVVM.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141223.1 | Last Updated 23 Oct 2012
Article Copyright 2012 by Dirkster99
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid