color probe (at a point)

Lynch, Jonathan bnz2 at cdc.gov
Fri Jul 29 14:02:05 EDT 2005


Here is a function that will do this for you:

function pointcolor pPoint
  put item 1 of pPoint into tL
  put item 2 of pPoint into tT
  put tL + 10 into tR
  put tT +10 into tB
  put tL,tT,tR,tB into tRect
  export snapshot from rect tRect to tImage as GIF
  put "myImage" & the milliseconds into tMyImage
  create invisible image tMyImage
  set the width of image tMyImage to 10
  set the height of image tMyImage to 10
  put tImage into image tMyImage
  put the imagedata of image tMyImage into tData
  delete image tMyImage
  put chartonum(char 2 of tData),chartonum(char 3 of
tData),chartonum(char 4 of tData) into tColor
  return tColor  
end pointcolor

-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Ronald
Swartz
Sent: Friday, July 29, 2005 12:15 PM
To: use-revolution at lists.runrev.com
Subject: color probe (at a point)

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
tetraron at comcast.net

_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list