Hi all.
I have some odd problem with resizing bitmaps using GDI+.
Say i have an jpeg image 10000x5000. I display it's current part in original size with this:
graphics->DrawImage(bitmap, -x, -y, bitmap->GetWidth(), bitmap->GetHeight());
where x,y are coordinates of current shifting.
I'm resizing image like this:
Bitmap* newBitmap = new Bitmap((INT)(bitmap->GetWidth()*Scale), (INT)(bitmap->GetHeight()*Scale));
Graphics* graphics = new Graphics(newBitmap);
graphics->ScaleTransform(Scale, Scale);
graphics->DrawImage(bitmap, (INT)0, (INT)0, (INT)(bitmap->GetWidth()), (INT)(bitmap->GetHeight()));
And now the problem:
When I'm loading image direct from file, displaying works very fast, nice and without delays. But when i display resized image, even if it became smaller, drawing operation takes a lot more time then it was.
I have tried setting different InterpolationMode, SmoothingMode, PixelOffsetMode but it had no effect. I'm trying to manage with this problem for a long time. Tried different ways, but all they had no effect. Maybe I'm missing something obvious? Maybe some information from "file bitmap" gets lost? Pixel format is always the same. Well, now I don't have any other ideas, so I hope someone can help me with my issue.
Forgot to say that I'm using plain winapi, so .NET solution can't help me.