Smiley and small.bmp size are 8x8 but only showing 7x7

I thought that my resize.c was not resizing correctly. I enlarged the original small.bmp 3x3 by factor of 2 into large.bmp, but the resized image would only show (on screen) 5x5 instead of 6x6, which is the size shown in the BITMAPHEADER.

However, after opening the original smiley.bmp I noticed the exact same problem with its size. Smiley is an 8x8 image but on screen it shows 7x7

Large.bmp has been manipulated by the program but smiley is the original file downloaded from the server, so that I couldn't mess that up!

I have put plenty of hours into the code, and before I continue to dig in I would like to understand I am having other problems not related to my coding.

Any insight will be appreciated.

Thanks J

enter image description here

enter image description here

2 Answers 2


I realise that this question is over a year old, however other people may still be having the issue so thought I would answer.

I have had exactly the same issue - for me, the problem was caused by being on Windows 10 and having altered the "customise display" setting "Change the size of text, apps, and other items" from the recommended 125% to 100%.

I have no idea why this causes problems, however reverting to 125% solved it for me


Without seeing any code, it's impossible to know what's going on. It looks like an off-by-1 problem. Have you checked your for loops to make sure that you're using the right limits? the right comparison operator - < vs. <=, etc.? It seems like your code is exiting for loops one pass too early, or maybe starting at 1 when you should start at 0.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

  • Thanks Cliff. Before entering into details of the code, I wanted to understand why smiley.bmp is not showing correctly, which has not been rewritten with any code. The original smiley.bmp I downloaded/unzipped is the ones puzzling me (I attached a screenshot of the smiley missing one row and one column). The loops in my code are OK, iterating from 0 to < upperbound.
    – GsDd
    Jan 27, 2016 at 23:02
  • Sorry, I guess that I misunderstood the question. I don't know why you are only displaying 7x7, but I downloaded the file and checked it against the digital content that you displayed in the question. The actual data content of the file that you displayed in your question is correct. It also displays correct visually on my IDE. It looks like something is off with the way you are displaying the bitmap.
    – Cliff B
    Jan 27, 2016 at 23:18
  • Very puzzled. I have not manipulated smiley at all. Thanks for looking into it.
    – GsDd
    Jan 27, 2016 at 23:22
  • I solved the problem by switching PC. Yet, without understanding why the IDE50 would "chop off" one column and one row of some bmp's.
    – GsDd
    Jan 31, 2016 at 13:52

You must log in to answer this question.

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