[comp.windows.x] Determining color at mouse location

denio@beno.CSS.GOV (Dennis O'Neill) (12/10/90)

How would one determine the color index of the pixel under the mouse/sprite
hotspot?  `

I know how to find the x,y coordinates of the sprite location.  I could
figure out the offset into the window array from those, but I'm hoping 
there's a more direct way to determine the color.

Dennis O'Neill
denio@seismo.css.gov

mouse@LARRY.MCRCIM.MCGILL.EDU (12/11/90)

> How would one determine the color index of the pixel under the
> mouse/sprite hotspot?

> I know how to find the x,y coordinates of the sprite location.  I
> could figure out the offset into the window array from those, but I'm
> hoping there's a more direct way to determine the color.

I'm not sure what you mean by the "window array", but you could always
just use XGetImage to read back a 1x1 image.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu