[Original] using the Wpf Application Path to draw an arc, wpfpath

Source: Internet
Author: User

[Original] using the Wpf Application Path to draw an arc, wpfpath

1.Move command:Move Command (M): M start point or: m start point
For example, M 100,240 or m 100,240
When uppercase M is used, it indicates the absolute value; When lowercase m is used; it indicates the value relative to the previous one. If the previous one is not specified, it is used (0, 0 ).

2.Draw command(Draw Command ):
We can draw the following shape:
(1) Straight Line: Line (L)
(2) Horizontal line: Horizontal line (H)
(3) Vertical line: Vertical line (V)
(4) Cubic equation besell curve: Cubic bezr curve (C)
(5) Quadratic equation: Quadratic bezr curve (Q)
(6) smoothing cubic equation (besell) curve: Smooth cubic bezr curve (S)
(7) smoothing quadratic equation: smooth quadratic bezr curve (T)
(8) elliptical Arc: elliptical Arc ()

Syntax for Drawing Instruction format:

(1) Straight Line: Line (L)
Format:
L end point coordinate or: l end point coordinate.
For example, L 100,100 or l 100 100. Coordinate values can be in the form of x, y (separated by commas in the middle) or x y (separated by spaces in the middle.

(2) Horizontal line (H): Draw a straight line from the current point to the specified x coordinate.
Format:H x value or h x value (x is a value of the System. Double type)
For example, H 100 or h 100 can also be in the form of H 100.00 or h 100.00.

(3) Vertical line (V): Draw a straight line from the current point to the specified y coordinate.
Format:V y value or v y value (y is a value of the System. Double type)
For example, V 100 or y 100, or V 100.00 or v 100.00.

(4) Cubic equation (C): You can specify two control points to draw the three-way besell curve between the current point and the specified end point.
Format:C first control point second Control Point End Point or c first control point second Control Point End Point
For example, C 100,200 200,400 300,200 100,200 or c 200,400 300,200
Where, point (100,200) is the first control point, point (200,400) is the second control point, and point (300,200) is the end point.

(5) Quadratic equation (Q): Draws a quadratic equation besell curve between the current point and the specified end point by specifying a control point.
Format:Q Control Point End Point or q Control Point End Point
For example, q 100,200 300,200. Where, point (100,200) is the control point, and point (300,200) is the end point.

(6) smoothing cubic equation besell curve: Smooth cubic bezr curve (S ):You can use a specified vertex to "smoothly" control the beiser curve from the current vertex to the specified vertex.
Format:S control point end point or s Control Point End Point
For example, S 100,200 200,300

(7) smoothing quadratic equation (T ):This is similar to smoothing the cubic equation's besell curve.
Format:T control point end point or t Control Point End Point
For example, T 100,200 200,300

(8) elliptical Arc: elliptical Arc ():Draw an arc between the current point and the specified end point.
A dimension arc rotation angle value the positive and negative angles of the dominant arc mark the end point
Or:
A dimension arc rotation angle value the positive and negative angles of the dominant arc mark the end point
Size: System. Windows. Size type, which specifies the radius value of the elliptical arc X and Y.
Rotation Angle: System. Double type.
Arc rotation angle: the Rotation Angle of an elliptical arc.
IsLargeArcFlag: indicates whether the arc is an active arc. If the angle of the arc is greater than or equal to 180 degrees, it is set to 1. Otherwise, it is 0.
Sweepdireflaflag: this parameter is set to 1 when the positive direction is drawn; otherwise, it is 0.
EndPoint: System. Windows. Point type.

3.Disable command(Close Command): used to connect the first and last points of a graph in a straight line to form a closed area.
In Z or z format.

 

 1    <Canvas Margin="123,0,10,22"> 2             <Path  Stroke="#FFE23838" StrokeThickness="5" Width="500" Height="800" StrokeDashArray="2 1" StrokeDashCap="Round"> 3                 <Path.Data> 4                     <GeometryGroup> 5                         <PathGeometry Figures="M 100,10 A 100,100 0 0 0 200,10" /> 6                         <PathGeometry Figures="M 100,50 A 100,100 0 1 0 200,50" /> 7                         <PathGeometry Figures="M 100,450 A 100,100 0 1 1 200,450" /> 8                         <PathGeometry Figures="M 100,500 A 100,50 45 1 0 300,500" /> 9                     </GeometryGroup>10                 </Path.Data>11             </Path>12         </Canvas>

 

PS:

<PathGeometry Figures = "M 100,500 A 100,50 45 1 0 300,500"/>
The red angle settings are always unavailable. Why?

 

Detailed syntax description: graphic representation syntax in WPF (Data Attribute Syntax of Path)

Related 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.