1
votes

Below creates an image from hbitmap:

IntPtr hbitmap = IntPtr.Zero;
...
...
Image img = Image.FromHbitmap(hbitmap);

Now I need to do that in reverse, I mean I got an image and want hbitmap to use in method

LoadImageFromHBitmap(hbitmap)

I save image in memory than load it from there (if someone help). Thanks!

1

1 Answers

2
votes

You're looking for the Bitmap.GetHBitmap method.
Remember to free the HBitmap.