# Why can't use mouseX in pixels processing

**URL:** <https://discourse.processing.org/t/why-cant-use-mousex-in-pixels-processing/17926>\
**Category:** Coding Questions\
**Created:** [February 19, 2020, 6:05am UTC](https://discourse.processing.org/t/why-cant-use-mousex-in-pixels-processing/17926 "2020-02-19T06:05:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fang1](https://avatars.discourse-cdn.com/v4/letter/f/e9a140/32.png) [@fang1](https://discourse.processing.org/u/fang1)\
**Post date:** [February 19, 2020, 6:05am UTC](https://discourse.processing.org/t/why-cant-use-mousex-in-pixels-processing/17926/1 "2020-02-19T06:05:42Z")

</div>

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 link](http://learningprocessing.com/examples/chp15/example-15-09-FlashLight)in 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!!!

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [February 19, 2020, 3:12pm UTC](https://discourse.processing.org/t/why-cant-use-mousex-in-pixels-processing/17926/2 "2020-02-19T15:12:24Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![fang1](https://avatars.discourse-cdn.com/v4/letter/f/e9a140/32.png) [@fang1](https://discourse.processing.org/u/fang1)\
**Post date:** [February 20, 2020, 2:39am UTC](https://discourse.processing.org/t/why-cant-use-mousex-in-pixels-processing/17926/3 "2020-02-20T02:39:07Z")

</div>

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! 😃
