I think I almost got horizontal part of resize correct, but colors are a bit off. Here's a picture: enter image description here

My header files are correct (compared peeks of mine and staffs), and not sure where I'm going wrong. Any help would be appreciated

Here's a link to my code (expires in 1 week for honesty policy): http://pastebin.com/GMNWiJ7i

1 Answer 1

// iterate over infile's scanlines (so use old width and height)
for (int i = 0, biHeight = abs(bi.biHeight); i < biHeight; i++)

So, ummmm..... why are you using the new values for bi.biWidth and bi.biHeight? ;-)

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

  • How would I do that? Tried with making old value into a variable (int a = bi.biHeight) and making a copy of the struct (see link) but can't seem do it
    – David M
    Jun 30, 2016 at 18:26
  • What do you mean, you can't seem to do it? You did. Now, you just need to figure out why it isn't scaling vertically. Hint: You need to reposition the input file pointer at the beginning of the current line for each time you output a copy of it.
    – Cliff B
    Jun 30, 2016 at 18:39
  • The colors are still off though, shouldn't they be correct but half the size since only resized horizontally so far?
    – David M
    Jun 30, 2016 at 18:42
  • Have you looked at how you are calculating your padding? Which values are you using, old or new, and which should you be using? You also need to make use of the xxd tool to look at the actual data in the output file. Compare it to the output file from the staff example of resize.
    – Cliff B
    Jun 30, 2016 at 19:51
  • Thanks! Same mistake by padding as I made in calculating scanlines
    – David M
    Jun 30, 2016 at 19:55

You must log in to answer this question.

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