Share via


LoadedImageSurface.Close 메서드

정의

LoadedImageSurface 및 연결된 리소스를 삭제합니다.

public:
 virtual void Close() = Close;
void Close();
// This member is not implemented in C#
function close()
' This member is not implemented in VB.NET

구현

M:Windows.Foundation.IClosable.Close M:System.IDisposable.Close

예제

이 예제에서는 LoadedImageSurface가 닫힌 후에도 CompositionSurfaceBrush가 계속 존재합니다.

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

설명

이 메서드를 호출하면 LoadedImageSurface 참조가 삭제되지만 여전히 활성 참조가 있는 LoadedImageSurface 에서 만든 브러시 또는 표면은 명시적으로 삭제하지 않는 한 계속 렌더링됩니다.

적용 대상