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 8 Application of AGG in MFC Engineering

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Preface

With the exception of the pure_api example, everything else is developed on top of agg::platform_support. These examples hide the details of how to create a render cache buffer and associate agg::rendering_buffer by calling agg::platform_support. In a word, by inheriting from agg::platform_support, you can directly call rbuf_window () to get the rendered cache. And pure_api is the most primitive program, by calling the system API function to build a most complete and detailed example program, and these things have been encapsulated in agg::platform_support. In the wx chapter, there is a detailed description of how to apply AGG for rendering.

Request

The original intention is to get the render cache of the current bitmap, pass it to agg::rendering_bufer, and then start rendering AGG.

Result

After querying a lot of information, you can only create a compatible DC, then create a compatible bitmap, then select a bitmap to get the rendering cache, and then map it to the current compatible DC.

HDC mem_dc =:: CreateCompatibleDC (hdc); / / create compatible DC

Void* buf = 0

HBITMAP bmp =:: CreateDIBSection (/ / create compatible bitmap and get cache

Mem_dc

& bmp_info

DIB_RGB_COLORS

& buf

0

0

);

/ / Selecting the object before doing anything allows you

/ / to use AGG together with native Windows GDI.

HBITMAP temp = (HBITMAP):: SelectObject (mem_dc, bmp)

/ / Map to the current DC, minus 100. you don't want to cover a small area on the right.

:: BitBlt (

Hdc

Rt.left

Rt.top

Width-100

Height

Mem_dc

0

0

SRCCOPY

);

Summary

For a detailed process, please refer to examples in the source directory for complete test cases.

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