728x90
반응형
728x170
▶ MainWindow.xaml
<Window x:Class="TestProject.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="800"
Height="600"
Title="로딩 패널 표시하기"
Background="Gold"
FontFamily="나눔고딕코딩"
FontSize="16">
<Grid>
<Grid
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Image Name="image"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="150"
Height="150"
Stretch="Fill"
Source="IMAGE/loading.png" />
<Label
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="Loading" />
</Grid>
</Grid>
</Window>
728x90
▶ MainWindow.xaml.cs
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace TestProject
{
/// <summary>
/// 메인 윈도우
/// </summary>
public partial class MainWindow : Window
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainWindow()
/// <summary>
/// 생성자
/// </summary>
public MainWindow()
{
InitializeComponent();
DoubleAnimation doubleAnimation = new DoubleAnimation();
doubleAnimation.RepeatBehavior = RepeatBehavior.Forever;
doubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(1));
doubleAnimation.From = 0;
doubleAnimation.To = 360;
RotateTransform rotateTransform = new RotateTransform();
rotateTransform.CenterX += this.image.Width / 2;
rotateTransform.CenterY += this.image.Height / 2;
this.image.RenderTransform = rotateTransform;
rotateTransform.BeginAnimation(RotateTransform.AngleProperty, doubleAnimation);
}
#endregion
}
}
728x90
반응형
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] ComponentDispatcher 클래스 : ThreadFilterMessage 정적 이벤트를 사용해 프로세스 간 메시지 송수신하기 (0) | 2021.02.20 |
---|---|
[C#/WPF] Slider 클래스 : 커스텀 슬라이더 사용하기 (0) | 2021.02.20 |
[C#/WPF] Window 클래스 : 반투명 윈도우 사용하기 (0) | 2021.02.19 |
[C#/WPF] MediaElement 클래스 : 움직이는 GIF 파일 재생하기 (0) | 2021.02.19 |
[C#/WPF] 워드 클라우드(Word Cloud) 이미지 만들기 (0) | 2021.02.19 |
[C#/WPF] BitmapImage 클래스 : 바이트 배열에서 비트맵 이미지 구하기 (0) | 2021.02.18 |
[C#/WPF] BitmapSource 클래스 : 바이트 배열에서 비트맵 소스 구하기 (0) | 2021.02.18 |
[C#/WPF] BitmapImage 클래스 : 바이트 배열 구하기 (0) | 2021.02.17 |
[C#/WPF] Slider 엘리먼트 : 커스텀 슬라이더 사용하기 (0) | 2021.02.16 |
[C#/WPF] 진행 컨트롤 사용하기 (0) | 2021.02.16 |
댓글을 달아 주세요