// This layout (ABGR) works empirically
pixels[y*w + x] = (alpha<<24)|(blue<<16)|(green<<8)|red;
}
}
X11.XWindowAttributes xwa = new X11.XWindowAttributes();
x11.XGetWindowAttributes(dpy, win, xwa);
X11.XImage image =
x11.XCreateImage(dpy, xwa.visual, 32, X11.ZPixmap,
0, buffer, w, h, 32, w * 4);
buffer.write(0, pixels, 0, pixels.length);
offset.x += bounds.x;