WPF Polygon ViewBox用法

 

 

 

1
2
<Polygon Points="0 0, 420 0, 450 200, 420 400, 0 400" HorizontalAlignment="Left">
</Polygon>

  用WPF自带的Polygo元素绘制闭合形状,上图为一个五边形,坐标为0 0, 420 0, 450 200, 420 400, 0 400。该元素将各个点按照顺序进行直线连接

 

   viewBox属性的值是一个包含4个参数的列表 min-x, min-y, width and height ,默认值为(0,0,width ,height(默认为1));个人理解当height为默认值1,width < 1 ,如下图红色标注1所示。当width> 1时,红色标注2所示。可以主要调节width参数来显示图片的目标部分。

Viewbox控件介绍:The position and dimensions of the System.Windows.Media.TileBrush content. The default value is a rectangle (System.Windows.Rect) that has a System.Windows.Rect.TopLeft  of (0,0), and a System.Windows.Rect.Width and System.Windows.Rect.Height of 1

 

posted @   sanmannn  阅读(858)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
点击右上角即可分享
微信分享提示