Get the App
SLTechnology News&Howtos  ›  Servers  › 

AGG lesson 15 agg::rounded_rect rendering rounded rectangle

Shulou Source: shulou.com Published: 2022-06-02 09:52:45 10月19日 Update

1 file reference and parameter description

Header file: # include

Class constructor: rounded_rect (double x1, double y1, doublex2, double y2, double r)

The coordinates of the opposite corner of the rectangle (the coordinates of the upper left corner and the lower right corner) and the fillet radius

If the fillet radius is specified to be 0, the drawing is a regular rectangle!

2 examples (questions)

Agg/examples/rounded_rect.cpp is an example of a rounded rectangle. What I don't understand is subpixel offset, sub-pixel offset.

4 A problem with mail

I'm tring to get bounding rectangle of object and trind below code

/ / Round Rect

Agg::rounded_rect r (0re0WidthreWidthreHeightPerson0)

R.normalize_radius ()

Ras.add_path (r)

Agg::render_scanlines_aa (ras, sl, renb,grad_alloc, grad_gen)

But I cann't call r.bound_rect ()

For what kinds of objects bound_rectfunction can be called??

Tags: Fillet rectangle example radius coordinates file problem normal pixel parameter place diagonal that is upper left corner mail constructor offset Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Apple Huawei macOS MariaDB