[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    =?UTF-8?B?WExpYiBhbmQgWHZmYjogY2FwdHVyZSBzY3JlZW4=?=
From:       Alex Sviridov <ooo_saturn7 () mail ! ru>
Date:       2017-02-08 10:16:18
Message-ID: 1486548978.598755194 () f341 ! i ! mail ! ru
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

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


[Attachment #5 (text/html)]


<HTML><BODY>Hi all<br><br>This is my c++ code which I use to capture \
screen:<br>&nbsp;&nbsp;&nbsp; Display* display = \
XOpenDisplay(NULL);<br>&nbsp;&nbsp;&nbsp; Window root = \
DefaultRootWindow(display);<br>&nbsp;&nbsp;&nbsp; XWindowAttributes attributes = \
{0};<br>&nbsp;&nbsp;&nbsp; XGetWindowAttributes(display, root, \
&amp;attributes);<br>&nbsp;&nbsp;&nbsp; int width, height;<br>&nbsp;&nbsp;&nbsp; \
width = attributes.width;<br>&nbsp;&nbsp;&nbsp; height = \
attributes.height;<br>&nbsp;&nbsp;&nbsp; XImage* img = XGetImage(display, root, 0, 0 \
, width, height, AllPlanes, ZPixmap);<br>&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp; \
XDestroyImage(img);<br>&nbsp;&nbsp;&nbsp; XCloseDisplay(display);<br><br>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.<br><br>This question was asked on \
stackoverflow <a href="http://stackoverflow.com/questions/42110050/xlib-and-xvfb-capture-screen" \
data-mce-href="http://stackoverflow.com/questions/42110050/xlib-and-xvfb-capture-screen">http://stackoverflow.com/questions/42110050/xlib-and-xvfb-capture-screen</a> \
<br>and there can be seen the result image.<br><br>How to fix it?<br><br><br>-- \
<br>Alex Sviridov</BODY></HTML>


[Attachment #6 (text/plain)]

_______________________________________________
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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic