[winGRASS] XGetImage/XPutImage in libG11.

Mike Thomas miketh at brisbane.paradigmgeo.com
Thu Dec 6 00:39:50 EST 2001


Hi all.

I have just checked into CVS some new work on the XPut/GetImage() problem
for libG11, which is designed to support the Panel save and restore code
used extensively in, for example,  "i.points".

Panel save and restore don't work yet, although the program no longer
crashes as it did when XGetImage() returned NULL.

Outstanding bugs can be seen by running "i.points" and

1. Watching the twin horizontal lines across the center of the monitor,
which on my computer at least, end up displaced upwards by a small amount
after the panel is replaced.

2. Using the zoom/point menu, which seems to cause random images to appear
when the panel is restored - sometimes black, sometimes fragments of the
image.

3. Looking at the code for XPutImage() in "xlib.c", the call to
SetDIBitsToDevice{} needs the source "y" value set to the top left rather
than the bottom left corner of the incoming image in order to get some
semblance of the saved panel to reappear - otherwise, if set to "sy +
height -1" as it used to be, rather than "sy" as currently checked in, you
get a white background (possibly a refresh problem?).

4. Resizing the XDriver during "i.points" hangs both the display and the
Grass shell.  Is this true on Unix too?

I believe that I am missing something about which location the images should
be written to (point 3 above), and their orientation (bottom left vs top
left).

I have checked that one image obtained by XGetImage() and passed through
panel save and restore, finally arriving at XPutImage() is preserved through
those steps exactly - so the display writing phase with SetDIBitsToDevice{}
is definitely going wrong.  It may be, of course, that other images are not
preserved.

Cheers

Mike Thomas





More information about the grass-windows mailing list