Bladeren bron

主页面样式

tags/录制修改前
zhangxueyang 4 jaren geleden
bovenliggende
commit
c82b723daf

+ 39
- 1
Common/system/BlackboardNew.cs Bestand weergeven

@@ -287,7 +287,7 @@ namespace Common.system
287 287
                     stylusPoint.X = 581;
288 288
                     stylusPoint.Y = 213;
289 289
                     stylusPoints.Add(stylusPoint);
290
-                     stroke = new Stroke(stylusPoints);
290
+                    stroke = new Stroke(stylusPoints);
291 291
 
292 292
                     stylusPoint.X = 586;
293 293
                     stylusPoint.Y = 214;
@@ -316,6 +316,44 @@ namespace Common.system
316 316
                     m_canvas.Strokes.Add(stroke);
317 317
                 }
318 318
             }
319
+        }
320
+        StylusPointCollection stylusPoints = new StylusPointCollection();
321
+        StylusPoint stylusPoint = new StylusPoint();
322
+        Stroke stroke;
323
+        public void changepages(double _x, double _y, bool _new)
324
+        {
325
+            if (_new)
326
+            {
327
+                if(stroke!=null&&stroke.StylusPoints.Count > 1)
328
+                {
329
+                    m_canvas.Strokes.Add(stroke);
330
+                   
331
+                }
332
+            
333
+                stylusPoints = new StylusPointCollection();
334
+                stylusPoint = new StylusPoint();
335
+                //stroke = new Stroke(stylusPoints);
336
+                stroke=null;
337
+            }
338
+            else
339
+            {
340
+                //stylusPoints = new StylusPointCollection();
341
+                //stylusPoint = new StylusPoint();
342
+                stylusPoint.X = _x;
343
+                stylusPoint.Y = _y;
344
+                stylusPoints.Add(stylusPoint);
345
+                stroke = new Stroke(stylusPoints);
346
+            }
347
+           
348
+
349
+            //page.lines.Last().lines_curr.Add();
350
+            //if (stroke.StylusPoints.Count > 20)
351
+            //{
352
+              
353
+            
354
+
355
+
356
+
319 357
         }
320 358
     }
321 359
 }

+ 1
- 1
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs Bestand weergeven

@@ -107,7 +107,7 @@ namespace XHWK.WKTool
107 107
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
108 108
                 //APP.W_XHMicroLessonSystemWindow .Topmost = true;
109 109
             }
110
-            APP.W_XHMicroLessonSystemWindow.Show();
110
+            APP.W_XHMicroLessonSystemWindow.ShowDialog();
111 111
             this.Hide();
112 112
         }
113 113
         /// <summary>

+ 19
- 18
XHWK.WKTool/XHMicroLessonSystemWindow.xaml Bestand weergeven

@@ -7,14 +7,15 @@
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="XHMicroLessonSystemWindow" Height="930" Width="1162.5" WindowStartupLocation="CenterOwner"
11
-    WindowStyle="None" Background="#EFF1F8"   AllowsTransparency="True" 
12
-    ShowInTaskbar="False">
10
+        Title="XHMicroLessonSystemWindow" Height="1040.8" Width="875" WindowStartupLocation="CenterScreen"
11
+    WindowStyle="None"    AllowsTransparency="True"  Background="#EFF1F8"
12
+   >
13
+    
13 14
     <Viewbox>
14
-        <Grid Height="930" Width="1162.5">
15
+        <Grid Height="1040.8" Width="875">
15 16
             <!--分3行-->
16 17
             <Grid.RowDefinitions>
17
-                <RowDefinition Height="106"/>
18
+                <RowDefinition Height="94"/>
18 19
                 <RowDefinition Height="*"/>
19 20
                 <RowDefinition Height="30"/>
20 21
             </Grid.RowDefinitions>
@@ -24,18 +25,18 @@
24 25
                     <RowDefinition Height="auto"/>
25 26
                 </Grid.RowDefinitions>
26 27
                 <!--第一行-->
27
-                <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="10,10,10,0">
28
+                <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="10,2,10,0">
28 29
                     <Image Source="./Images/microLessonSystem_0.png"/>
29 30
                     <TextBlock Text="星火微课系统" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"/>
30 31
                 </StackPanel>
31
-                <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,10,10,0">
32
+                <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,2,10,0">
32 33
                     <Button Cursor="Hand" x:Name="btnLoginType" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,10,0" Click="BtnLoginType_Click">
