0

outbf = bf; outbi = bi;

outbi.biWidth = n*bi.biWidth;
outbi.biHeight =n* bi.biHeight;

// determine padding for scanlines
int padding = (4 - (outbi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4;
int padding1 = (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4;

outbi.biSizeImage = ((sizeof(RGBTRIPLE)*outbi.biWidth) + sizeof(padding))*abs(outbi.biHeight);

outbf.bfSize =outbi.biSizeImage + 54;
0

sizeof(padding) does not give you the number of bytes of padding, it gives you the size of the variable type.

try adding just padding

You must log in to answer this question.

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