2017년 4월 6일 목요일

How to pick the pixel value using cursor?


I am coding with app inventor to extract the gray value of an image at the position of the cursor. I found there is no output for the image module to output the gray values. Any one can give me some clue? 

--
I'm not sure, if I understand what you are asking...
but the canvas has a method to ge the pixel color and background pixel color


number GetBackgroundPixelColor(number x, number y)
Gets the color of the specified point. This includes the background and any drawn points, lines, or circles but not sprites.
number GetPixelColor(number x, number y)
Gets the color of the specified point.

--
I think he's asking how to change a photo to grayscale, and then extract the "gray" value of a specific pixel.

If so, that's not possible with AI.

--
Thank Enis and Taifun for the kind reply. 

Yes. Inspired by Taifun's reply, I tried it in the following way:
1. load the image to the background of the canvas.
2. Use the method in canvas for pixel color extraction.

I suppose the pixel color to be a 3-d vector, but actually it is a number. Anyway, this way it works. I need to find out what the output number really mean and how is it associated with the RGB values.

--

댓글 없음:

댓글 쓰기