Click here to Skip to main content
14,877,155 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi ,as a test I am adding as background of a Grid column a DrawingBrush element which using PElipseGeometry draws something similar a strech ellipse.Here is the code:


XML
<!--Ship shape as a background-->
  <DrawingBrush x:Key="ShipShapeBackgroundBrush" >
    <DrawingBrush.Drawing>
      <DrawingGroup>
        <GeometryDrawing Brush="#D8D8D8">
          <GeometryDrawing.Geometry>
            <RectangleGeometry Rect="0,0,50,85" />
          </GeometryDrawing.Geometry>
        </GeometryDrawing>
        <DrawingGroup.ClipGeometry>
          <EllipseGeometry Center="25,50" RadiusX="22" RadiusY="50" />
        </DrawingGroup.ClipGeometry>
      </DrawingGroup>
    </DrawingBrush.Drawing>
  </DrawingBrush>
</UserControl.Resources>



I would like to draw a figure that looks as a very simple ship map. I want to do it like in the previous code but using this time a Path Geometry to draw a figure more in detail. I checked documentation like this http://msdn.microsoft.com/en-us/library/ms752293(v=vs.110).aspx[^]:
but what I don't know is how to draw my figure and tranlsate to path language (F0 M10,100 L100,100 100,50Z).

I saw examples already done where they draw nice plane shape with path geometry. How can I do it?
Posted
Comments
Tomas Takac 28-Oct-14 14:07pm
   
here[^] the path geometry is explained. And here[^] is a short explanation how it is translated to mini-language.

1 solution

Make you map using Adobe Illustrator or Photoshop. Then import the file into Blend. When it is imported you will see all the Path Objects with data. Copy these into you XAML file and use them.

I do this when adding glyphs to my buttons.

Doug
   

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




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900