33 34
                         <StackPanel Orientation="Horizontal">
34 35
                             <Image Source="./Images/microLessonSystem_9.png"/>
35 36
                             <TextBlock x:Name="txbLoginType" Text="未登录" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"/>
36 37
                         </StackPanel>
37 38
                     </Button>
38
-                    <Button Cursor="Hand" x:Name="btnShrink" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
39
+                    <Button Cursor="Hand" x:Name="btnShrink" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnShrink_Click">
39 40
                         <Image Source="./Images/microLessonSystem_19.png"/>
40 41
                     </Button>
41 42
                     <Button Cursor="Hand" x:Name="btnEnlarge" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="8,0,8,0">
@@ -46,7 +47,7 @@
46 47
                     </Button>
47 48
                 </StackPanel>
48 49
                 <!--第二行-->
49
-                <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,10,0,0">
50
+                <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,2,0,0">
50 51
                     <Button Cursor="Hand" x:Name="btnScreenRecording" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnScreenRecording_Click">
51 52
                         <StackPanel Orientation="Vertical">
52 53
                             <Image x:Name="ImgScreenRecording" Source="./Images/microLessonSystem_2.png"/>
@@ -122,7 +123,7 @@
122 123
                 </StackPanel>
123 124
             </Grid>
124 125
             <!--主内容-->
125
-            <Grid Grid.Row="1" x:Name="GridMain"  Margin="20,0,20,0" Background="#FFFFFF" Height="793.700787401575" Width="1142.51968503937" Visibility="Visible">
126
+            <Grid Grid.Row="1" x:Name="GridMain"  Margin="0,0,0,0" Background="#FFFFFF" Width="635" Height="914" Visibility="Visible">
126 127
                 <Label Content="" Grid.Column="0" Height="1" Width="1" Background="#FF0F0F0F" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="1,0,0,0"/>
127 128
                 <Grid>
128 129
                     <Border Grid.Row="1"  CornerRadius="5">
@@ -152,9 +153,9 @@
152 153
                 <!--<wfi:WindowsFormsHost Grid.Row="0" Grid.Column="1" x:Name="wfhCamera" Height="124" Width="172" HorizontalAlignment="Right" Margin="0,10,30.10,0" VerticalAlignment="Top">
153 154
                     <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />
154 155
                 </wfi:WindowsFormsHost>-->
155
-                <Image x:Name="imgPlayer" Width="172" Height="124"  HorizontalAlignment="Right" Margin="0,10,30.10,0" VerticalAlignment="Top"/>
156
+                <Image x:Name="imgPlayer" Width="172" Height="124"  HorizontalAlignment="Right" Margin="0,7,10,0" VerticalAlignment="Top" Visibility="Collapsed"/>
156 157
                 <StackPanel Grid.Row="0" Orientation="Horizontal" Background="#FFFFFF" Width="180" HorizontalAlignment="Right"
157
-            Height="58" Margin="0,718,50,0" Grid.Column="1">
158
+            Height="58" Margin="0,830,20,0" Grid.Column="1">
158 159
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
159 160
                     x:Name="last_button"
160 161
                     Width="60"
@@ -198,8 +199,8 @@
198 199
                     </Button>
199 200
                 </StackPanel>
200 201
 
201
-                <Label Content="" Grid.Column="1" Height="1" Width="1" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,21,0"/>
202
-                <Label Content="" Grid.Column="1" Height="1" Width="1" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,21,0"/>
202
+                <Label Content="" Grid.Column="1" Height="1" Width="1" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,2,0"/>
203
+                <Label Content="" Grid.Column="1" Height="1" Width="1" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,2,0"/>
203 204
             </Grid>
204 205
             <!--设置-->
205 206
             <Grid Grid.Row="1" x:Name="gridSetUp" Margin="20,0,20,0" Background="#FFFFFF" Visibility="Collapsed">
@@ -215,7 +216,7 @@
215 216
                 </Grid.RowDefinitions>
216 217
                 <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,30,0,0">
217 218
                     <TextBlock Text="   点阵笔" FontSize="16" Foreground="#2D8CF0"/>
218
-                    <TextBlock Text="未连接" FontSize="14" Foreground="#333333" Padding="10,0,0,0"/>
219
+                    <TextBlock x:Name="txbNotConnecteds"  Text="未连接" FontSize="14" Foreground="#333333" Padding="10,0,0,0"/>
219 220
                 </StackPanel>
