Still working on this... headers are fine as no matter what I put in as factor the header files match with the staff implementation. Now I'm getting a square of the right size but only the top half is green. Here is the part of my code where I'm reading the pixels and printing them out... I'm so close, but clueless.
// iterate over infile's scanlines
for (int i = 0, biHeight = abs(bi.biHeight); i < biHeight; i++)
{
// iterate over pixels in scanline
for (int j = 0; j <= bi.biWidth; j++)
{
// temporary storage
RGBTRIPLE triple;
// read RGB triple from infile
fread(&triple, sizeof(RGBTRIPLE), 1, inptr);
// write RGB triple to outfile
for (int y = 0; y <= number; y++)
{
fwrite(&triple, sizeof(RGBTRIPLE), 1, outptr);
fseek(inptr, bi.biWidth * sizeof(RGBTRIPLE), SEEK_CUR);
}
// skip over padding, if any
fseek(inptr, padding, SEEK_CUR);
// Add a new padding
for (int l = 0; l < out_padding; l++)
fputc(0x00, outptr);
// Return to the beginning of a scanline
fseek(inptr, -(bi.biWidth * sizeof(RGBTRIPLE) + padding), SEEK_CUR);
}
}