I am trying to edit a BMP file in C. My code works for BMP files with no padding but I am having trouble dealing with padding.
There are a few other questions on BMP
Something like:
... int originalLineSize = width * 3; int workLineSize = originalLineSize + 4 - originalLineSize % 4; for (int a = 0; a < bmpArraySize; ++a) { if ((a % workLineSize) >= originalLineSize) bmpArray[a] = 0x00; } else if (bmpArray[a] < 127) { bmpArray[a] = 0; ... }