# (Delete) Any Image Created Through Clicks

**URL:** <https://discourse.processing.org/t/delete-any-image-created-through-clicks/25867>\
**Category:** Coding Questions\
**Created:** [December 1, 2020, 5:13pm UTC](https://discourse.processing.org/t/delete-any-image-created-through-clicks/25867 "2020-12-01T17:13:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matrix](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Matrix](https://discourse.processing.org/u/Matrix)\
**Post date:** [December 1, 2020, 5:13pm UTC](https://discourse.processing.org/t/delete-any-image-created-through-clicks/25867/1 "2020-12-01T17:13:47Z")

</div>

Hi, I’m trying to create a program that makes it so every new click reveals a rectangle in a specific region. When all of the clicks are done, then all the rectangles will be revealed- showing an image. Basically pixel art. I’m not sure what function I would use to have each click create a rectangle in just that specific area. This is the code that I’ve done so far, but I’m stumped with the floating function.

```auto

void setup() {
  size(500,400);
  background(0);
}

void draw() {
  if (mousePressed) {
    stroke(10);
    fill((255),(255),(255));

```

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 1, 2020, 7:16pm UTC](https://discourse.processing.org/t/delete-any-image-created-through-clicks/25867/2 "2020-12-01T19:16:09Z")

</div>

Hi, @Matrix Please edit your code above by selecting it and pressing the \</\> button.  
You can use the flexable PVector ArrayList for that, storing the mouseX and mouseY values in it.  
like:  
` ArrayList <PVector> mouseClicks = new ArrayList<PVector>();`  
The when you are done, press a key and draw the rectangles on the canvas.  
See PVector and ArrayList

> **[ArrayList \\ Language (API) \\ Processing 3+](https://processing.org/reference/ArrayList.html)**

  

> **[PVector \\ Language (API) \\ Processing 3+](https://processing.org/reference/PVector.html)**
