# Problem with inserting an image array

**URL:** <https://discourse.processing.org/t/problem-with-inserting-an-image-array/22164>\
**Category:** Coding Questions\
**Created:** [June 25, 2020, 4:10pm UTC](https://discourse.processing.org/t/problem-with-inserting-an-image-array/22164 "2020-06-25T16:10:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marika20](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@marika20](https://discourse.processing.org/u/marika20)\
**Post date:** [June 25, 2020, 4:10pm UTC](https://discourse.processing.org/t/problem-with-inserting-an-image-array/22164/1 "2020-06-25T16:10:03Z")

</div>

Hi everyone, one question:  
if I have an array of images, for example  
PImage [] dogs = new PImage [4]  
then inserting each image:  
dogsOne = loadImage ("");

then when I have to insert my images in image (… 0,0,100,100);  
how do I insert the array?

Why I tried to insert it by putting = dogs but it says “impossible to insert array”

Thank you

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 25, 2020, 4:23pm UTC](https://discourse.processing.org/t/problem-with-inserting-an-image-array/22164/2 "2020-06-25T16:23:51Z")

</div>

**before setup()**

` PImage [] dogs = new PImage [4];`

**in `setup()`:**

```auto
dogs[0] = loadImage ("test1.jpg");
dogs[1] = loadImage ("test2.jpg");
dogs[2] = loadImage ("test3.jpg");
dogs[3] = loadImage ("test4.jpg");

```

**Display an image in draw()**

in draw() or anywhere `image(dogs[0], 30,30);`

Chrisir

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 25, 2020, 7:03pm UTC](https://discourse.processing.org/t/problem-with-inserting-an-image-array/22164/3 "2020-06-25T19:03:49Z")

</div>

for example when you have an image array for the levels

image(dogs[levelNumber], 33,33);

---

<div class="post-metadata">

**Author:** ![marika20](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@marika20](https://discourse.processing.org/u/marika20)\
**Post date:** [June 26, 2020, 8:50am UTC](https://discourse.processing.org/t/problem-with-inserting-an-image-array/22164/4 "2020-06-26T08:50:40Z")

</div>

thank u 🙂
