Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!ames!ucbcad!zen!ucbvax!blackstone.UUCP!dargiro
From: dargiro@blackstone.UUCP (Danielle Argiro-S)
Newsgroups: comp.windows.x
Subject: Problems with XGetImage
Message-ID: <8712092242.AA00177@blackstone>
Date: 9 Dec 87 22:42:25 GMT
Sender: usenet@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 66



  Hello - 

  I am currently in the process of converting our plot package 
  (written originally under X10.4) to X11.  I am having major
  problems using XGetImage and I was hoping you could help me,
  since I am totally out of ideas.

  Here is the scenario:  I need to get a dump of the displayed
  window in order to enable laser printer capabilities.  Previously,
  I was using XPixmapGetXY and XPixmapGetZ to dump the window information,
  and then I was converting the information (bytes and shorts, respectively)
  into the type I needed (bits).  This worked fine.

  Under X11, in the "X11 diffs" document, it says that if you were using
  XPixmapGetXY or XPixmapGetZ, you should now use XGetImage with the
  format = XYPixmap or format = ZPixmap.

  So this is what I did:

  XImage *window_image;
  int    x, y;
  unsigned int width, height;
  etc.

  here is the call:

  window_image = XGetImage(DSP_str, workspace, x, y, width, height,
                           plane_mask, format);

  where:
         1) DSP_str is the display pointer, the same global one that's used
          everywhere else and works fine.

         2) workspace is the Window that I'm using 
            (also works fine everyplace else)

         3) x and y are ints, both equal to 32.
 
         4) width and height are unsigned ints, both equal to 512.

         5) the plane_mask is tricky.  I've tried 0xffff, AllPlanes,
            1L, 0L, and everything else I could think of.

         6) for format, I've been sending either XYPixmap or ZPixmap

  
    It seems that no matter *what* I do, it comes back with an X ERROR
  message about "mismatched parameters" just before it crashes.  I suspect
  it may well be the plane_mask that is the problem, but I don't know what
  to use!  

    Regardless of whether or not I am sending the proper plane_mask
  for the results I'm expecting, I should at least get the structure
  that I'm asking for (even if the information in it is not quite what I
  had in mind) instead of a crash.


  PLEASE  if you can help me in any way it would be VERY MUCH appreciated!

  ALL our laser-output capabilities hang on this one call.

  thank you *so much* for your time!

  Danielle Argiro - UNM EECE Dept.