简体   繁体   English

如何从HBITMAP转换为.NET的Bitmap类?

[英]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. 我正在使用一些使用CreateDIBSection函数创建位图并返回HBITMAP句柄的C ++代码。 What is the best way of getting this information into my .NET assembly? 将这些信息放入.NET程序集的最佳方法是什么?

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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