前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >WPF-形状

WPF-形状

作者头像
MaybeHC
发布2024-04-23 18:18:36
720
发布2024-04-23 18:18:36
举报
文章被收录于专栏:技术之路技术之路

WPF-形状

这里写图片描述
这里写图片描述
代码语言:javascript
复制
<Window x:Class="形状.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:形状"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <TextBlock Margin="66,-13,-66,13">The first row of a grid</TextBlock>
        <Viewbox Grid.Row="2" HorizontalAlignment="Left">
            <Canvas Width="200" Height="150">
                <!--开始线帽 StrokeStartLineCap="Round"结束线帽 StrokeEndLineCap="Round" -->
                <Line StrokeThickness="5" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Canvas.Left="150"  Canvas.Top="20" Stroke="Red" X1="0" Y1="0" X2="10" Y2="100"></Line>

                <Rectangle Fill="Yellow" Stroke="Blue" Canvas.Left="30" Canvas.Top="40" Height="60" Width="100" HorizontalAlignment="Left"> </Rectangle>
                <Ellipse HorizontalAlignment="Left" Fill="Yellow" Stroke="Blue" Canvas.Left="10" Canvas.Top="50" Width="100" Height="50"></Ellipse>
                <Polyline Stroke="Blue" StrokeDashArray="1 2" Points="5,5 15,50 50,70 100,1"></Polyline>
            </Canvas>
        </Viewbox>
    </Grid>
</Window>
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2024-04-23,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • WPF-形状
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档