HTML5 Canvas (drawing of circles and tangent curves) arc, ArcTo

Source: Internet
Author: User

<!DOCTYPE HTML><HTML><Head>    <MetaCharSet= "UTF-8">    <title>Canvas</title>    <Scripttype= "Text/javascript"src=".. /js/jquery.js "></Script>    <styletype= "Text/css">        *{margin:0;padding:0;Outline:None;Border:None;        }#canvas{width:7rem;margin:. 25rem 0 0 1.5rem;Border:1px solid Black;        }    </style></Head><Body>     <CanvasID= "Canvas"width= "+"Height= "All"></Canvas></Body></HTML><Scripttype= "Text/javascript">    /** * REM Layout initialization*/    $('HTML'). CSS ('font-size', $ (window). Width ()/( ten);    /** Get canvas canvas * Get canvas drawing context*/    varCanvas= $('#canvas')[0]; varCXT=Canvas.getcontext ('2d'); /** * Draw round Arc (center of the Axis, the center of the ordinate, the length of the radius, the starting angle of the drawing, the end angle drawn, whether counterclockwise) * arc ArcTo (The horizontal axis of the first control point, the ordinate of the first control point, the horizontal axis of the second person's control point, Ordinate of the second control point, radius of the arc)*/        /*Cxt.arc (0, 2*math.pi, false);    Cxt.fill (); */Cxt.save (); Cxt.linewidth= 3; Cxt.strokestyle= 'Red'; Cxt.moveto ( -,  -); Cxt.arcto ( the,  -,  the,  -,  -);    Cxt.stroke ();        Cxt.restore (); /** * Auxiliary line*/Cxt.strokestyle= 'Green'; Cxt.moveto ( -,  -); Cxt.lineto ( the,  -); Cxt.lineto ( the,  -); Cxt.stroke ();</Script>

HTML5 Canvas (drawing of circles and tangent curves) arc, ArcTo

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.