220 221
                 <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Left">
221 222
                     <TextBlock Text="视频格式" FontSize="16" Foreground="#2D8CF0"/>
@@ -239,10 +240,10 @@
239 240
                     <TextBlock x:Name="txbFilePath" Text="文件路径" FontSize="16" Foreground="#2D8CF0" Padding="2,36,10,0"/>
240 241
                     <!--输入框-->
241 242
                     <Border Background="#CDD6E0" Width="525" Height="43" CornerRadius="3">
242
-                        <TextBox x:Name="txbStoragePath" Text="D:\" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="523" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
243
+                        <Label x:Name="txbStoragePath" Content="D:\" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="523" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
243 244
                     </Border>
244 245
                     <!--浏览按钮-->
245
-                    <Button Cursor="Hand" x:Name="btnBrowse" Content="浏览" FontSize="18" Width="80" Height="43" Margin="18,0,0,0" Click="BtnBrowse_Click">
246
+                    <Button Cursor="Hand" x:Name="btnBrowse" Content="打开" FontSize="18" Width="80" Height="43" Margin="18,0,0,0" Click="BtnBrowse_Click">
246 247
                         <Button.Template>
247 248
                             <ControlTemplate TargetType="{x:Type Button}">
248 249
                                 <Border
@@ -285,7 +286,7 @@
285 286
                     </Button.Template>
286 287
                 </Button>
287 288
             </Grid>
288
-            <Grid Grid.Row="2">
289
+            <Grid Grid.Row="2" Background="#EFF1F8">
289 290
                 <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
290 291
                     <TextBlock Text="颜色:" FontSize="14" Padding="5,5,0,0"/>
291 292
                     <Button Cursor="Hand" x:Name="btnWhite" Background="#FFFFFF" Width="20" Height="20" Click="BtnWhite_Click"/>

+ 89
- 50
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Bestand weergeven

@@ -64,7 +64,7 @@ namespace XHWK.WKTool
64 64
             APP.pageData.currpage = 1;
65 65
             DataContext = APP.pageData;
66 66
 
67
-            txbStoragePath.Text = FileToolsCommon.GetConfigValue("VideoType");
67
+            txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoType");
68 68
             if (FileToolsCommon.GetConfigValue("IsSound").Equals("true"))
69 69
             {
70 70
                 rbnY.IsChecked = true;
@@ -73,7 +73,7 @@ namespace XHWK.WKTool
73 73
             {
74 74
                 rbnN.IsChecked = true;
75 75
             }
76
-            txbStoragePath.Text = FileToolsCommon.GetConfigValue("VideoSavePath");
76
+            txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoSavePath");
77 77
             Initialize();
78 78
             InitPen();
79 79
         }
@@ -134,7 +134,7 @@ namespace XHWK.WKTool
134 134
             if (CameraHelper.CameraDevices.Count > 0)
135 135
             {
136 136
                 CameraHelper.SetCameraDevice(0);
137
-                //wfhCamera.Visibility = Visibility.Hidden;
137
+                imgPlayer.Visibility = Visibility.Visible;
138 138
                 RbnOpen = new List<string>();
139 139
                 times = new System.Timers.Timer(200);//设置执行一次(false)还是一直执行(true)
140 140
                 times.AutoReset = true;//设置是否执行System.Timers.Timer.Elapsed事件
@@ -143,11 +143,8 @@ namespace XHWK.WKTool
143 143
 
144 144
                 IsRbnOpen = true;
145 145
             }
146
-
147
-        
148 146
         }
149 147
 
150
-
151 148
         int I = 9999;
152 149
         private void Times_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
