Hi all

This is my c++ code which I use to capture screen:
    Display* display = XOpenDisplay(NULL);
    Window root = DefaultRootWindow(display);
    XWindowAttributes attributes = {0};
    XGetWindowAttributes(display, root, &attributes);
    int width, height;
    width = attributes.width;
    height = attributes.height;
    XImage* img = XGetImage(display, root, 0, 0 , width, height, AllPlanes, 
ZPixmap);
    ...
    XDestroyImage(img);
    XCloseDisplay(display);

When I run it without Xvfb I get a normal screen picture. However, when I use 
it in Xvfb is not not normal. For example I tried to capture youtube in firefox 
as a result I see some green/blue image with you tube pieces.

This question was asked on stackoverflow  
http://stackoverflow.com/questions/42110050/xlib-and-xvfb-capture-screen
and there can be seen the result image.

How to fix it?


-- 
Alex Sviridov
_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Reply via email to