Browse Source

zhao:修改首页布局

tags/录制修改前
耀 4 years ago
parent
commit
02efbbe91b

+ 1
- 1
Common/system/ImageHelper.cs View File

366
             {
366
             {
367
                 System.IO.FileStream fs = new System.IO.FileStream(filePathName, System.IO.FileMode.Create);
367
                 System.IO.FileStream fs = new System.IO.FileStream(filePathName, System.IO.FileMode.Create);
368
                 //在位图中呈现UI元素
368
                 //在位图中呈现UI元素
369
-                RenderTargetBitmap bmp = new RenderTargetBitmap(width, height, 96d, 96d,
369
+                RenderTargetBitmap bmp = new RenderTargetBitmap(width, height, PrimaryScreen.DpiX, PrimaryScreen.DpiY,
370
                 PixelFormats.Pbgra32);
370
                 PixelFormats.Pbgra32);
371
                 bmp.Render(ui);
371
                 bmp.Render(ui);
372
                 BitmapEncoder encoder = new PngBitmapEncoder();
372
                 BitmapEncoder encoder = new PngBitmapEncoder();

+ 19
- 1
Common/system/PrimaryScreen.cs View File

21
         static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDc);
21
         static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDc);
22
         #endregion
22
         #endregion
23
         #region DeviceCaps常量
23
         #region DeviceCaps常量
24
+        /// <summary>
25
+        /// 屏幕的宽度(像素);
26
+        /// </summary>
24
         const int HORZRES = 8;
27
         const int HORZRES = 8;
28
+        /// <summary>
29
+        /// 屏幕的高度
30
+        /// </summary>
25
         const int VERTRES = 10;
31
         const int VERTRES = 10;
32
+        /// <summary>
33
+        /// 沿屏幕宽度每逻辑英寸的像素数,在多显示器系统中,该值对所显示器相同
34
+        /// </summary>
26
         const int LOGPIXELSX = 88;
35
         const int LOGPIXELSX = 88;
36
+        /// <summary>
37
+        /// 沿屏幕高度每逻辑英寸的像素数,在多显示器系统中,该值对所显示器相同;
38
+        /// </summary>
27
         const int LOGPIXELSY = 90;
39
         const int LOGPIXELSY = 90;
40
+        /// <summary>
41
+        /// Windows NT:可视桌面的以像素为单位的高度。
42
+        /// </summary>
28
         const int DESKTOPVERTRES = 117;
43
         const int DESKTOPVERTRES = 117;
44
+        /// <summary>
45
+        /// DESKTOPHORZRES:Windows NT:可视桌面的以像素为单位的宽度。如果设备支持一个可视桌面或双重显示则此值可能大于VERTRES;
46
+        /// </summary>
29
         const int DESKTOPHORZRES = 118;
47
         const int DESKTOPHORZRES = 118;
30
         #endregion
48
         #endregion
31
 
49
 
32
         #region 属性
50
         #region 属性
33
         /// <summary>
51
         /// <summary>
34
-        /// 获取屏幕分辨率当前物理大小
52
+        /// 获取屏幕分辨率当前物理大小 设置缩放后
35
         /// </summary>
53
         /// </summary>
36
         public static Size WorkingArea
54
         public static Size WorkingArea
