Question: I am developing a windows form application. At one of my form i place a picture box control. 
Its working fine for majority of time. But sometime it displays red cross rather than displaying actual picture.

I further explore this and came to know that this control handle exceptions internally. So i go to `Debug->Exceptions` and Check the relevant `thrown` boxes. Then i found that the red box is display due to following error:

```
A first chance exception of type 'System.OutOfMemoryException' occurred in System.Drawing.dll

Additional information: Out of memory.

```

Could any body suggest me how to deal with this exception?

Answer: 
As pair to you comment that you are using multiple images in the `PictureBox`, You should "like @Jason suggested" *dispose* the old image before applying the new one, like:

```
private void ChangePictureBoxImage(Image image)
{
    pictureBox.Image.Dispose();//dispose the old image.

    pictureBox.Image = image;
}

```
How much RAM does your target machine have?

You got this exception because the call to allocate more memory for the image failed. If you are unable to increase the amount of memory on your computer, try reducing the image's size or close any other programs you have running.