How can I find a pixel position, based in its color, within a bitmapdata?
Say, we have a path drawed (a movieclip), we make it a bitmapdata.
The path´s color is red.
How can I find a given pixel red, within that bitmapdata?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming the pixel you are looking for is a specific color, you would iterate through the BitmapData and compare pixels using
getPixel()orgetPixel32()to test each pixel against your target color. Something like this:Hope this helps!