I only want a method to activate if the pixel that is clicked is white. How would I implement this? Trying to look for a method that returns the colour at a coord, but I can’t find one.
Share
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.
Depends. If you have got a BufferedImage (or some other Image) you can use its
getRGBmethods (orgetRaster().getPixel). If you haven’t, you can use JPanel’screateImagemethods and use the returned image to get the pixel data.