Storyboard 3

WPF ColorAnimation

1. 색을 변경할 브러시 생성, 이름 등록 SolidColorBrush mySolidColorBrush = new SolidColorBrush(Colors.Blue); this.RegisterName("MySolidColorBrush", mySolidColorBrush); 2. 만들어 놓은 Path에 Brush 설정 mainPath.Fill = mySolidColorBrush; 3. 칼라 애니메이션 설정 //칼라애니메이션 설정 ColorAnimation myColorAnimation = new ColorAnimation(); myColorAnimation.From = Colors.Blue; myColorAnimation.To = Colors.Red; myColorAnimation.Duration = ne..

WPF Storyboard Animation_마우스 진입했을 때 애니메이션 설정

//스택패널 생성 후 여백 20 설정 StackPanel myStackPanel = new StackPanel(); myStackPanel.Margin = new Thickness(20); //애니메이션을 설정할 사각형 설정 Rectangle myRectangle = new Rectangle(); myRectangle.Name = "MyRectangle"; myRectangle.Width = 100; myRectangle.Height = 100; // 새로운 NameScope생성 후 등록 NameScope.SetNameScope(this, new NameScope()); this.RegisterName(myRectangle.Name, myRectangle); //파랑색 설정 SolidColorBrush ..

WPF 뷰에서 fadein, fadeout 효과주기(코드)

1. Rectangle 객체 생성하기 //StackPanel 생성 후 여백 10 설정StackPanel myPanel = new StackPanel(); myPanel.Margin = new Thickness(10); //사각형 객체 생성 , 이름 = myRectangle, Rectangle myRectangle = new Rectangle(); myRectangle.Name = "myRectangle"; this.RegisterName(myRectangle.Name, myRectangle); //가로 100, 세로 100, 색 파랑 myRectangle.Width = 100; myRectangle.Height = 100; myRectangle.Fill = Brushes.Blue; //패널의 하위 객체로..

반응형