ReadImage. Create (infoHeader. BiWidth, infoHeader. BiHeight, infoHeader biBitCount, 0).
The FILE * fpIn=fopen (strFilePath, "rb");
BYTE * img=new BYTE [giall];
Fseek (fpIn, fileHeader. BfOffBits SEEK_SET);
Fread (img, sizeof (BYTE), giall, fpIn);
Int r, g, b, avg;
for (int i=0; i
{
R=(int) img [3 * (infoHeader. BiHeight - 1 - j) * infoHeader biWidth + 3 * I];
G=(int) img [3 * (infoHeader. BiHeight - 1 - j) * infoHeader biWidth + 3 * I + 1);
B=(int) img [3 * (infoHeader. BiHeight - 1 - j) * infoHeader biWidth + I + 3 * 2];
Avg=(r + g + b)/3;
If (avg & gt; 70)
{
Avg=255;
}
The else
{
Avg=0;
}
ReadImage. SetPixelRGB (I, infoHeader. BiHeight - 1 - j, avg, avg, avg);
/* * (pRealData pit + I + j * * BPP)=avg.
* (pRealData pit + I + j * * BPP + 1)=avg.
* (pRealData pit + I + j * * BPP + 2)=avg. */
}
ReadImage. Save (strFilePath1);
ReadImage. Destroy ();