浏览代码

zhao:修改首页布局

tags/录制修改前
耀 4 年前
父节点
当前提交
02efbbe91b

+ 1
- 1
Common/system/ImageHelper.cs 查看文件

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

+ 19
- 1
Common/system/PrimaryScreen.cs 查看文件

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

+ 16
- 15
XHWK.WKTool/XHMicroLessonSystemWindow.xaml 查看文件

@@ -7,12 +7,12 @@
7 7
         xmlns:aforge ="clr-namespace:AForge.Controls;assembly=AForge.Controls"
8 8
         xmlns:local="clr-namespace:XHWK.WKTool"
9 9
         mc:Ignorable="d"
10
-        Title="星火微课系统" Height="725.8" Width="975" WindowStartupLocation="CenterScreen"
10
+        Title="星火微课系统" Height="1040" Width="1276" WindowStartupLocation="CenterScreen"
11 11
     WindowStyle="None"    AllowsTransparency="True"  Background="#EFF1F8" ShowInTaskbar="True"
12 12
    >
13 13
     
14 14
     <Viewbox>
15
-        <Grid Height="725.8" Width="975">
15
+        <Grid x:Name="GridContent" Height="1040">
16 16
             <!--分3行-->
17 17
             <Grid.RowDefinitions>
18 18
                 <RowDefinition Height="110"/>
@@ -48,35 +48,35 @@
48 48
                 </StackPanel>
49 49
                 <!--第二行-->
50 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 52
                         <StackPanel Orientation="Vertical">
53 53
                             <Image x:Name="ImgScreenRecording" Source="./Images/microLessonSystem_2.png"/>
54 54
                             <Image x:Name="ImgScreenRecordingTwo" Source="./Images/microLessonSystem_3.png" Visibility="Collapsed"/>
55 55
                             <TextBlock x:Name="TxbRecordScreenWord" Text="录屏" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
56 56
                         </StackPanel>
57 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 59
                         <StackPanel Orientation="Vertical">
60 60
                             <Image x:Name="ImgScreenshot" Source="./Images/microLessonSystem_12.png"/>
61 61
                             <Image x:Name="ImgScreenshotTwo" Source="./Images/microLessonSystem_11.png" Visibility="Collapsed"/>
62 62
                             <TextBlock Text="截图" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
63 63
                         </StackPanel>
64 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 66
                         <StackPanel Orientation="Vertical">
67 67
                             <Image x:Name="ImgImport" Source="./Images/microLessonSystem_6.png"/>
68 68
                             <Image x:Name="ImgImportTwo" Source="./Images/microLessonSystem_7.png" Visibility="Collapsed"/>
69 69
                             <TextBlock Text="导入" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
70 70
                         </StackPanel>
71 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 73
                         <StackPanel Orientation="Vertical">
74 74
                             <Image x:Name="ImgRecord" Source="./Images/microLessonSystem_14.png"/>
75 75
                             <Image x:Name="ImgRecordTwo" Source="./Images/microLessonSystem_13.png" Visibility="Collapsed"/>
76 76
                             <TextBlock x:Name="TxbRecordingWord" Text="录制" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
77 77
                         </StackPanel>
78 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 80
                         <StackPanel Orientation="Vertical">
81 81
                             <Image x:Name="ImgStop" Source="./Images/microLessonSystem_21.png"/>
82 82
                             <Image x:Name="ImgStopTwo" Source="./Images/microLessonSystem_20.png" Visibility="Collapsed"/>
@@ -85,28 +85,28 @@
85 85
                     </Button>
86 86
                 </StackPanel>
87 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 89
                         <StackPanel Orientation="Vertical">
90 90
                             <Image x:Name="ImgAdd" Source="./Images/microLessonSystem_25.png" Visibility="Visible"/>
91 91
                             <Image x:Name="ImgAddTwo" Source="./Images/microLessonSystem_24.png" Visibility="Collapsed"/>
92 92
                             <TextBlock Text="增加" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
93 93
                         </StackPanel>
94 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 96
                         <StackPanel Orientation="Vertical">
