解决方案 »

  1.   

    api的我不清楚。不过你可以获取像素点自己控制void Filter::discoloration(int *pBuffer,int* pFill,int width,int height,int threshold,int topColor,int bottomColor)
    {
    int count = 0;
    int preColor = 0;
    int prepreColor = 0;
    int color = 0;
    preColor = pBuffer[0]; int i = 0;
    int j = 0;
    int iPixel = 0;
    for (i = 0; i < width; i++) {
    for (j = 0; j < height; j++) {
    int curr_color = pBuffer[j * width + i]; int avg = (red(curr_color) + green(curr_color) + blue(curr_color))
    / 3;
    if (avg >= threshold) {
    iPixel = topColor;
    } else {
    iPixel = bottomColor;
    } pFill[j * width + i] = iPixel;
    }
    }
    }