37
         {
55
         {

+ 16
- 15
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

7
         xmlns:aforge ="clr-namespace:AForge.Controls;assembly=AForge.Controls"
7
         xmlns:aforge ="clr-namespace:AForge.Controls;assembly=AForge.Controls"
8
         xmlns:local="clr-namespace:XHWK.WKTool"
8
         xmlns:local="clr-namespace:XHWK.WKTool"
9
         mc:Ignorable="d"
9
         mc:Ignorable="d"
10
-        Title="星火微课系统" Height="725.8" Width="975" WindowStartupLocation="CenterScreen"
10
+        Title="星火微课系统" Height="1040" Width="1276" WindowStartupLocation="CenterScreen"
11
     WindowStyle="None"    AllowsTransparency="True"  Background="#EFF1F8" ShowInTaskbar="True"
11
     WindowStyle="None"    AllowsTransparency="True"  Background="#EFF1F8" ShowInTaskbar="True"
12
    >
12
    >
13
     
13
     
14
     <Viewbox>
14
     <Viewbox>
15
-        <Grid Height="725.8" Width="975">
15
+        <Grid x:Name="GridContent" Height="1040">
16
             <!--分3行-->
16
             <!--分3行-->
17
             <Grid.RowDefinitions>
17
             <Grid.RowDefinitions>
18
                 <RowDefinition Height="110"/>
18
                 <RowDefinition Height="110"/>
48
                 </StackPanel>
48
                 </StackPanel>
49
                 <!--第二行-->
49
                 <!--第二行-->
50
                 <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,6,0,0">
50
                 <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,6,0,0">
51
-                    <Button Cursor="Hand" x:Name="btnScreenRecording" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnScreenRecording_Click">
51
+                    <Button Cursor="Hand" x:Name="btnScreenRecording" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnScreenRecording_Click" Margin="30,0,0,0">
52
                         <StackPanel Orientation="Vertical">
52
                         <StackPanel Orientation="Vertical">
53
                             <Image x:Name="ImgScreenRecording" Source="./Images/microLessonSystem_2.png"/>
53
                             <Image x:Name="ImgScreenRecording" Source="./Images/microLessonSystem_2.png"/>
54
                             <Image x:Name="ImgScreenRecordingTwo" Source="./Images/microLessonSystem_3.png" Visibility="Collapsed"/>
54
                             <Image x:Name="ImgScreenRecordingTwo" Source="./Images/microLessonSystem_3.png" Visibility="Collapsed"/>
55
                             <TextBlock x:Name="TxbRecordScreenWord" Text="录屏" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
55
                             <TextBlock x:Name="TxbRecordScreenWord" Text="录屏" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
56
                         </StackPanel>
56
                         </StackPanel>
57
                     </Button>
57
                     </Button>
58
-                    <Button Cursor="Hand" x:Name="btnScreenshot" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,30,0" Click="BtnScreenshot_Click">
58
+                    <Button Cursor="Hand" x:Name="btnScreenshot" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,0,0" Click="BtnScreenshot_Click">
59
                         <StackPanel Orientation="Vertical">
59
                         <StackPanel Orientation="Vertical">
60
                             <Image x:Name="ImgScreenshot" Source="./Images/microLessonSystem_12.png"/>
60
                             <Image x:Name="ImgScreenshot" Source="./Images/microLessonSystem_12.png"/>
61
                             <Image x:Name="ImgScreenshotTwo" Source="./Images/microLessonSystem_11.png" Visibility="Collapsed"/>
61
                             <Image x:Name="ImgScreenshotTwo" Source="./Images/microLessonSystem_11.png" Visibility="Collapsed"/>
62
                             <TextBlock Text="截图" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
62
                             <TextBlock Text="截图" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
63
                         </StackPanel>
63
                         </StackPanel>
64
                     </Button>
64
                     </Button>
65
-                    <Button Cursor="Hand" x:Name="btnImport" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnImport_Click">
65
+                    <Button Cursor="Hand" x:Name="btnImport" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnImport_Click" Margin="30,0,0,0">
66
                         <StackPanel Orientation="Vertical">
66
                         <StackPanel Orientation="Vertical">
67
                             <Image x:Name="ImgImport" Source="./Images/microLessonSystem_6.png"/>
67
                             <Image x:Name="ImgImport" Source="./Images/microLessonSystem_6.png"/>
68
                             <Image x:Name="ImgImportTwo" Source="./Images/microLessonSystem_7.png" Visibility="Collapsed"/>
68
                             <Image x:Name="ImgImportTwo" Source="./Images/microLessonSystem_7.png" Visibility="Collapsed"/>
69
                             <TextBlock Text="导入" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
69
                             <TextBlock Text="导入" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
70
                         </StackPanel>
70
                         </StackPanel>
71
                     </Button>
71
                     </Button>
72
-                    <Button Cursor="Hand" x:Name="BtnRecord" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="60,0,30,0" Click="BtnRecord_Click">
72
+                    <Button Cursor="Hand" x:Name="BtnRecord" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="100,0,0,0" Click="BtnRecord_Click">
73
                         <StackPanel Orientation="Vertical">
73
                         <StackPanel Orientation="Vertical">
74
                             <Image x:Name="ImgRecord" Source="./Images/microLessonSystem_14.png"/>
74
                             <Image x:Name="ImgRecord" Source="./Images/microLessonSystem_14.png"/>
75
                             <Image x:Name="ImgRecordTwo" Source="./Images/microLessonSystem_13.png" Visibility="Collapsed"/>
75
                             <Image x:Name="ImgRecordTwo" Source="./Images/microLessonSystem_13.png" Visibility="Collapsed"/>
76
                             <TextBlock x:Name="TxbRecordingWord" Text="录制" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
76
                             <TextBlock x:Name="TxbRecordingWord" Text="录制" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
77
                         </StackPanel>
77
                         </StackPanel>
78
                     </Button>
78
                     </Button>
79
-                    <Button Cursor="Hand" x:Name="btnStop" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnStop_Click">
79
+                    <Button Cursor="Hand" x:Name="btnStop" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnStop_Click" Margin="30,0,0,0">
80
                         <StackPanel Orientation="Vertical">
80
                         <StackPanel Orientation="Vertical">
81
                             <Image x:Name="ImgStop" Source="./Images/microLessonSystem_21.png"/>
81
                             <Image x:Name="ImgStop" Source="./Images/microLessonSystem_21.png"/>
82
                             <Image x:Name="ImgStopTwo" Source="./Images/microLessonSystem_20.png" Visibility="Collapsed"/>
82
                             <Image x:Name="ImgStopTwo" Source="./Images/microLessonSystem_20.png" Visibility="Collapsed"/>
85
                     </Button>
85
                     </Button>
86
                 </StackPanel>
86
                 </StackPanel>
87
                 <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,10,10,0">
87
                 <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,10,10,0">
88
-                    <Button Cursor="Hand" x:Name="btnAdd" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnAdd_Click">
88
+                    <Button Cursor="Hand" x:Name="btnAdd" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnAdd_Click" Margin="0,0,30,0">
89
                         <StackPanel Orientation="Vertical">
89
                         <StackPanel Orientation="Vertical">
90
                             <Image x:Name="ImgAdd" Source="./Images/microLessonSystem_25.png" Visibility="Visible"/>
90
                             <Image x:Name="ImgAdd" Source="./Images/microLessonSystem_25.png" Visibility="Visible"/>
91
                             <Image x:Name="ImgAddTwo" Source="./Images/microLessonSystem_24.png" Visibility="Collapsed"/>
91
                             <Image x:Name="ImgAddTwo" Source="./Images/microLessonSystem_24.png" Visibility="Collapsed"/>
92
                             <TextBlock Text="增加" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
92
                             <TextBlock Text="增加" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
93
                         </StackPanel>
93
                         </StackPanel>
94
                     </Button>
94
                     </Button>
95
-                    <Button Cursor="Hand" x:Name="btnPrint" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,30,0" Click="BtnPrint_Click">
95
+                    <Button Cursor="Hand" x:Name="btnPrint" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnPrint_Click">
96
                         <StackPanel Orientation="Vertical">
96
                         <StackPanel Orientation="Vertical">
97
                             <Image x:Name="ImgPrint" Source="./Images/microLessonSystem_4.png" Visibility="Collapsed"/>
97
                             <Image x:Name="ImgPrint" Source="./Images/microLessonSystem_4.png" Visibility="Collapsed"/>
98
                             <Image x:Name="ImgPrintTwo" Source="./Images/microLessonSystem_5.png" Visibility="Visible"/>
98
                             <Image x:Name="ImgPrintTwo" Source="./Images/microLessonSystem_5.png" Visibility="Visible"/>
99
                             <TextBlock Text="打印" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
99
                             <TextBlock Text="打印" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
100
                         </StackPanel>
100
                         </StackPanel>
101
                     </Button>
101
                     </Button>
102
-                    <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click">
102
+                    <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click" Margin="0,0,30,0">
103
                         <StackPanel Orientation="Vertical">
103
                         <StackPanel Orientation="Vertical">
104
                             <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_15.png" Visibility="Collapsed"/>
104
                             <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_15.png" Visibility="Collapsed"/>
105
                             <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_16.png" Visibility="Visible"/>
105
                             <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_16.png" Visibility="Visible"/>
106
                             <TextBlock Text="上传" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
106
                             <TextBlock Text="上传" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
107
                         </StackPanel>
107
                         </StackPanel>
108
                     </Button>
108
                     </Button>
109
-                    <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,0,0" Click="BtnSetUp_Click">
109
+                    <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnSetUp_Click">
110
                         <StackPanel Orientation="Vertical">
110
                         <StackPanel Orientation="Vertical">
111
                             <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png" Visibility="Visible"/>
111
                             <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png" Visibility="Visible"/>
112
                             <Image x:Name="ImgSetUpTwo" Source="./Images/microLessonSystem_17.png" Visibility="Collapsed"/>
112
                             <Image x:Name="ImgSetUpTwo" Source="./Images/microLessonSystem_17.png" Visibility="Collapsed"/>
114
                         </StackPanel>
114
                         </StackPanel>
115
                     </Button>
115
                     </Button>
116
                 </StackPanel>
116
                 </StackPanel>
117
+                <Button Content="Button" HorizontalAlignment="Left" Margin="573,29,0,0" Grid.Row="1" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
117
             </Grid>
118
             </Grid>
118
             <!--主内容-->
119
             <!--主内容-->
119
-            <Grid Grid.Row="1" x:Name="GridMain" Width="793.700787401575">
120
-                <ScrollViewer x:Name="scroMain" Height="580" VerticalScrollBarVisibility="Visible">
121
-                    <Grid x:Name="gridM"  Margin="0,0,0,0" Background="#FFFFFF" Width="793.700787401575" Height="1142.51968503937" Visibility="Visible">
120
+            <Grid Grid.Row="1" x:Name="GridMain" Width="1276">
121
+                <ScrollViewer x:Name="scroMain" VerticalScrollBarVisibility="Visible">
122
+                    <Grid x:Name="gridM"  Margin="0,0,0,0" Background="#FFFFFF" Visibility="Visible" Height="1780">
122
                         <Grid>
123
                         <Grid>
123
                             <Border Grid.Row="1"  CornerRadius="5">
124
                             <Border Grid.Row="1"  CornerRadius="5">
124
                                 <Grid x:Name="IMG" Margin="0,0,0,0">
125
                                 <Grid x:Name="IMG" Margin="0,0,0,0">
167
            
168
            
168
             <Grid Grid.Row="1">
169
             <Grid Grid.Row="1">
169
                 <StackPanel Grid.Row="0" Orientation="Horizontal" Background="#FFFFFF" Width="180" HorizontalAlignment="Center"
170
                 <StackPanel Grid.Row="0" Orientation="Horizontal" Background="#FFFFFF" Width="180" HorizontalAlignment="Center"
170
-            Height="58" Margin="0,520,0,0" Grid.Column="1">
171
+            Height="58" Margin="0,520,0,0" Grid.Column="1" VerticalAlignment="Bottom">
171
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
172
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
172
                     x:Name="last_button"
173
                     x:Name="last_button"
173
                     Width="60" Height="50"
174
                     Width="60" Height="50"

+ 20
- 8
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

58
         /// <summary>
58
         /// <summary>
59
         /// 笔迹粗细
59
         /// 笔迹粗细
60
         /// </summary>
60
         /// </summary>
61
-        private int Size = 2;
61
+        private int PenSize = 2;
62
         #endregion
62
         #endregion
63
 
63
 
64
         #region 初始化
64
         #region 初始化
117
             blackboard_canvas.UseCustomCursor = true;
117
             blackboard_canvas.UseCustomCursor = true;
118
             drawingAttributes.FitToCurve = true;
118
             drawingAttributes.FitToCurve = true;
119
             drawingAttributes.IgnorePressure = false;
119
             drawingAttributes.IgnorePressure = false;
120
-            drawingAttributes.Width = Size;
121
-            drawingAttributes.Height = Size;
120
+            drawingAttributes.Width = PenSize;
121
+            drawingAttributes.Height = PenSize;
122
             drawingAttributes.Color = Color;
122
             drawingAttributes.Color = Color;
123
             blackboard_canvas.Cursor = System.Windows.Input.Cursors.Pen;
123
             blackboard_canvas.Cursor = System.Windows.Input.Cursors.Pen;
124
             //wfhCamera.Visibility = Visibility.Hidden;
124
             //wfhCamera.Visibility = Visibility.Hidden;
125
             ImgPDFPath = null;
125
             ImgPDFPath = null;
126
             ImgPDFPath = new string[300];
126
             ImgPDFPath = new string[300];
127
         }
127
         }
