I tried to convert a gray-scale bitmap to black-and-white bitmap. For that purpose i tried with the following code.
I expected that the reformed bitmap has been changed. But I failed. I knew and i debugged that the grayscale bitmap has 8bpp. i loaded the image using EGray256 displaymode. You can see that the changed bitmap is actually remaining Gray256 (though it should show only b&w i.e 255 and 0). If it is, then it is okay for me. If i can compress to only one bit per pixel then it is even better. Do you have any suggestion ? For your kind information, when loading the bitmap I can't use EGray2 because it does halftoning, which i don't want. So I am loading with EGray256 and changing it to b&w by myself.
int h = bitmap->SizeInPixels().iHeight;
int w = bitmap->SizeInPixels().iWidth;
for(int r = 0; r < h; r++)
for(int c = 0; c < w; c++)
TPoint p = TPoint(c, r);
if(rgbVal.Gray256() > 155)