LoadedImageSurface.Close LoadedImageSurface.Close LoadedImageSurface.Close LoadedImageSurface.Close Method

Definition

Disposes of the LoadedImageSurface and associated resources.

public : void Close()
void Close() const;
// This member is not implemented in C#
' This member is not implemented in VB.Net

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.