0

So, in Zamyla's walkthrough, she says that for the "Re-Copy" method of vertical resizing, you have to go back to the start of the original row, and then repeat the horizontal resizing.

I don't understand this. Why do you have to go back to the start of the original row? Why can't you just write all the pixels in the row "scale" number of times?

i.e. Why cant I just do the "iterate over pixels in scanline" loop "scale" number of times?

I tried to do that, but it came out weird. For example, this is what happened what I did small.bmp x4 scaled.

1
0

Why do you have to go back to the start of the original row?

To reread each RGBTRIPLE in the original scanline and rewrite it n times (to repeat the process of writing the first scanline).

Why can't you just write all the pixels in the row "scale" number of times?

Why cant I just do the "iterate over pixels in scanline" loop "scale" number of times?

Well, you can if you read the RGBTRIPLEs in the original scanline and store them in an array of RGBTRIPLEs, then write each element in that array n times (to resize horizontally) and the whole array n times (to resize vertically). That's just another and probably better approach.

You must log in to answer this question.

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