mingw gdiplus rendering scales wrong

May 1, 2025 at 5:58pm
I'm trying to convert GDI32 program to GDI+ ...
I'm using MinGW toolchain (TDM V10.3.0) on Windows 10.

I am trying to implement an ImageList capability in gdiplus; i.e., I have an image that consists of multiple smaller images in an array, and I want to copy specified smaller images from the reference image to my target display. What's happening, though, is that image portion is being re-scaled from the size that I specified... can anyone advise on what I'm doing wrong here??

The code is building with no warnings (-Wall)

Here is my cloning/drawing code:

// 180 x 192, 24 bpp
Image image2(L"brainy180.png");
graphics.DrawImage(&image2, 700, 200);

// 1077 x 362, 24 bpp
Image image3(L"images.png");
graphics.DrawImage(&image3, 950, 200);

In this example, image2 draws at proper scale, but image3 is scaled to 346x116 ...
https://www.flickr.com/photos/derelllicht/54490231916/

I tried also using the form of DrawImage() which allows specifying image size, but it *still* scales the images to 116x116 (vs 359x32)...

graphics.DrawImage(pbitmap, x_dest, 500, x_offset, 0, sprite_x, sprite_y, UnitPixel);

Does anyone have any insights into what I don't understand here?
Last edited on May 1, 2025 at 10:32pm
May 2, 2025 at 12:42am
Okay, I finally figured out how to disable "automatic scaling", once I discovered that this term existed...

If I call DrawImage() with two additional arguments (image width and height), then it does not auto-scale, and I get the required image copies...

graphics.DrawImage(clone, xdest, ydest, dx, dy);
Registered users can post here. Sign in or register to post.