I want to create a Drawing::Image object (managed) from a Gdiplus::Bitmap object. This was my approach:
Gdiplus::Bitmap* BMP = Gdiplus::Bitmap::FromStream((IStream*)MyStream);
HBITMAP hbmp;
BMP->GetHBITMAP(*(new Gdiplus::Color(0, 0, 0)),&hbmp);
Drawing::Image^ IMG = Drawing::Image::FromHbitmap((System::IntPtr)new IntPtr((void*)hbmp));
HBITMAP hbmp;
BMP->GetHBITMAP(*(new Gdiplus::Color(0, 0, 0)),&hbmp);
Drawing::Image^ IMG = Drawing::Image::FromHbitmap((System::IntPtr)new IntPtr((void*)hbmp));
But unfortunately BMP->GetHBITMAP() returns 7 (Win32Error) even though it's possible to get the bitmap's image dimensions correctly. Surely the rest of the code can't work because the function call fails.
I would appreciate every comment regarding this issue,
Thanks!

Gdiplus::Bitmap --> Drawing::Image
Oswin
walsher
But why isn't there a dedicated FORUM for such problems In my opinion newsgroups are not very convenient.
George.
For GDI issues, please use the newsgroups at http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.win32.programmer.gdi&lang=en&cr=US
OTP
Thanks, Ayman Shoukry VC++ Team