153 150
         {
@@ -157,17 +154,17 @@ namespace XHWK.WKTool
157 154
                 {
158 155
                     Dispatcher.Invoke(() =>
159 156
                     {
160
-                        if(I>10006)
157
+                        if(I>10010)
161 158
                         {
159
+                            long time = Timestamp();
162 160
                             //string FilePathName = ImgPath + RsImgName.Count + ".png";
163
-                            string path = CameraHelper.CaptureImage(@"G:\103", I.ToString());
161
+                            string path = CameraHelper.CaptureImage(@"G:\103", time.ToString());
164 162
                             if (!string.IsNullOrWhiteSpace(path))
165 163
                             {
166 164
                                 RbnOpen.Add(path);
167 165
                                 imgPlayer.Source = new BitmapImage(new Uri(path));
168 166
                             }
169 167
                         }
170
-                     
171 168
                         I++;
172 169
                     });
173 170
                 }
@@ -185,8 +182,9 @@ namespace XHWK.WKTool
185 182
         private void RbnTurnOff_Click(object sender, RoutedEventArgs e)
186 183
         {
187 184
             IsRbnOpen = false;
188
-            //wfhCamera.Visibility = Visibility.Hidden;
185
+            imgPlayer.Visibility = Visibility.Hidden;
189 186
             CameraHelper.CloseDevice();
187
+            I = 9999;
190 188
         } 
191 189
         #endregion
192 190
         #endregion
@@ -255,33 +253,33 @@ namespace XHWK.WKTool
255 253
         /// <param name="e"></param>
256 254
         private void BtnSave_Click(object sender, RoutedEventArgs e)
257 255
         {
258
-            #region 合法性判断
259
-            if (string.IsNullOrWhiteSpace(txbStoragePath.Text.Trim()))
260
-            {
261
-                System.Windows.MessageBox.Show("路径不可为空!");
262
-                return;
263
-            }
264
-            string temp = FileToolsCommon.GetLegalPath(txbStoragePath.Text) + APP.WKData.WkName.Trim() + "/";
265
-            if (!APP.WKData.WkPath.Equals(temp))
266
-            {
267
-                APP.WKData.WkPath = FileToolsCommon.GetLegalPath(txbStoragePath.Text) + APP.WKData.WkName.Trim() + "/";
268
-                if (FileToolsCommon.IsExistDirectory(APP.WKData.WkPath))
269
-                {
270
-                    //微课已存在
271
-                    MessageBoxResult dr = System.Windows.MessageBox.Show("讲解已存在是否覆盖?", "提示", MessageBoxButton.OKCancel);
272
-                    if (dr == MessageBoxResult.OK)
273
-                    {
274
-                        FileToolsCommon.DeleteDirectory(APP.WKData.WkPath);
275
-                    }
276
-                    else
277
-                    {
278
-                        return;
279
-                    }
280
-                }
281
-                //创建文件夹
282
-                FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
283
-            }
284
-            #endregion
256
+            //#region 合法性判断
257
+            //if (string.IsNullOrWhiteSpace(txbStoragePath.Text.Trim()))
258
+            //{
259
+            //    System.Windows.MessageBox.Show("路径不可为空!");
260
+            //    return;
261
+            //}
262
+            //string temp = FileToolsCommon.GetLegalPath(txbStoragePath.Text) + APP.WKData.WkName.Trim() + "/";
263
+            //if (!APP.WKData.WkPath.Equals(temp))
264
+            //{
265
+            //    APP.WKData.WkPath = FileToolsCommon.GetLegalPath(txbStoragePath.Text) + APP.WKData.WkName.Trim() + "/";
266
+            //    if (FileToolsCommon.IsExistDirectory(APP.WKData.WkPath))
267
+            //    {
268
+            //        //微课已存在
269
+            //        MessageBoxResult dr = System.Windows.MessageBox.Show("讲解已存在是否覆盖?", "提示", MessageBoxButton.OKCancel);
270
+            //        if (dr == MessageBoxResult.OK)
271
+            //        {
272
+            //            FileToolsCommon.DeleteDirectory(APP.WKData.WkPath);
273
+            //        }
274
+            //        else
275
+            //        {
276
+            //            return;
277
+            //        }
278
+            //    }
279
+            //    //创建文件夹
280
+            //    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
281
+            //}
282
+            //#endregion
285 283
 
286 284
 
287 285
             if (rbnMP4.IsChecked == true)
@@ -317,6 +315,7 @@ namespace XHWK.WKTool
317 315
         {
318 316
             GridMain.Visibility = Visibility.Collapsed;
319 317
             gridSetUp.Visibility = Visibility.Visible;
318
+            txbStoragePath.Content = APP.WKData.WkPath;
320 319
         }
321 320
         /// <summary>
322 321
         /// 设置 浏览事件
@@ -325,20 +324,25 @@ namespace XHWK.WKTool
325 324
         /// <param name="e"></param>
326 325
         private void BtnBrowse_Click(object sender, RoutedEventArgs e)
327 326
         {
328
-            string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
329
-            Ofd = new System.Windows.Forms.FolderBrowserDialog();
330 327
 
331
-            Result = Ofd.ShowDialog();
332
-            if (Result == System.Windows.Forms.DialogResult.OK)
333
-            {
334
-                if (Ofd.SelectedPath != "")
335
-                {
336
-                    txbStoragePath.Text = Ofd.SelectedPath;
337
-                    //string ApplicationData = ZConfig.dataPath + "fileStorageAddress.txt";
338
-                    //string temp = ofd.SelectedPath;
339
-                    //System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
340
-                }
341
-            }
328
+
329
+            System.Diagnostics.Process.Start(APP.WKData.WkPath);
330
+            //string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
331
+            //Ofd = new System.Windows.Forms.FolderBrowserDialog();
332
+
333
+            //Result = Ofd.ShowDialog();
334
+            //if (Result == System.Windows.Forms.DialogResult.OK)
335
+            //{
336
+            //    if (Ofd.SelectedPath != "")
337
+            //    {
338
+
339
+
340
+            //        //txbStoragePath.Text = Ofd.SelectedPath;
341
+            //        //string ApplicationData = ZConfig.dataPath + "fileStorageAddress.txt";
342
+            //        //string temp = ofd.SelectedPath;
343
+            //        //System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
344
+            //    }
345
+            //}
342 346
         }
343 347
         /// <summary>
344 348
         /// 画笔颜色事件 白色
@@ -1439,6 +1443,7 @@ namespace XHWK.WKTool
1439 1443
                 //labPenStatus.Text = "PenDown";
1440 1444
                 isPenDown = true;
1441 1445
             }
1446
+            //myblackboard.changepages(0, 0, true);
1442 1447
         }
