LoadedImageSurface.Close Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Disposes of the LoadedImageSurface and associated resources.
public:
virtual void Close() = Close;
void Close();
// This member is not implemented in C#
function close()
' This member is not implemented in VB.NET
Implements
Examples
In this example, the CompositionSurfaceBrush will continue to exist even after the LoadedImageSurface has been closed.
Compositor compositor = new Compositor();
CompositionSurfaceBrush imageBrush = compositor.CreateSurfaceBrush();
LoadedImageSurface loadedSurface = LoadedImageSurface.StartLoadFromUri(new Uri("ms-appx:///Assets/myPic.jpg"));
loadedSurface.LoadCompleted += Load_Completed;
imageBrush.Surface = loadedSurface;
loadedSurface.Close();
// The imageBrush still exists
Remarks
Calling this method will dispose the LoadedImageSurface reference, however any brushes or surfaces created from the LoadedImageSurface that still have active references will continue to render unless you explicitly dispose of those as well.