I am writting code in c++, gdi+.
I make use of Image's GetThumbnail() method to get thumbnail. However, I need to convert it into HBITMAP. I know the following code can get GetHBITMAP:
Bitmap* img;
HBITMAP temp;
Color color;
img->GetHBITMAP(color, &temp); // if img is Bitmap* this works well。
But how can I convert Image* into Bitmap* fast? Many thanks!
Actually, now I have to use the following method:
int width = sourceImg->GetWidth(); // sourceImg is Image*
int height = sourceImg->GetHeight();
Bitmap* Result;
result = new Bitmap(width, height,PixelFormat32bppRGB);
Graphics gr(result);
//gr.SetInterpolationMode(InterpolationModeHighQuality);
gr.DrawImage(&sourceImg,0,0,width,height);
I really don't know why they do not provide Image* - > Bitmap* method. but let GetThumbnail() API return a Image object....