Skip to main content
added more IDisposable stuff.
Source Link
Jesse C. Slicer
  • 14.2k
  • 1
  • 39
  • 52

Image also implements IDisposable, therefore wrap in using:

using (Image background = downloadBackground(URL + getResolutionExtension()))
{
    saveBackground(background);
    setBackground(background, PicturePosition.Fill);
}

Ok, more info: Image may utilize a sizable amount of memory, depending on the image, so executing deterministic disposal of those resources is incumbent upon the developer in order to ensure best application behavior. Read here for additional information.

Image also implements IDisposable, therefore wrap in using:

using (Image background = downloadBackground(URL + getResolutionExtension()))
{
    saveBackground(background);
    setBackground(background, PicturePosition.Fill);
}

Image also implements IDisposable, therefore wrap in using:

using (Image background = downloadBackground(URL + getResolutionExtension()))
{
    saveBackground(background);
    setBackground(background, PicturePosition.Fill);
}

Ok, more info: Image may utilize a sizable amount of memory, depending on the image, so executing deterministic disposal of those resources is incumbent upon the developer in order to ensure best application behavior. Read here for additional information.

Source Link
Jesse C. Slicer
  • 14.2k
  • 1
  • 39
  • 52

Image also implements IDisposable, therefore wrap in using:

using (Image background = downloadBackground(URL + getResolutionExtension()))
{
    saveBackground(background);
    setBackground(background, PicturePosition.Fill);
}