markus / KCOM / Views / TopMenu.xaml.cs.bak @ 190248a5
이력 | 보기 | 이력해설 | 다운로드 (3.34 KB)
1 | 787a4489 | KangIngu | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.Text; |
||
5 | using System.Windows; |
||
6 | using System.Windows.Controls; |
||
7 | using System.Windows.Data; |
||
8 | using System.Windows.Documents; |
||
9 | using System.Windows.Input; |
||
10 | using System.Windows.Media; |
||
11 | using System.Windows.Media.Imaging; |
||
12 | using System.Windows.Navigation; |
||
13 | using System.Windows.Shapes; |
||
14 | using Telerik.Windows.Controls; |
||
15 | |||
16 | namespace KCOM.Views |
||
17 | { |
||
18 | /// <summary> |
||
19 | /// TopMenu.xaml에 대한 상호 작용 논리 |
||
20 | /// </summary> |
||
21 | public partial class TopMenu : UserControl |
||
22 | { |
||
23 | public TopMenu() |
||
24 | { |
||
25 | InitializeComponent(); |
||
26 | } |
||
27 | |||
28 | private void btnFromFile_Click(object sender, RoutedEventArgs e) |
||
29 | { |
||
30 | System.Windows.Forms.OpenFileDialog dialog = new System.Windows.Forms.OpenFileDialog(); |
||
31 | var result = dialog.ShowDialog(); |
||
32 | if (result == System.Windows.Forms.DialogResult.OK) |
||
33 | { |
||
34 | using (Leadtools.Codecs.RasterCodecs codecs = new Leadtools.Codecs.RasterCodecs()) |
||
35 | { |
||
36 | |||
37 | this.ParentOfType<MainWindow>().dzMainMenu.imageViewer.Image = codecs.Load(dialog.FileName, 0, Leadtools.Codecs.CodecsLoadByteOrder.BgrOrGray, 1, 1); |
||
38 | //imageViewer.Image = codecs.Load(dialog.FileName, 24, Leadtools.Codecs.CodecsLoadByteOrder.BgrOrGray, 1, 1); |
||
39 | //imageViewer.Image.AnimationBackground = Leadtools.RasterColor.White; |
||
40 | |||
41 | //var d = imageViewer.Image.CreateThumbnail(100, 100, 24, Leadtools.RasterViewPerspective.TopLeft, Leadtools.RasterSizeFlags.None); |
||
42 | //RasterImageViewer vvv = new RasterImageViewer(); |
||
43 | //vvv.Image = d; |
||
44 | //zoomAndPanCanvas.Children.Add(vvv); |
||
45 | |||
46 | this.ParentOfType<MainWindow>().dzMainMenu.zoomAndPanCanvas.Width = Convert.ToDouble(this.ParentOfType<MainWindow>().dzMainMenu.imageViewer.Image.ImageWidth); |
||
47 | this.ParentOfType<MainWindow>().dzMainMenu.zoomAndPanCanvas.Height = Convert.ToDouble(this.ParentOfType<MainWindow>().dzMainMenu.imageViewer.Image.ImageHeight); |
||
48 | |||
49 | Common.ViewerDataModel.Instance.ContentWidth = this.ParentOfType<MainWindow>().dzMainMenu.zoomAndPanCanvas.Width; |
||
50 | Common.ViewerDataModel.Instance.ContentHeight = this.ParentOfType<MainWindow>().dzMainMenu.zoomAndPanCanvas.Height; |
||
51 | //zoomAndPanControl.AnimatedScaleToFit(); |
||
52 | this.ParentOfType<MainWindow>().dzMainMenu.zoomAndPanControl.ScaleToFit(); |
||
53 | } |
||
54 | } |
||
55 | } |
||
56 | |||
57 | private void btnSync_Click(object sender, RoutedEventArgs e) |
||
58 | { |
||
59 | if (this.ParentOfType<MainWindow>().dzMainMenu.testPanel2.IsHidden) |
||
60 | { |
||
61 | this.ParentOfType<MainWindow>().dzMainMenu.testPanel2.IsHidden = false; |
||
62 | this.ParentOfType<MainWindow>().dzMainMenu.zoomAndPanControl2.UpdateLayout(); |
||
63 | this.ParentOfType<MainWindow>().dzMainMenu.zoomAndPanControl2.ScaleToFit(); |
||
64 | } |
||
65 | else |
||
66 | { |
||
67 | this.ParentOfType<MainWindow>().dzMainMenu.testPanel2.IsHidden = true; |
||
68 | this.ParentOfType<MainWindow>().dzMainMenu.zoomAndPanControl.UpdateLayout(); |
||
69 | this.ParentOfType<MainWindow>().dzMainMenu.zoomAndPanControl.ScaleToFit(); |
||
70 | } |
||
71 | |||
72 | } |
||
73 | } |
||
74 | } |