128
+        /// <summary>
129
+        /// 修改布局
130
+        /// </summary>
131
+        public void SetUpLayout()
132
+        {
133
+            //宽高比1276,1040
134
+            //double AspectRatio = 1276.0 / 1040.0;
135
+            ////System.Drawing.Size des = PrimaryScreen.DESKTOP;
136
+            //System.Drawing.Size workingArea = PrimaryScreen.WorkingArea;
137
+            //this.Height = workingArea.Height;
138
+
139
+        }
128
         #endregion
140
         #endregion
129
 
141
 
130
         #region 事件
142
         #region 事件
611
         {
623
         {
612
             drawingAttributes.Width = 1;
624
             drawingAttributes.Width = 1;
613
             drawingAttributes.Height = 1;
625
             drawingAttributes.Height = 1;
614
-            Size = 1;
626
+            PenSize = 1;
615
         }
627
         }
616
         /// <summary>
628
         /// <summary>
617
         /// 画笔粗细事件 中
629
         /// 画笔粗细事件 中
622
         {
634
         {
623
             drawingAttributes.Width = 3;
635
             drawingAttributes.Width = 3;
624
             drawingAttributes.Height = 3;
636
             drawingAttributes.Height = 3;
625
-            Size = 3;
637
+            PenSize = 3;
626
         }
638
         }
