A
A
andrejfomenko2017-08-17 16:58:45
C++ / C#
andrejfomenko, 2017-08-17 16:58:45

How to take a screenshot of a third party application window in ubuntu?

hello, rummaged through a bunch of codes on the net, I need to take a screenshot of a window in ubuntu OS. it was decided to take c++. I am very new to c++ as well as to ubuntu. I searched and tried the code for a long time, but it did not work out. At the moment, I have found and am inclined to install imagemagick and call the console with the imort command in my program, then I have a question

To take a screenshot of only a specific window, you need to specify either the window id or the title.
import -window [email protected]:~ screenshot.jpg

How can I find out the id of the window or can I do it from the title part, just the final part contains Cyrillic?
PS Before that, I wrote in c# there using the handle, and with the help of third-party utilities like windows hack 3.0 and the like, it was possible to find out everything about the window and elements,
or is it possible to somehow implement this programmatically (take a screenshot of the window)? all that I found more or less clear is the use of winapi

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Derevyanko Alexander, 2017-08-17
@andrejfomenko

run the desired application and press the Ptr Sc / Sys Rq key, that's all :-)
But if you need it DIFFICULT, then ncurses is very good at window output to the terminal in Linux. There are a lot of things there. Read here link
And here it’s so simple super painted link

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question