If you want to be an expert in GDI programming, read my book.For your problem, there are two steps: find a good quality color table and then dither the true color image to 8-bpp image. For the first part, octree color quantization is a good algorithm. For the second part, you can use error diffusion. Of course, you can just use GDI directly with an halftone palette, but quality is not the best.Check source code from my book (http://safariexamples.informit.com/0130869856/).Here is some related screen captures http://www.fengyuan.com/sample/samplech13.html.www.fengyuan.com
bih.biBitCount=16; bih.biClrImportant=0; bih.biClrUsed=0; bih.biCompression=0; bih.biHeight=btm.bmHeight; bih.biPlanes=1; bih.biSize=sizeof(BITMAPINFOHEADER); bih.biSizeImage=size; bih.biWidth=btm.bmWidth; bih.biXPelsPerMeter=0; bih.biYPelsPerMeter=0;
改了写可是还有问题。
to;yang 104,你的方法你实践过了吗,有没有代码那出来探讨一下了