xcb_shm_get_image 在 Xlib 中等效

xcb_shm_get_image equivalent in Xlib

我目前正在将程序从 XCB 移植到 XLib*。现在我知道 XServer 的图像是通过 xcb_shm_get_image 获取的。给定 xywidthheight 参数,xcb_shm_get_image 可以选择定义要抓取的图像部分。有没有办法用 XShmGetImage 实现同样的效果?

*XCB 在当前的 debian 稳定版中有一个 Bug,它无法满足我的需求。

Bool XShmGetImage(
    register Display *dpy,
    Drawable d,
    XImage *image,
    int x, int y,
    unsigned long plane_mask);

使用 XShmGetImage() 指定 x & y 作为函数的参数,并且 height width 取自您传递的 image 作为将像素复制到的目的地。