magick++, import XWindow

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

You can read an image from a X window with X coder. From the command line:
  • convert x:mywindow window.png
where mywindow is the window name or hex identified. From Magick++, just do a Read() with x:mywindow as the file name.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Hexcode is the window id, for example,
  • convert x:0x1a0001f window.png
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Grabbing X windows can be quite complex because the windows are stored in a tree structure and to ensure you are getting a proper image you must composite the entire tree structure onto an image canvas. However, if you are sure your image can be obtained directly from the screen, you can short cut this process. From the command line, the import program uses the -screen option to quickly grab an image from the root window. Unfortunately, there is no way to set this option from Magick++ at this time. If the option is set, ImageMagick would meet or exceed the imlib times. In the next point release, we'll add an image option settable with the defineValue("x","screen","true") method to grab the image from the screen rather than compositing the entire X11 tree structure.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

You can expect the next point release yesterday. The patch is in, not sure if the change made it to the ChangeLog just yet. Download/install ImageMagick 6.2.6-3.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

For now, grab the 6.2.6-3 release version and replace coders/psd.c with the version in 6.2.6-4 Beta. We are aware of the 6.2.4-4 Beta build problem and will of course have it fixed before a public release.
Post Reply