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


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


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;

// The imageBrush still exists


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.