android-vectordrawable - Android Vector Drawable - 带弯角的六边形
问题描述
我想在矢量可绘制中创建一个六边形。我能够找到这样的东西,除了它没有圆角。
<path android:name="hexagon"
android:fillColor="#aa0000"
android:strokeColor="#000000"
android:strokeWidth="4"
android:pathData="
m723,314c-60,103.9 -120,207.8 -180,311.8 -120,0 -240,0
-360,0C123,521.8 63,417.9 3,314 63,210.1 123,106.2
183,2.2c120,0 240,0 360,0C603,106.2 663,210.1 723,314Z" />
你能给我一些提示如何创建它,如图所示?
我仍然试图了解这些曲线是如何工作的,但我无法弄清楚。
任何帮助表示赞赏。
解决方案
您可以使用 Adobe Illustrator 或Inkspace将图像转换为SVG文件。然后将SVG文件上传到Shape Shifter,Shape Shifter 将为您提供用于矢量图像的路径和文件。
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="160dp"
android:height="160dp"
android:viewportWidth="160"
android:viewportHeight="160">
<path
android:name="hexagon"
android:fillColor="#aa0000"
android:strokeColor="#000000"
android:strokeWidth="4"
android:pathData="M 45.856 145.287 C 42.844 143.796 39.144 141.246 37.635 139.621 C 32.787 134.403 7.938 90.337 6.681 84.732 C 4.518 75.078 6.223 70.935 26.735 36 C 41.676 10.554 41.433 10.667 81.344 10.667 C 121.707 10.667 119.656 9.431 141.095 46.671 C 155.423 71.56 157.469 77.508 154.645 86.066 C 153.736 88.819 147.283 101.031 140.304 113.203 C 119.796 148.969 121.578 147.93 80.667 147.97 C 53.825 147.996 50.868 147.768 45.856 145.287 Z"/>
</vector>
推荐阅读
- api - 如何在flutter http中使用带有变量的get方法?
- javascript - 如何从阻止直接下载链接的网站下载 MP3 文件?
- c# - UI 按钮和克隆对象
- pdf - 将每个 PDF 页面的一个区域转换为灰度
- c - 为什么 *p0 的值在编译中每次都具有不同的值。这是c语言问题的代码。?
- idl - 将 IDL 导出到 GDL
- aws-lambda - 如何在 AWS Lambda 中运行 CucumberJS
- vue.js - 一种在 Vue.js 中不起作用且无法弄清楚问题所在的方法
- django - (Django REST 框架)通过 NGINX 提供应用程序时,基本身份验证不起作用
- splunk - 将多个搜索组合到单值可视化的格状布局中