1443 1448
 
1444 1449
         /// <summary>
@@ -1469,6 +1474,11 @@ namespace XHWK.WKTool
1469 1474
                 //}
1470 1475
                 stroke.Clear();
1471 1476
             }
1477
+            Dispatcher.Invoke(new Action(() =>
1478
+            {
1479
+                myblackboard.changepages(0, 0, true);
1480
+            }));
1481
+          
1472 1482
         }
1473 1483
 
1474 1484
         /// <summary>
@@ -1488,6 +1498,12 @@ namespace XHWK.WKTool
1488 1498
             {
1489 1499
                 APP.PenSerial = penSerial;
1490 1500
                 APP.PenStatus = false;
1501
+           
1502
+                Dispatcher.Invoke(new Action(() =>
1503
+                {
1504
+                    txbNotConnected.Text = "未连接";
1505
+                    txbNotConnecteds.Text = "未连接";
1506
+                }));
1491 1507
             }
1492 1508
         }
1493 1509
 
@@ -1514,6 +1530,12 @@ namespace XHWK.WKTool
1514 1530
 
1515 1531
                 //开始接收笔数据
1516 1532
                 APP.digitalPen.GetPenData(penSerial);
1533
+                Dispatcher.Invoke(new Action(() =>
1534
+                {
1535
+                    txbNotConnected.Text = "已连接";
1536
+                    txbNotConnecteds.Text = "已连接";
1537
+                }));
1538
+              
1517 1539
             }
1518 1540
         }
1519 1541
         /// <summary>
@@ -1589,7 +1611,12 @@ namespace XHWK.WKTool
1589 1611
                 double testY=(double)cy * PropH;
1590 1612
                 //pageSerial //点阵IP地址  与打印的页面关联
1591 1613
 
1614
+                Dispatcher.Invoke(new Action(() =>
1615
+                {
1616
+                    myblackboard.changepages(testX, testY,false);
1617
+                }));
1592 1618
 
1619
+             
1593 1620
                 ////每3个点画一条曲线
1594 1621
                 //if (stroke.Count % 3 == 0)
1595 1622
                 //{
@@ -1654,5 +1681,17 @@ namespace XHWK.WKTool
1654 1681
                 APP.digitalPen.SetPenHoverMode(false, penSerial);
1655 1682
         }
1656 1683
         #endregion
1684
+        /// <summary>
1685
+        /// 最小化
1686
+        /// </summary>
1687
+        /// <param name="sender"></param>
1688
+        /// <param name="e"></param>
1689
+        private void BtnShrink_Click(object sender, RoutedEventArgs e)
1690
+        {
1691
+            if(Visibility== Visibility.Hidden)
1692
+            Visibility = Visibility.Visible;
1693
+            else
1694
+                Visibility = Visibility.Hidden;
1695
+        }
1657 1696
     }
1658 1697
 }

Laden…
Annuleren
Opslaan