如题!
请教

解决方案 »

  1.   

    我就知道CCS中图像处理中滤镜可以做到一张图片出两种效果。
      

  2.   

    很简单,GDI+的色彩变换能实现
      

  3.   

    void MakeBlackAndwhite(CImage* image)
    {
    if (image->IsNull()) 
    return; if (!image->IsIndexed()) 
    {
    //直接修改像素颜色
    COLORREF pixel;
    int maxY = image->GetHeight(), maxX = image->GetWidth();
    byte r,g,b,avg;
    for (int x=0; x<maxX; x++) 
    {
    for (int y=0; y<maxY; y++) 
    {
    pixel = image->GetPixel(x,y);
    r = GetRValue(pixel);
    g = GetGValue(pixel);
    b = GetBValue(pixel);
    avg = (int)((r + g + b)/3);
    image->SetPixelRGB(x,y,avg,avg,avg);
    }
    }

    else 
    {
    // 获取并修改颜色表
    int MaxColors = image->GetMaxColorTableEntries();
    RGBQUAD* ColorTable;
    ColorTable = new RGBQUAD[MaxColors];
    image->GetColorTable(0,MaxColors,ColorTable);
    for (int i=0; i<MaxColors; i++)
    {
    int avg = (ColorTable[i].rgbBlue + ColorTable[i].rgbGreen + ColorTable[i].rgbRed)/3;
    ColorTable[i].rgbBlue = avg;
    ColorTable[i].rgbGreen = avg;
    ColorTable[i].rgbRed = avg;
    }
    image->SetColorTable(0,MaxColors,ColorTable);
    delete[] ColorTable;
    }
    }我找到答案了,用一套图片就行了
    使用CImage来实现