color probe (at a point)

Jan Schenkel janschenkel at yahoo.com
Fri Jul 29 12:25:58 EDT 2005


--- Ronald Swartz <tetraron at comcast.net> wrote:
> How would one determine (or return) the color at a
> point on the screen, 
> under script control of course.  I would like it to
> be something like:
> 
> get the tcolor at 340,230      (where I just made up
> the name "tcolor.")
> 
> Is there any easy way to do this.  I am working on
> something which 
> requires me to poll the points in the neighborhood
> of a screen point 
> and cannot see anything in revolution which would
> provide that tool.  
> Help would be appreciated.
> 
> Ron Swartz
> 

Hi Ron,

You can use the 'mouseColor' function to determine the
color under the current mouse location. The trick is
to change the mouse location to the intended point,
grab the color and restore the mouse location.

Try the following:
--
on mouseUp
  put the screenMouseLoc into tSavedLoc
  set the screenMouseLoc to 20,20
  put the mouseColor into tColor
  set the screenMouseLoc to tSavedLoc
  answer tColor
end mouseUp
--

Hope this helped,

Jan Schenkel.

Quartam - Tools for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 



More information about the use-livecode mailing list