# Visual Studio 2010 - Gif Image Loading



## yoshi1476 (Oct 2, 2008)

I recently started working on a calculator for the game Wonderking and was wanting to display .gif images of the monsters when they were selected from a listbox. I am using c++.

However using

```
this->PictureBox1->ImageLocation = ("C:/image.gif")
```
 results in it showing a red x (Image Error Symbol). By selecting an image through the picturebox properties in the form designer the image will show but I can't change it after that.

Any help is greatly appreciated,


----------



## yoshi1476 (Oct 2, 2008)

I just had another look and found that this is printed in the debugger output everytime I select a listbox item with a picture to display:


```
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
```
I have tried using Resources and different file types but all end up showing a red x.


----------



## Swen (Apr 9, 2010)

Try resaving the .gif image to a .jpg then try again..


----------

