How to convert from HBITMAP class to .NET Bitmap?

I am using some C ++ code that uses a function CreateDIBSection

to create a bitmap and returns a handle HBITMAP

. What's the best way to get this information in my .NET assembly?

+1


source to share


2 answers


The static method Image .FromHbitmap (IntPtr hbitmap) might be what you are looking for.



+6


source


Have you tried concatenating the byte array for your bitmap by loading it into a MemoryStream and then using that stream to create the Bitmap class?



0


source







All Articles