SVG Note----------Path article

Source: Internet
Author: User

Each path must start with the MoveTo command

MoveTo, LineTo and Closepath

<path d= "M ten L 10z"/>

The coordinates of the uppercase command are absolute, and the coordinates of the lowercase command are relative. Other information:

The 1.z (closepath) command has no coordinates, and it has the same case effect.

2. If you start the path with a lowercase m (moveto), its coordinates are resolved to an absolute position because there is no reference position to calculate the relative position.

Horizontal and vertical lines are common enough to be quick commands. The path can specify a horizontal line using the H command plus the absolute x coordinate, or the H command plus the relative X coordinate. Similarly, the vertical line can be specified using the V command plus the absolute y-coordinate, or the V command plus the relative y-coordinate.

The following path draws a rectangle with a width of 15 units and a height of 25 units.

<path d= "M (h) h-15 Z"/>

We can also place multiple coordinate values behind the horizontal LineTo and vertical lineto commands, but only when you use line markers, and H 25 35 45 and H 45 are the same, and v 11 13 15 and V 39 are the same.

All unnecessary whitespace can be eliminated. There is no need for whitespace after the command letter, because all commands are a single letter. There is no need for whitespace between numbers and commands because the command letters cannot be part of a number. There is no need for white space between positive and negative numbers, because the negative number of the preceding minus is not part of a positive number.

The arc command starts with the letter A (abbreviated for absolute coordinates) or a (abbreviated relative coordinates) followed by the following 7 parameters.

• The X-radius and Y-radius of the ellipse where the point is located, separated by commas.
• The x-axis rotation angle of the ellipse is x-axis-rotation.
Large-arc-flag, if the angle of the arc is less than 180 degrees, it is 0, or 1 if the angle of the arc is greater than or equal to 180 degrees.
Sweep-flag, if an arc is required to draw at a negative angle, it is 0 and is drawn at a positive angle of 1.
• The x-coordinate and y-coordinate of the end point (the starting point is determined by the last drawn dot or the last MoveTo command).

SVG Note----------Path article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.