Hi,
Like the title says, I want to take a screenshot of a window application running under wine. Not the entire desktop. C would be preferred but could also use java or Pascal.
Thanks in advance
Hi,
Like the title says, I want to take a screenshot of a window application running under wine. Not the entire desktop. C would be preferred but could also use java or Pascal.
Thanks in advance
Use imagemagick's import command to grab the window and dump it to a file...
Wrap the call in a C system command
system("import -window (your window name) capture.png").
Then you can access the image from the file using any of the standard image loading libraries.
A possible way with the Linux shell:
Example with wine:
import -window `xwininfo -root -children | grep "Wine" | awk '{print $1}'` outfile.pcx
You could duplicate the functionality of ImageMagick's import command using MagickWand (C API) or Magick++ (C++ API), but calling import directly via system() as suggested by justinhj is likely the simplest approach if you don't mind distributing import with your software.