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 35 gsv_text rendering ASCII characters

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

Share

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

Code

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::gsv_text txt

Agg::conv_stroke txtStroke (txt)

TxtStroke.width (3)

TxtStroke.line_cap (agg::square_cap)

Txt.flip (true); / / the lower axis of Windows is inverted.

Txt.size (20); / / text size

Txt.line_space (10); / / gsv_text can handle\ nline wrapping, setting the spacing between each line

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

Txt.start_point (100,300); / / the starting position of the text is actually biased and needs to be fine-tuned

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

Ras.add_path (txtStroke)

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

Ras.reset ()

Note:

1 only supports rendering of ASCII characters

2 can only render horizontal characters

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