转换成BMP,设置pixelformat即可,然后转换回来即可。

解决方案 »

  1.   

    jpg图片载入后还得送入TBitmap进行处理,给你一段C++Builder的源程序,你自己改吧:
    (这儿处理完是24位位图)// 灰化
    void __stdcall Gray(Graphics::TBitmap *Bitmap) {
            if(Bitmap->PixelFormat!=pf24bit) {
                    Bitmap->PixelFormat = pf24bit;
            }
            for(int j=0; j<Bitmap->Height; j++) {
                    Byte *ptr = (Byte *)Bitmap->ScanLine[j];
                    for(int i=0; i<Bitmap->Width*3; i+=3) {
                            int gray = (int)ptr[i]*0.114+(int)ptr[i+1]*0.587+(int)ptr[i+2]*0.299;
                            if(gray>255) {
                                    gray = 255;
                            }
                            ptr[i] = (Byte)gray;
                            ptr[i+1] = (Byte)gray;
                            ptr[i+2] = (Byte)gray;
                    }
            }
    }
      

  2.   

    to ->Kingron(戒网中……) 
      能不能简单的写一句做为例子让小弟看一下。
      

  3.   

    听说Image组件有个属性可以设为黑白,请问那位高手知道.
      

  4.   

    是变成灰度图象,还是2值图象
    结果可是大大了不一样呀
    如果是后者,把Transparent设成true就行了