get the color of this card at x,y
sanke at hrz.uni-kassel.de
Fri Nov 20 04:24:23 CST 2009
"Bill Marriott" <wjm at wjm.org> wrote:
> That code didn't work for me ... Probably need something more like,
> lock screen
> put the screenmouseLoc into coord
> set the screenmouseLoc to 350,350
> put the mousecolor
> set the screenmouseLoc to coord
> unlock screen
> Alternately, one can export snapshot consisting of a single pixel and
> its contents.
> Wilhelm Sanke wrote"
> >> >> get the color of this card at x,y
> >> >> and I would expect it to contain r,g,b
> > >
> > > "click at x,y
> > > put the mousecolor"
You are right.
My test here was too quick, but the two-liner worked for me, because the
point I had chosen for the test was inside an image whose script
contained "put the mousecolor", as I now found out.
For your solution I would recommend to add "globalloc()" to easier
access points on the card, like
"put 545,410 into tloc
put the screenmouseLoc into coord
set the screenmouseLoc to globalloc(tloc)
put the mousecolor
set the screenmouseLoc to coord
More information about the use-livecode