【问题标题】:Android Vector Drawable - Hexagon shape with curved cornersAndroid Vector Drawable - 带弯角的六边形
【发布时间】:2021-10-12 21:58:34
【问题描述】:

我想在矢量绘图中创建一个六边形。我能找到类似的东西,只是它没有圆角。

<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" /> 

您能否给我一些提示,如picture 中所示的那样创建它?

我仍在尝试了解这些曲线的工作原理,但我无法弄清楚。

任何帮助表示赞赏。

【问题讨论】:

    标签: android-vectordrawable


    【解决方案1】:

    您可以使用 Adob​​e 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多