Use of the arcTo function of the canvas object-, canvasarcto

Source: Internet
Author: User

Use of the arcTo function of the canvas object-, canvasarcto

(-1) Environment Description

My browser is chrome49.

(1) detailed introduction

$ (Function () {var context = lol. getContext ("2d"); context. beginPath (); context. moveTo (100,10); context. arcTo (220,10, 220,110,100); context. stroke (); context. closePath ();})

 

 

 

 

The start point is not specified in the arcTo function. It can be understood as the end point of the previous sub-path,

Context. moveTo (); specifies the start point

The line between x1, y1 and the starting point A, x1, y1 and x2, y2 forms an area. The circle drawn by the r specified radius is tangent to A and B.

Without changing the direction of line A, you can change the RADIUS or the X axis coordinates.

A straight line is drawn between the start point and the cut point when the start point is left or the start point is right.

If the direction B of the line does not change, modify the value of y2 so that x2 and y2 are located above the cut point or below the cut point, and the end point of the arc is the cut point.

Coordinates can not be placed in the canvas!

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.