728x90
반응형
WPF & C# - Microsoft.Expression.Shapes.Arc ( Behind Code / Ring / 링 비하인드코드로 입력하기 ) |
MainWindow.xaml
MainWindow.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using Microsoft.Expression.Shapes;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | void Init() { Microsoft.Expression.Shapes.Arc arc = new Arc(); arc.ArcThicknessUnit = Microsoft.Expression.Media.UnitType.Pixel; arc.ArcThickness = 10; arc.Fill = new SolidColorBrush(Colors.LimeGreen); arc.StrokeThickness = 5; arc.Stroke = new SolidColorBrush(Colors.LimeGreen); arc.StartAngle = 0; arc.EndAngle = 360; arc.Width = 120; arc.Height = 120; arc.Stretch = Stretch.None; // 모양유지를 위한 필수 Label lbl = new Label(); lbl.Content = "192.168.111.111"; lbl.HorizontalAlignment = HorizontalAlignment.Center; lbl.VerticalAlignment= VerticalAlignment.Center; Grid grd = new Grid(); grd.Children.Add(arc); grd.Children.Add(lbl); DispatcherTimer MyTimer = new DispatcherTimer(); MyTimer.Interval = TimeSpan.FromMilliseconds(1); MyTimer.Tick += (s, e) => { arc.StartAngle = arc.StartAngle + 4; arc.EndAngle = arc.EndAngle + 1; }; MyTimer.Start(); //타이머 시작 Microsoft.Expression.Shapes.Arc arc2 = new Arc(); arc2.ArcThicknessUnit = Microsoft.Expression.Media.UnitType.Percent; arc2.ArcThickness = 10; arc2.Fill = new SolidColorBrush(Colors.LimeGreen); arc2.StrokeThickness = 5; arc2.Stroke = new SolidColorBrush(Colors.Red); arc2.StartAngle = 50; arc2.EndAngle = 300; arc2.Width = 120; arc2.Height = 120; arc2.Stretch = Stretch.None; // 모양유지를 위한 필수 Label lbl2 = new Label(); lbl2.Content = "192.168.111.111"; lbl2.HorizontalAlignment = HorizontalAlignment.Center; lbl2.VerticalAlignment = VerticalAlignment.Center; Grid grd2 = new Grid(); grd2.Children.Add(arc2); grd2.Children.Add(lbl2); WrapPanel wrp = new WrapPanel(); wrp.Children.Add(grd); wrp.Children.Add(grd2); stp.Children.Add(wrp); DispatcherTimer MyTimer2 = new DispatcherTimer(); MyTimer2.Interval = TimeSpan.FromTicks(10000); MyTimer2.Tick += (s, e) => { arc2.StartAngle = arc2.StartAngle + 1; }; MyTimer2.Start(); //타이머 시작 } | cs |
728x90
반응형
'Programing (프로그래밍) > WPF & C# (C Sharp)' 카테고리의 다른 글
[자작] WPF & C# - BraitKiosk ( 브라이트코리아 - 키오스크 ) (1) | 2019.02.21 |
---|---|
WPF & C# - ToString() Format 포멧변경 (2) | 2019.02.19 |
WPF & C# - IP Address Check ( IP 주소 체크 확인 하기 / 192.168.0.1:8080 ) (1) | 2019.02.03 |
WPF & C# - 미라캐스트 사용 가능여부 디바이스 확인 ( isMiraCast / MiraCast Support Device ) (0) | 2019.01.25 |
WPF & C# - 핑 테스트 Ping Test ( PingOptions Class ) (1) | 2019.01.06 |
WPF & C# - FileSystemWatcher 파일시스템감시 ( 실시간 폴더 및 파일 변경사항 체크 ) (3) | 2019.01.03 |
WPF & C# - NPKI 공인인증서 폴더 위치 열기 ( Folder Open Path ) (0) | 2018.12.27 |
WPF & C# - 웹페이지에서 JSONString 값 가져오기 ( JSON / PHP / WEB / JSON_UNESCAPED_UNICODE / Newtonsoft.Json ) (0) | 2018.11.27 |