Cgcontextaddarctopoint and cgcontextaddarc

Source: Internet
Author: User

Cgcontextaddarctopoint

The Code is as follows:

 

[Plain] View plaincopy
    1. Cgcontextref context = uigraphicsgetcurrentcontext ();
    2. Cgcontextsetrgbstrokecolor (context, 1, 0, 1, 1 );
    3. Cgcontextmovetopoint (context, 150,50 );
    4. Cgcontextaddlinetopoint (context, 100,80 );
    5. Cgcontextaddlinetopoint (context, 130,150 );
    6. Cgcontextmovetopoint (context,); // the starting point of the arc.
    7. Cgcontextaddarctopoint (context, 100,80, 130,150, 50 );
    8. Cgcontextstrokepath (context );

 

 

Cgcontextmovetopoint (context, 150,50 );//Starting Point of the arc

Cgcontextaddarctopoint (context, 100,80, 130,150, 50 );

From (150,50) (100,80) draw a line and then (100,80) (130,150) draw a line from these two lines (infinitely extending)And radius50. You can determine an arc,

While

Cgcontextaddarc (context, 100,100, 30, 0, m_pi, 1 );

Relatively simple,(100,100) is the coordinate of the center,30 is the radius ,(0,M_pi) is the start and end angles,1 is clockwise,0 is counter-clockwise

From (150,50) (100,80) draw a line and then (100,80) (130,150) draw a line from these two lines (infinitely extending)And radius50 to determine an arc

 

Cgcontextaddarctopoint and cgcontextaddarc

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.