简体   繁体   中英

How to convert from HBITMAP to .NET's Bitmap class?

I am using some C++ code that employs the CreateDIBSection function to create a bitmap and return a HBITMAP handle. What is the best way of getting this information into my .NET assembly?

您可能正在寻找静态方法Image.FromHbitmap(IntPtr hbitmap)

您是否尝试过整理位图的字节数组,将其加载到MemoryStream中,然后使用该流构造Bitmap类?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM