Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

AGG lesson 27 agg::conv_clip_polyline clipping line area

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Application scenario

The path point is far beyond the rendering range N

Header file

# include "agg/include/agg_conv_clip_polyline.h"

Simple example

Void ClipPathByPolyline ()

{

Agg::rendering_buffer & rbuf = rbuf_window ()

Agg::pixfmt_bgr24 pixf (rbuf)

Typedef agg::renderer_base renderer_base_type

Renderer_base_type renb (pixf)

Typedef agg::renderer_scanline_aa_solidrenderder_scanline_type

Renderder_scanline_type rensl (renb)

Agg::rasterizer_scanline_aa ras

Agg::scanline_u8 sl

Ras.reset ()

Agg::path_storage ps

Ps.move_to (100540)

Ps.line_to (168.889471.429)

Ps.line_to (237.778402.857)

Ps.line_to (306.667334.286)

Ps.line_to (651.111 Jing Mi 8.57143)

Ps.line_to (720 mai muri 6.85714 eBay 19)

Ps.line_to (200400)

Ps.line_to (400400)

Ps.line_to (200500)

Ps.line_to (700400)

Agg::conv_clip_polyline polyline (ps)

Polyline.clip_box (0Pol 0600800)

Agg::conv_dashdash (polyline)

Dash.add_dash (10 and 10)

Agg::conv_stroke stroke (dash)

Stroke.width (2)

Ras.add_path (stroke)

Agg::render_scanlines_aa_solid (ras,sl,renb,agg::rgba8 (255j0pl 0))

}

Restrictions:

Here the lines will be clipped beforecalculating the rest. But if you have

Very wide lines you will see some defects

To avoid it you may want to extend theclipping area to the maximal line width.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report