开发者

Draw using WPF with c# [closed]

开发者 https://www.devze.com 2023-03-12 16:02 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. C开发者_如何学Pythonlosed 11 years ago.

i need to draw something like the image below using WPF... i need this in xaml code and in c# in code behind.

Draw using WPF with c# [closed]

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号