我打算在 Ubuntu 中使用 x lib 使图像变暗。这是我的代码。
XImage* getCorrectedImage(Pixmap p){
int buflen, i;
XImage* img = XGetImage(g_display, p, 0, 0, g_width, g_height, AllPlanes, ZPixmap);
buflen = img->width * img->height * img->bitmap_pad / 8;
for(i = 0; i < buflen; i++){
img->data[i] /= 2;
}
}
结果图像是这样的:
最佳答案
这是颜色模式的问题。它不是 24 位颜色模式 你必须使用 16 位颜色模式
关于c - 如何在 Linux 中使用 x-window lib 使图像变暗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41396971/