2018-8-10-win10-UWP-用Path画图
2024-10-07 15:50:19
title | author | date | CreateTime | categories |
---|---|---|---|---|
win10 UWP 用Path画图
|
lindexi
|
2018-08-10 19:16:50 +0800
|
2018-2-13 17:23:3 +0800
|
Win10 UWP
|
本文将使用 Path 画一个聊天气泡。
内容是看到 大神写的 WPF绘制简单常用的Path,想到 UWP 画图是不是也一样,于是做的一个抄袭的 Path
直接使用图片
我们写上所有点。写在折线,在UWP,还是存在和 WPF 做法有些修改,却没有修改什么。
<Path Stroke="Black" StrokeThickness="2" Margin="10,10,10,10">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure>
<PolyLineSegment Points="0,0 100,0 100,90 55,90 50,100 45,90 0,90 0,0"></PolyLineSegment>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
其实,可以不加PathGeometry.Figures
,看起来就和之前代码一样
下面就使用 ArcSegment 看起来不是尖角
<Path Stroke="Black" StrokeThickness="2" Margin="200,10,10,10">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="0,5">
<LineSegment Point="0,85"></LineSegment>
<ArcSegment Point="5,90" Size="5,5"></ArcSegment>
<LineSegment Point="45,90"></LineSegment>
<LineSegment Point="50 100"></LineSegment>
<LineSegment Point="55,90"></LineSegment>
<LineSegment Point="95,90"></LineSegment>
<ArcSegment Point="100,85" Size="5,5"></ArcSegment>
<LineSegment Point="100,5"></LineSegment>
<ArcSegment Point="95,0" Size="5,5" ></ArcSegment>
<LineSegment Point="5,0"></LineSegment>
<ArcSegment Point="0,5" Size="5,5"></ArcSegment>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
如果我们把第一个图,边框变大,可以看到没有合,这样觉得不好
可以设置 PathFigure IsClosed="True"
让最后一个点合在开始,这样就是闭合,不会出现没有合
我们来说下 ArcSegment
最新文章
- AMD规范与CMD规范的区别
- IOS开发之画图形
- HTML、CSS部分
- 使用Node.JS访问Hyperledger Fabric的gRPC服务
- 【BZOJ-3337】ORZJRY I 块状链表
- 51nod百度之星2016练习赛
- createjs 的 bitmapdata类
- codeforce #339(div2)C Peter and Snow Blower
- [置顶] location.href你真的会用了?
- 【Python之路】第五篇--Python基础之杂货铺
- Fill-rate, Canvases and input 【译】
- mysql中配置ssl_key、ssl-cert、ssl-ca的路径及建立ssl连接
- jvm内存结构(一)
- 删除网络中的本地连接*x等
- reactNative 基础
- 「CodeForces - 598B」Queries on a String
- 如何在Win10上永久禁用Windows Defender Antivirus
- Freemarket语法
- 8 jmeter之集合点
- 用 Java 实现一个冒泡排序算法
热门文章
- Linux使用rarcrack暴力破解RAR,ZIP,7Z压缩包
- qt如何去掉文件路径最后一个反斜杠的内容
- jmeter 参数化1_User Parameters(用户参数)
- linux下安装maven私服nexus
- Maven项目的pom.xml配置文件格式初识
- spring boot 热部署devtools实现(成功,主要是添加依赖后配置setting)
- MariaDB强势席卷DB-Engines榜单后续,与阿里云达成全球独家战略合作
- spring-cloud:eureka server单机、双机、集群示例
- 远程仓库(GitHub)的使用
- Codeforces 803E--Roma and Poker (DP)