Enclosing a fill solid another color render border

Source: Internet
Author: User

When you draw a closed drawing, fill it with one color and then paint the border with another color

Operation Steps:

1 render vertex sources directly

2 extracting contour lines from vertex sources by Agg::conv_stroke

3 draw a contour line in another color

Instance code:

Agg::ellipse ell (200,200,50,100);


Ras.add_path (ELL);

Agg::render_scanlines_aa_solid (Ras,sl,renb,agg::rgba8 (255,0,0));

Ras.reset ();



agg::conv_stroke<agg::ellipse> stroke (ELL);

Ras.add_path (stroke);

Agg::render_scanlines_aa_solid (Ras,sl,renb,agg::rgba8 (0,0,255));

Ras.reset ();


The same can be adjusted to see if you first draw the contour line, then fill the effect:

Agg::ellipse ell (200,200,50,100);


agg::conv_stroke<agg::ellipse> stroke (ELL);

Ras.add_path (stroke);

Agg::render_scanlines_aa_solid (Ras,sl,renb,agg::rgba8 (0,0,255));

Ras.reset ();


Ras.add_path (ELL);

Agg::render_scanlines_aa_solid (Ras,sl,renb,agg::rgba8 (255,0,0));

Ras.reset ();


Analysis: Why the first method is valid, the second invalid!! In fact, when the fill color, together with the boundary rendering, if the fill color in the back, certainly even the boundary is re-rendered again, so the outline of the color of the line is gone!!




Enclosing a fill solid another color render border

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.