# How to display the same image twice?

**URL:** <https://forum.kirupa.com/t/how-to-display-the-same-image-twice/303222>\
**Category:** flash\
**Created:** [January 16, 2010, 5:55pm UTC](https://forum.kirupa.com/t/how-to-display-the-same-image-twice/303222 "2010-01-16T17:55:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunoja](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@brunoja](https://forum.kirupa.com/u/brunoja)\
**Post date:** [January 16, 2010, 5:55pm UTC](https://forum.kirupa.com/t/how-to-display-the-same-image-twice/303222/1 "2010-01-16T17:55:34Z")

</div>

Hello!

I would like to know how could I display the same image I loaded (with Loader) twice on the screen. AddChild dont accept repeated instances, what should I do? Copy the Image? Wont that be slow?  
What if I have the GIFPlayer class, I loaded a gif with it, I want to add it twice on the screen, loading more than once could be slow! What should I do?

I searched and found that for Bitmaps I can do this:

```auto

        public function duplicateImage(target:Bitmap):Bitmap
        {
            var bitmapCopy:Bitmap = new Bitmap(target.bitmapData);
            return bitmapCopy;
        }

```

But I didnt tested it to see if its fast enought to create when the game is running.

With gifs, I found a solution, to use the GIFPlayer.loadBytes(), so it will create another GIFPlayer. BUT, if I do this while the game is playing I notice that it is slow, my game hangs when it creates a “copy” when dealing with larger gifs.

I dont know how to solve this, I cant add the same object instance twice to the display list. I was used to program in C, using SDL. There was a function that draws things to screen using a reference to the bitmap data, so I could draw thousands of the same images on the screen with only one bitmap instace 😕

The GIFPlayer I got from here: [http://www.bytearray.org/?p=95](http://www.bytearray.org/?p=95)

Anyway to solve this? Thank you 😛
