finding the mousecolor in IOS

Howard Bornstein bornstein at designeq.com
Fri Jul 13 15:11:19 EDT 2012


On Fri, Jul 13, 2012 at 6:11 AM, Colin Holgate <coiin at verizon.net> wrote:

> One exercise in that book I wrote is about using an image as a color
> picker. It uses the same technique as Scott mentioned, only I then set the
> color of another graphic to show that it has picked up the right color.
>

That's exactly what I'm doing. I'm using the color picker to set the color
of text, modifying the text color in real time as the user moves around the
color wheel by touch. Can you give more information about the book you
wrote? It sounds interesting.

One thing to double check, the x and y values you're using, are those from
> the top left of the image? With mousecolor you use the card position, but
> with this imagedata technique you would subtract the left and top of the
> image in question, unless the image is the whole card.
>

I'm assuming Scott's technique does this. His description is: "This should
retrieve the color of a pixel in a target image based on the X,Y offset of
the touch from the topLeft."

I've been busy with other things and haven't been able to check to make
sure I haven't done something dumb with his code, but I've been assuming
that is how this works.

-- 
Regards,

Howard Bornstein
-----------------------
www.designeq.com



More information about the use-livecode mailing list