Re: XForms: getting the color at a specific location

Steve Lamont (spl@szechuan.ucsd.edu)
Tue, 3 Feb 98 07:45:41 PST

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> Is there a way to get the color (pixel value...) of a specific location
> in the free object (determined by its x and y coordinates) ?

There's no XForms function to do this and, in fact, there's really no
X function to do this directly as far as I can tell.

This is kind of a hack but you can use one of the appropriate
fl_get_*_mouse() functions and then, having the location of the
cursor, get a 1x1 subimage containing the pixel with XGetSubImage(),
use XGetPixel() to get the actual pixel value, and then, if you're in
a PseudoColor Visual, do the inverse translation from LUT index to
actual RGB triplet.

My head hurts just thinking about it.

spl

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bloch.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/