CachingHint 열거형

정의

바둑판식으로 표시된 브러시 개체를 캐시할지 여부를 지정합니다.

public enum class CachingHint
public enum CachingHint
type CachingHint = 
Public Enum CachingHint
상속
CachingHint

필드

Cache 1

RenderOptions 설정에 지정된 캐싱 힌트를 사용하여 바둑판식으로 표시된 브러시 개체를 화면 밖에 있는 버퍼에 캐시합니다.

Unspecified 0

캐싱 힌트를 지정하지 않았습니다.

예제

다음 예제에 대 한 캐싱 힌트 옵션을 사용 하는 방법을 보여 줍니다는 DrawingBrush합니다.

DrawingBrush drawingBrush = new DrawingBrush();
            
// Set the caching hint option for the brush.
RenderOptions.SetCachingHint(drawingBrush, CachingHint.Cache);

// Set the minimum and maximum relative sizes for regenerating the tiled brush.
// The tiled brush will be regenerated and re-cached when its size is
// 0.5x or 2x of the current cached size.
RenderOptions.SetCacheInvalidationThresholdMinimum(drawingBrush, 0.5);
RenderOptions.SetCacheInvalidationThresholdMaximum(drawingBrush, 2.0);
Dim drawingBrush As New DrawingBrush()

' Set the caching hint option for the brush.
RenderOptions.SetCachingHint(drawingBrush, CachingHint.Cache)

' Set the minimum and maximum relative sizes for regenerating the tiled brush.
' The tiled brush will be regenerated and re-cached when its size is
' 0.5x or 2x of the current cached size.
RenderOptions.SetCacheInvalidationThresholdMinimum(drawingBrush, 0.5)
RenderOptions.SetCacheInvalidationThresholdMaximum(drawingBrush, 2.0)

설명

기본적으로 WPF는 렌더링된 콘텐츠 및 VisualBrush 개체를 DrawingBrush 캐시하지 않습니다. 장면에서 브러시의 사용 및 내용이 변경 되는 정적 시나리오에서 캐시 되지 비디오 메모리가 절약 되는 장점이 있습니다. 정적 콘텐츠가 포함된 브러시를 비정적 방식으로 사용하는 경우 WPF의 기본 동작은 콘텐츠가 교환되지 않더라도 모든 프레임마다 브러시의 전체 콘텐츠를 다시 렌더링하는 것입니다. 예를 들어,이 동작이 발생 하는 정적 DrawingBrush 또는 VisualBrush 회전 3D 개체 표면에 매핑되어 있습니다. 정적 콘텐츠를 다시 렌더링 성능에 부정적인 영향을 줄이 있습니다.

설정 하 여는 CachingHint 연결 된 속성에서 캐시에 브러시, 바둑판식으로 배열 된 브러시 개체의 캐시 된 버전을 사용 하 여 성능을 늘릴 수 있습니다.

CacheInvalidationThresholdMinimumCacheInvalidationThresholdMaximum 속성 값은 시기를 결정 하는 상대 크기 값을 TileBrush 확장의 변경으로 인해 개체를 다시 생성 해야 합니다. 설정 하 여 예를 들어, 합니다 CacheInvalidationThresholdMaximum 속성을 2.0으로 캐시를 TileBrush 만 크기로 현재 캐시의 크기 두 배를 초과 하는 경우 다시 생성 해야 합니다.

적용 대상

추가 정보