Skip to content

Instantly share code, notes, and snippets.

// determine padding for scanlines
int old_padding = (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4;
float newbiWidth = newbi.biWidth; //make new width a float
newbiWidth *= nn; //get downsize number
newbiWidth = round(newbiWidth); //round downsize number
int inewbiWidth = newbiWidth;
int horizontal_pixels = round(bi.biWidth/newbiWidth);