GDI+ problem: Image and Bitmap
-
I find that Graphics::DrawImage performs better when its first parameter is an instance of Image than that of Bitmap. This makes me confused: this code fragment: Image image(L"C:\a.jpg"); Rect rect(0,0,100,100); g.DrawImage(&image,rect); and this one: Bitmap bmp(L"C:\a.jpg"); Rect rect(0,0,100,100); g.DrawImage(&bmp,rect); and the result is that the first one performs much better when i deflate the "rect" object. Can any one explain this? In my application, I read image data from an HBITMAP handle not a file,so Bitmap is preferred, but as you can see above,i need an Image object to display the image.So how can i convert a Bitmap instance to an Image instance. The type cast won't help and I have also tried Bitmap::GetThumbnailImage. And another way is to use IStream, but i am really not good at using it. Thanks.