[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> Display* display = \
XOpenDisplay(NULL);<br> Window root = \
DefaultRootWindow(display);<br> XWindowAttributes attributes = \
{0};<br> XGetWindowAttributes(display, root, \
&attributes);<br> int width, height;<br> \
width = attributes.width;<br> height = \
attributes.height;<br> XImage* img = XGetImage(display, root, 0, 0 \
, width, height, AllPlanes, ZPixmap);<br> ...<br> \
XDestroyImage(img);<br> 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