For example:
BitmapImage bitmap = new BitmapImage(); byte[] buffer = GetHugeByteArray(); // from some external source using (MemoryStream stream = new Memor
The key point is that the class being "used" must implement the IDisposable interface.