When it comes to photographs in WPF, it's safe to assume that a photograph is a bitmap, and you would use one of the classes based on the class
System.Windows.Media.Imaging.BitmapSource
,
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.bitmapsource.aspx#inheritanceContinued[
^].
These classes do not implement the interface
System.IDisposable
(
http://msdn.microsoft.com/en-us/library/system.idisposable.aspx[
^]) or any other means of explicit disposal, so you
never need to dispose their instances.
You are working on a managed platform based on
garbage collection. Most of the resources are reclaimed when an instance is being destructed automatically but a
Garbage Collector (GC).
Please see:
http://msdn.microsoft.com/en-us/library/system.gc.aspx[
^],
http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29[
^].
In certain cases, explicit garbage collection is required, but in these cases the class implements
System.IDisposable
or some other disposal method (yes, there are few cases where some
Dispose
method is provided, the one unrelated to
System.IDisposable
).
—SA