The magical shorten of Agg::conv_stroke

Source: Internet
Author: User

1 Preface

I added the possibility to shorten paths in Convertersconv_stroke and Conv_dash. It ' s good for drawingarroheads with rather thick strokes. Also thre ' s aconverter agg_conv_shoren_path.h that can be usedindependently. I also added agg_conv_concat.h that also helps to workwith markers. Before had to Call:ras.add_path (stroke); Ras.add_path (arrow); Now you can use the agg::conv_concat that simplyconcatenetes the paths into one.

2 Sample Code

M_slider1 (600-10, 276,!flip_y)

Add_ctrl (M_slider1);
M_slider1.range (0,300);

M_slider1.num_steps (30);
M_slider1.value (1);


       //A collapsed process of reduction
        agg::ellipse ell1 ( 230,230,140,150);
        agg::conv_stroke<agg::ellipse> stroke1 (ELL1);
        stroke1.width (30);
        stroke1.shorten (M_slider1.value ());
        ras.add_path (stroke1);


        //similar to shortening
        agg::p ath_ Storage PS;
        ps.move_to (20,30);
        ps.line_to (440,30);
        agg::conv_stroke<agg::p ath_storage> stroke2 (PS);
        stroke2.width (30);
        stroke2.shorten (M_slider1.value ());
        ras.add_path (stroke2);

Agg::conv_stroke Shorten magical

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.