상세 컨텐츠

본문 제목

[펌] WPF에서 Brush 사용시 생각해야 할 것들

WPF

by happynuri 2008. 1. 31. 14:19

본문

WPF에서 Color

01) System.Window.Media

02) RGB (0~255), Color.FromArgb(a, r, g, b)

03) scRGB (0.0 ~ 1.0), Color.FrmScRgb(a, r, g, b)

04) Colors (141 static read-only)

05) Color.Transparent : 알파 0

06) Color 계층구조

- Object->DispactcherObject(abstract)->DependencyObject->Freezable(abstract)->

Animatable(abstract)->Brush(abstract)->GradientBrush(abstract)->LinearGradientBrush, RadialGradientBrush

- Object->DispactcherObject(abstract)->DependencyObject->Freezable(abstract)->

Animatable(abstract)->Brush(abstract)->SolidColorBrush

- Object->DispactcherObject(abstract)->DependencyObject->Freezable(abstract)->

Animatable(abstract)->Brush(abstract)->TileBrush(abstract)->DrawingBrush, ImageBrush, VisualBrush

07) SystemColor : WindowColor, WindowTextColor

WPF에서 SystemParameters

01) Width, Height 설정이 안되어 있거나 모를 경우 영역 구하기

ActualWidth – 2 * SystemParameters.ResizeFrameVerticalBorderWidth;

ActualHeight – 2 * SystemParameters.ResizeFrameHorizontalBorderHeight

– SystemParameters.CaptionHeight

WPF에서 Vector

01) Point Point 연산 -> Vector

02) AngleBetween : 두 벡터 사이의 각도

03) Normalize : 단위 벡터

WPF에서 Reflection

01) PropertyInfo[] (속성 정보 배열)

02) typeof(XXX).GetProperties(YYY) -> YYY 조건하에 XXX의 속성들을 가져옴

WPF에서 Timer

01) System.Windows.Threading.DispatcherTimer

- Interval <- TimeSpan (>10 milliseconds)

WPF에서 Brush

01) Freezable 클래스에서 상속되었기 때문에 Changed 이벤트 자동 호출

02) Brushes를 사용하면 자동 변경안되는데, Frozen 상태여서 그런것임 (IsFrozen==true)

03) CanFreeze, IsFrozen 속성

04) Frozen된 객체를 상태를 해제할 수 없지만, unfrozen된 복사본을 사용하면 됨

05) SystemColor : WindowBrush, WindowTextBrush

- SystemColorBrush (변경을 위해 사용)

06) LinearGradientBrush (Freezable 클래스)

- Two colors : clr1, clr2

- Two points : pt1, pt2 (기본적으로 윈도우 영역의 높이와 너비를 1 Unit으로 본다)

07) GradientBrush에서 MappingMode 속성 (좌표 매핑)

- BrushMappingMode : RelativeToboundingBox, Absolute

08) GradientBrush에서 ColorInterpolationMode 속성 (색상 변화 방법)

- SRbgLinearInterpolation, ScRgbLinearInterpolation

09) LinearGradientBrush - SpreadMethod - 지정 끝 후에 어떻게 처리할 것인지 결정

- Pad, Reflect, Repeat

10) SizeChanged 이벤트 : 윈도우 크기 변경시 호출

11) GradientStops (GradientStopCollection) – Color, Offset

12) RadialGradientBrush : 원형 그라이디언트

- Offset 1: Center, RadiusX & RadiusY

- Offset 0: GradientOrgin

13) RadialGradientBrush – SpreadMethod

- Fill


출처: http://www.lovehana.com/443

관련글 더보기

댓글 영역