627
         /// <summary>
639
         /// <summary>
628
         /// 画笔粗细事件 粗
640
         /// 画笔粗细事件 粗
633
         {
645
         {
634
             drawingAttributes.Width = 5;
646
             drawingAttributes.Width = 5;
635
             drawingAttributes.Height = 5;
647
             drawingAttributes.Height = 5;
636
-            Size = 5;
648
+            PenSize = 5;
637
         }
649
         }
638
         /// <summary>
650
         /// <summary>
639
         /// 登陆事件
651
         /// 登陆事件
2147
             {
2159
             {
2148
                 Dispatcher.Invoke(new Action(() =>
2160
                 Dispatcher.Invoke(new Action(() =>
2149
                 {
2161
                 {
2150
-                    myblackboard.changepages(0, 0, true, Color, Size, APP.pageData.currpage - 1);
2162
+                    myblackboard.changepages(0, 0, true, Color, PenSize, APP.pageData.currpage - 1);
2151
                 }));
2163
                 }));
2152
             }
2164
             }
2153
 
2165
 
2288
                     Dispatcher.Invoke(new Action(() =>
2300
                     Dispatcher.Invoke(new Action(() =>
2289
                     {
2301
                     {
2290
                         //myblackboard.changepages(testX, testY,false);
2302
                         //myblackboard.changepages(testX, testY,false);
2291
-                        myblackboard.changepages(testX, testY, false, Color, Size, APP.pageData.currpage - 1);
2303
+                        myblackboard.changepages(testX, testY, false, Color, PenSize, APP.pageData.currpage - 1);
2292
                     }));
2304
                     }));
2293
                 }
2305
                 }
2294
 
2306
 

Loading…
Cancel
Save