hello,guys! I’m sorry to borther you a little time about the problem I meeting in using mouseX,mouseY in loops of pixels location array.I find a code linkin this situation can run,but it doesn’t work on my processing software(I’m sure I add other parts of code needed,when I change mouseX to float type number,it can run).Does it cause by different versions?
thanks a lot!!!
1 Like
Ideally, post your code.
Remember, pixels is an array of integers and mouseX and mouseY are the coordinates of the mouse in the surface of Processing.
The example you posted works because the dimensions of image and the dimensions of the surface are the same, so it makes sense to access the pixel underneath the mouse cursor with mouseX
and mouseY
.
1 Like
It works!My picture’s size is bigger than the canvas,so processing can’t find other excess pixels.I really appreciate you taking time to help!