Draw using WPF with c# [closed]
i need to draw something like the image below using WPF... i need this in xaml code and in c# in code behind.
I'm just asking for some tips on how to achieve this picture. I've been trying without any success, so I was asking for some hint or help, I do not pretend that I solved the problem myself.
Thanks for any help.
If you want to draw in XAML use a path. This draws a little Rotate right image with XAML. The nice thing is its all vector based.
F 0 = Even Fill
M 10,0 = Move to 10 across and down 0
V 15 = Draw vertical line for 15
H 18 = Draw horizontal line for 18
Z = Close this object
You can draw other types of objects with the drawing commands. Look at them here.
<Style x:Key="RotatePlus90Path" TargetType="{x:Type Path}">
<Setter Property="Stroke" Value="Black"></Setter>
<Setter Property="Pen.LineJoin" Value="Miter"></Setter>
<Setter Property="Data" Value="F 0 M 10,0 V 15 H 18 Z M 1,12 S 0,5 8,5 M 8,5 L 6,7 6,3 8,5 "></Setter>
</Style>
<Button Height="22" ToolTip="Rotate +90 degrees" Command="{x:Static local:Commands.Rotate90Plus}" Background="{x:Null}">
<Button.Content>
<Path Style="{StaticResource RotatePlus90Path}"></Path>
</Button.Content>
</Button>
精彩评论