97 97
                             <Image x:Name="ImgPrint" Source="./Images/microLessonSystem_4.png" Visibility="Collapsed"/>
98 98
                             <Image x:Name="ImgPrintTwo" Source="./Images/microLessonSystem_5.png" Visibility="Visible"/>
99 99
                             <TextBlock Text="打印" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
100 100
                         </StackPanel>
101 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 103
                         <StackPanel Orientation="Vertical">
104 104
                             <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_15.png" Visibility="Collapsed"/>
105 105
                             <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_16.png" Visibility="Visible"/>
106 106
                             <TextBlock Text="上传" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
107 107
                         </StackPanel>
108 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 110
                         <StackPanel Orientation="Vertical">
111 111
                             <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png" Visibility="Visible"/>
112 112
                             <Image x:Name="ImgSetUpTwo" Source="./Images/microLessonSystem_17.png" Visibility="Collapsed"/>
@@ -114,11 +114,12 @@
114 114
                         </StackPanel>
115 115
                     </Button>
116 116
                 </StackPanel>
117
+                <Button Content="Button" HorizontalAlignment="Left" Margin="573,29,0,0" Grid.Row="1" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
117 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 123
                         <Grid>
123 124
                             <Border Grid.Row="1"  CornerRadius="5">
124 125
                                 <Grid x:Name="IMG" Margin="0,0,0,0">
@@ -167,7 +168,7 @@
167 168
            
168 169
             <Grid Grid.Row="1">
169 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 172
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
172 173
                     x:Name="last_button"
173 174
                     Width="60" Height="50"

+ 20
- 8
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs 查看文件

@@ -58,7 +58,7 @@ namespace XHWK.WKTool
58 58
         /// <summary>
59 59
         /// 笔迹粗细
60 60
         /// </summary>
61
-        private int Size = 2;
61
+        private int PenSize = 2;
62 62
         #endregion
63 63
 
64 64
         #region 初始化
@@ -117,14 +117,26 @@ namespace XHWK.WKTool
117 117
             blackboard_canvas.UseCustomCursor = true;
118 118
             drawingAttributes.FitToCurve = true;
119 119
             drawingAttributes.IgnorePressure = false;
120
-            drawingAttributes.Width = Size;
121
-            drawingAttributes.Height = Size;
120
+            drawingAttributes.Width = PenSize;
121
+            drawingAttributes.Height = PenSize;
122 122
             drawingAttributes.Color = Color;
123 123
             blackboard_canvas.Cursor = System.Windows.Input.Cursors.Pen;
124 124
             //wfhCamera.Visibility = Visibility.Hidden;
125 125
             ImgPDFPath = null;
126 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 140
         #endregion
129 141
 
130 142
         #region 事件
@@ -611,7 +623,7 @@ namespace XHWK.WKTool
611 623
         {
612 624
             drawingAttributes.Width = 1;
613 625
             drawingAttributes.Height = 1;
614
-            Size = 1;
626
+            PenSize = 1;
615 627
         }
616 628
         /// <summary>
617 629
         /// 画笔粗细事件 中
@@ -622,7 +634,7 @@ namespace XHWK.WKTool
622 634
         {
623 635
             drawingAttributes.Width = 3;
624 636
             drawingAttributes.Height = 3;
625
-            Size = 3;
637
+            PenSize = 3;
626 638
         }
627 639
         /// <summary>
628 640
         /// 画笔粗细事件 粗
@@ -633,7 +645,7 @@ namespace XHWK.WKTool
633 645
         {
634 646
             drawingAttributes.Width = 5;
635 647
             drawingAttributes.Height = 5;
636
-            Size = 5;
648
+            PenSize = 5;
637 649
         }
638 650
         /// <summary>
639 651
         /// 登陆事件
@@ -2147,7 +2159,7 @@ namespace XHWK.WKTool
2147 2159
             {
2148 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,7 +2300,7 @@ namespace XHWK.WKTool
2288 2300
                     Dispatcher.Invoke(new Action(() =>
2289 2301
                     {
2290 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
 

正在加载...
取消
保存