I'm so close, but my program does not pass check50 because it doesn't resize a 1x1 BMP correctly when n is 1, 2, 3, 5 (i.e., when it needs padding).

When I use peek to compare with staff for 1x1 and n = 1, I see the problem is with biSizeImage. Staff has that as 24. Mine is 36. I don't get it. How can the size be 24? Isn't it 3 (width) + 1 (padding) * 3 (abs of height) * 3 (triple size) = 36?

Seems like it could be a padding issue, but even staff.bmp is 90 bytes. How could they get from 24 for image size + 54 for header info to add up to 90?


Oh, I sort of put it together from the answer to a similar post.

Trying not to give away too much, but the breakthrough came when I realized that RGBTRIPLEs are 3 bytes, but padding is only 1 byte. Then I could change my calculation of biSizeImage accordingly and now it passes all checks.

Hope somehow my question and my own answer will help someone else out there!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .