Friday, October 9, 2015

WPF path data for plus and minus signs

WPF path data seems not so straight-forward when you first look at it.

There are tools out there to edit it though.

Here are some examples of plus and minus signs if you're interested in something for prototypes and the like.  I didn't see a lot on the web so I thought that I'd share.

Minus (used within a canvas):
            <Canvas.LayoutTransform>
                <RotateTransform Angle="90"></RotateTransform>
            </Canvas.LayoutTransform>
            <Path Width="25" Height="25" Stretch="Uniform" Fill="DarkGray"
            Data="M0,0 L8,0 L8,47 L0,47 z"

Plus (again used within a canvas):
            <Path Width="25" Height="25" Stretch="Uniform" Fill="DarkGray"
            Data="M3.875,0 L5.125,0 5.125,3.875 9,3.875 9,5.125 5.125,5.125 5.125,9 3.875,9 3.875,5.125 0,5.125 0,3.875 3.875,3.875 3.875,0 z"

Cheers.

No comments:

Post a Comment