harmony 鸿蒙path

  • 2022-08-09
  • 浏览 (747)

path

NOTE

This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.

The <path> component is used to draw a path.

Required Permissions

None

Child Components

The following are supported: <animate>, <animateMotion>, and <animateTransform>.

Attributes

The universal attributes and the attributes listed below are supported. The configured universal attributes are passed to the child components.

Name Type Default Value Mandatory Description
id string - No Unique ID of the component.
d string - No Shape of the path. The value contains a group of character instructions. Uppercase letters are absolute paths, and lowercase letters are relative paths.
The meanings of the letters are as follows:
-&nbsp;M/m&nbsp;=&nbsp;moveto
-&nbsp;L/l&nbsp;=&nbsp;lineto
-&nbsp;H/h&nbsp;=&nbsp;horizontal&nbsp;lineto
-&nbsp;V/v&nbsp;=&nbsp;vertical&nbsp;lineto
-&nbsp;C/c&nbsp;=&nbsp;curveto
-&nbsp;S/s&nbsp;=&nbsp;smooth&nbsp;curveto
-&nbsp;Q/q&nbsp;=&nbsp;quadratic&nbsp;Belzier&nbsp;curve
-&nbsp;T/t&nbsp;=&nbsp;smooth&nbsp;quadratic&nbsp;Belzier&nbsp;curveto
-&nbsp;A/a&nbsp;=&nbsp;elliptical&nbsp;Arc
-&nbsp;Z/z&nbsp;=&nbsp;closepath

Example

<!-- xxx.hml -->
<div class="container">
    <svg width="400" height="400">
        <path d="M 10,30 A 20,20 0,0,1 50,30 A 20,20 0,0,1 90,30 Q 90,60 50,90 Q 10,60 10,30 z"
          stroke="blue" stroke-width="3" fill="red">
        </path>
    </svg>
</div>

en-us_image_0000001173164891

你可能感兴趣的鸿蒙文章

harmony 鸿蒙JavaScript-compatible Web-like Development Paradigm

harmony 鸿蒙Data Type Attributes

harmony 鸿蒙button

harmony 鸿蒙chart

harmony 鸿蒙divider

harmony 鸿蒙image-animator

harmony 鸿蒙image

harmony 鸿蒙input

harmony 鸿蒙label

harmony 鸿蒙marquee

0  赞