Pixel Question

Bob Warren bobwarren at howsoft.com
Thu Mar 23 15:44:28 EST 2006

JB wrote:

 >Hi Bob,

 >> Dear All,
 >> Suppose I have 2 cards in a stack and I am moving the mouse over the top
 >> card (naturally). I want to know what colour is under the mouse pointer
 >> in a corresponding position on the 2nd card which is hidden underneath.
 >> I have tried, but so far without success. Any ideas anyone?

 >Here's something I would try (I don't have the time right now though) :
 >- make a screenshot of the card underneath so that in can be imported
 >inside an image object (hidden if necessary)
 >- get the mouse location (x,y coordinates)
 >- then compute the pixel value of the image using the imagedata >property


Thanks JB!

I have little doubt that the method would work, even without trying it.
I also thought of using imagedata, but I was hoping for a less 
cumbersome solution. It's the "compute" bit that might take up a bit of 
CP time, especially if some mad hatter like me makes the mouse go 
whizzing around the screen! But I see no other alternative at the 
moment, and after all, the proof of the pudding is in the eating, so 
I'll give it a try in practice.

Thanks again, and also to Richard and (wide-awake) Klaus!

Regards to all,

More information about the Use-livecode mailing list