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 36 gsv_text_outline rendering surrounding characters

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

Share

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

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_bin_solid renderder_scanline_type

Renderder_scanline_type rensl (renb)

Agg::rasterizer_scanline_aa ras

Agg::scanline_u8 sl

Ras.reset ()

Renb.clear (agg::rgba8 (255255255))

Agg::ellipse ell (400,100,100,100)

Agg::conv_stroke stroke (ell)

Ras.add_path (stroke)

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

Ras.reset ()

Agg::gsv_text txt

Agg::trans_single_path transPath

TransPath.add_path (ell)

Agg::gsv_text_outline txtOutLine (txt, transPath)

Txt.flip (true)

Txt.size (10)

Txt.start_point (100,15)

Spacing between txt.space (5); / / characters

Txt.text ("http://fengyuzaitu.blog.51cto.com");"

Ras.add_path (txtOutLine)

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

Ras.reset ()

Note:

The direction specified by 1 start_point is no longer the real screen coordinates, but relative to the starting rendering coordinates of the vertex source. The current rendered ellipse starts rendering clockwise from the rightmost point of the ellipse. The first parameter can be understood as how far away from the starting point on the rendered arc, where trans_single_path provides total_length to calculate the length of the path. It is convenient to deploy the position of each character (relative to the starting point). The second parameter is to specify the width of the character to deviate from the path, whether the positive and negative values deviate from the internal test or the outside, respectively.

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