瀏覽代碼

布局调整。

tags/录制修改前
zhangxueyang 4 年之前
父節點
當前提交
3a07f6d693
共有 3 個檔案被更改,包括 202 行新增150 行删除
  1. 2
    2
      XHWK.Model/Model_Page.cs
  2. 71
    66
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml
  3. 129
    82
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

+ 2
- 2
XHWK.Model/Model_Page.cs 查看文件

@@ -14,7 +14,7 @@ namespace XHWK.Model
14 14
         /// <summary>
15 15
         /// 总页码
16 16
         /// </summary>
17
-        private int _pagenum = 1;
17
+        private int _pagenum = 0;
18 18
 
19 19
         /// <summary>
20 20
         /// 总页码
@@ -28,7 +28,7 @@ namespace XHWK.Model
28 28
         /// <summary>
29 29
         /// 当前页 从1开始
30 30
         /// </summary>
31
-        private int _currpage = 1;// 从1开始
31
+        private int _currpage = 0;// 从1开始
32 32
 
33 33
         /// <summary>
34 34
         /// 当前页 从1开始

+ 71
- 66
XHWK.WKTool/XHMicroLessonSystemWindow.xaml 查看文件

@@ -7,17 +7,17 @@
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="1040.8" Width="875" WindowStartupLocation="CenterScreen"
10
+        Title="星火微课系统" Height="725.8" Width="975" WindowStartupLocation="CenterScreen"
11 11
     WindowStyle="None"    AllowsTransparency="True"  Background="#EFF1F8" ShowInTaskbar="True"
12 12
    >
13 13
     
14 14
     <Viewbox>
15
-        <Grid Height="1040.8" Width="875">
15
+        <Grid Height="725.8" Width="975">
16 16
             <!--分3行-->
17 17
             <Grid.RowDefinitions>
18
-                <RowDefinition Height="94"/>
18
+                <RowDefinition Height="110"/>
19 19
                 <RowDefinition Height="*"/>
20
-                <RowDefinition Height="30"/>
20
+                <RowDefinition Height="40"/>
21 21
             </Grid.RowDefinitions>
22 22
             <Grid Grid.Row="0" Background="#2D8CF0" MouseLeftButtonDown="Window_MouseLeftButtonDown" Margin="0,0,0,0">
23 23
                 <Grid.RowDefinitions>
@@ -47,40 +47,40 @@
47 47
                     </Button>
48 48
                 </StackPanel>
49 49
                 <!--第二行-->
50
-                <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,2,0,0">
50
+                <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,6,0,0">
51 51
                     <Button Cursor="Hand" x:Name="btnScreenRecording" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnScreenRecording_Click">
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
-                            <TextBlock x:Name="TxbRecordScreenWord" Text="录屏" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
55
+                            <TextBlock x:Name="TxbRecordScreenWord" Text="录屏" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
56 56
                         </StackPanel>
57 57
                     </Button>
58 58
                     <Button Cursor="Hand" x:Name="btnScreenshot" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,30,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
-                            <TextBlock Text="截图" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
62
+                            <TextBlock Text="截图" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
63 63
                         </StackPanel>
64 64
                     </Button>
65 65
                     <Button Cursor="Hand" x:Name="btnImport" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnImport_Click">
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
-                            <TextBlock Text="导入" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
69
+                            <TextBlock Text="导入" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
70 70
                         </StackPanel>
71 71
                     </Button>
72 72
                     <Button Cursor="Hand" x:Name="BtnRecord" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="60,0,30,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
-                            <TextBlock x:Name="TxbRecordingWord" Text="录制" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
76
+                            <TextBlock x:Name="TxbRecordingWord" Text="录制" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
77 77
                         </StackPanel>
78 78
                     </Button>
79 79
                     <Button Cursor="Hand" x:Name="btnStop" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnStop_Click">
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"/>
83
-                            <TextBlock Text="停止" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
83
+                            <TextBlock Text="停止" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
84 84
                         </StackPanel>
85 85
                     </Button>
86 86
                 </StackPanel>
@@ -89,74 +89,82 @@
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
-                            <TextBlock Text="增加" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
92
+                            <TextBlock Text="增加" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
93 93
                         </StackPanel>
94 94
                     </Button>
95 95
                     <Button Cursor="Hand" x:Name="btnPrint" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,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
-                            <TextBlock Text="打印" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
99
+                            <TextBlock Text="打印" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
100 100
                         </StackPanel>
101 101
                     </Button>
102 102
                     <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click">
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
-                            <TextBlock Text="上传" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
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}}" Click="BtnSetUp_Click">
109
+                    <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,0,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"/>
113
-                            <TextBlock Text="设置" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
113
+                            <TextBlock Text="设置" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
114 114
                         </StackPanel>
115 115
                     </Button>
116 116
                 </StackPanel>
117 117
             </Grid>
118 118
             <!--主内容-->
119
-            <Grid Grid.Row="1" x:Name="GridMain"  Margin="0,0,0,0" Background="#FFFFFF" Width="635" Height="914" Visibility="Visible">
120
-                <Label Content="" Grid.Column="0" Height="1" Width="1" Background="#FF0F0F0F" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="1,0,0,0"/>
121
-                <Grid>
122
-                    <Border Grid.Row="1"  CornerRadius="5">
123
-                        <Grid x:Name="IMG" Margin="0,0,0,0">
124
-                            <Grid.Resources>
125
-                                <TransformGroup x:Key="Imageview">
126
-                                    <ScaleTransform/>
127
-                                    <TranslateTransform/>
128
-                                </TransformGroup>
119
+            <ScrollViewer Grid.Row="1"  Height="585" VerticalScrollBarVisibility="Visible">
120
+                <Grid Grid.Row="1" x:Name="GridMain"  Margin="0,0,0,0" Background="#FFFFFF" Width="793.700787401575" Height="1142.51968503937" Visibility="Visible">
121
+               
122
+                    <Grid>
123
+                        <Border Grid.Row="1"  CornerRadius="5">
124
+                            <Grid x:Name="IMG" Margin="0,0,0,0">
125
+                                <Grid.Resources>
126
+                                    <TransformGroup x:Key="Imageview">
127
+                                        <ScaleTransform/>
128
+                                        <TranslateTransform/>
129
+                                    </TransformGroup>
129 130
                                 </Grid.Resources>
130
-                                <Label Content="" Grid.Column="0" HorizontalAlignment="Left" Height="1" VerticalAlignment="Top" Width="1" Background="#FF0F0F0F" Margin="1,0,0,0"/>
131
+                                <Label Content="" Grid.Column="0" HorizontalAlignment="Left" Height="10" VerticalAlignment="Top" Width="10" Background="#FF0F0F0F" Margin="1,0,0,0"/>
131 132
                                 <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled"   Cursor="SizeAll"
132 133
                   Margin="0,0,0,0" Focusable="False" x:Name="BackFrame">
133
-                                <ContentControl  MouseLeftButtonDown="IMG1_MouseLeftButtonDown"   
134
+                                    <ContentControl  MouseLeftButtonDown="IMG1_MouseLeftButtonDown"   
134 135
                              MouseLeftButtonUp="IMG1_MouseLeftButtonUp"
135 136
                              MouseMove="IMG1_MouseMove"
136 137
                              MouseWheel="IMG1_MouseWheel" >
137
-                                    <Image Name="imgCanvas" Width="635" Height="auto" Stretch="Uniform" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}">
138
-                                    </Image>
139
-                                </ContentControl>
140
-                            </ScrollViewer>
141
-                        </Grid>
142
-                    </Border>
143
-                </Grid>
144
-                <Image x:Name="imgDocumentation"/>
145
-                <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
146
-                <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
147
-                <!--摄像头-->
148
-                <!--<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">
138
+                                        <Image Name="imgCanvas" Width="635" Height="auto" Stretch="Uniform" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}">
139
+                                        </Image>
140
+                                    </ContentControl>
141
+                                </ScrollViewer>
142
+                            </Grid>
143
+                        </Border>
144
+                    </Grid>
145
+                    <Image x:Name="imgDocumentation"/>
146
+                    <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
147
+                    <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
148
+                    <!--摄像头-->
149
+                    <!--<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">
149 150
                     <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />
150 151
                 </wfi:WindowsFormsHost>-->
151
-                <Image x:Name="imgPlayerLeft" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
152
-                <Image x:Name="imgPlayerRight" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
153
-                <Image x:Name="imgPlayerLeftUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
154
-                <Image x:Name="imgPlayerRightUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right" Margin="10,7,10,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
152
+                    <Image x:Name="imgPlayerLeft" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
153
+                    <Image x:Name="imgPlayerRight" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
154
+                    <Image x:Name="imgPlayerLeftUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
155
+                    <Image x:Name="imgPlayerRightUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right" Margin="10,7,10,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
156
+
157
+                    <Label Content="" Grid.Column="0" Height="10" Width="10" Background="#FF0F0F0F" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="1,0,0,0"/>
158
+                    <Label Content="" Grid.Column="1" Height="10" Width="10" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,2,0"/>
159
+                    <Label Content="" Grid.Column="1" Height="10" Width="10" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,2,0"/>
160
+                </Grid>
161
+            </ScrollViewer>
162
+            <Grid Grid.Row="1">
155 163
                 <StackPanel Grid.Row="0" Orientation="Horizontal" Background="#FFFFFF" Width="180" HorizontalAlignment="Center"
156
-            Height="58" Margin="0,830,20,0" Grid.Column="1">
164
+            Height="58" Margin="0,500,0,0" Grid.Column="1">
157 165
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
158 166
                     x:Name="last_button"
159
-                    Width="60"
167
+                    Width="60" Height="60"
160 168
                     Click="last_button_Click">
161 169
                         <Button.Content>
162 170
                             <StackPanel>
@@ -180,7 +188,7 @@
180 188
                     </Grid>
181 189
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
182 190
                     x:Name="next_btn"
183
-                    Width="60"
191
+                    Width="60" Height="60"
184 192
                     Click="next_btn_Click">
185 193
                         <Button.Content>
186 194
                             <StackPanel>
@@ -189,9 +197,6 @@
189 197
                         </Button.Content>
190 198
                     </Button>
191 199
                 </StackPanel>
192
-
193
-                <Label Content="" Grid.Column="1" Height="1" Width="1" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,2,0"/>
194
-                <Label Content="" Grid.Column="1" Height="1" Width="1" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,2,0"/>
195 200
             </Grid>
196 201
             <!--设置-->
197 202
             <Grid Grid.Row="1" x:Name="gridSetUp" Margin="20,0,20,0" Background="#FFFFFF" Visibility="Collapsed">
@@ -277,26 +282,26 @@
277 282
                     </Button.Template>
278 283
                 </Button>
279 284
             </Grid>
280
-            <Grid Grid.Row="2" Background="#EFF1F8">
281
-                <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
282
-                    <TextBlock Text="颜色:" FontSize="14" Padding="5,5,0,0"/>
283
-                    <Button Cursor="Hand" x:Name="btnWhite" Background="#FFFFFF" Width="20" Height="20" Click="BtnWhite_Click"/>
284
-                    <Button Cursor="Hand" x:Name="btnRed" Background="#FF0000" Width="20" Height="20" Margin="5,0,0,0" Click="BtnRed_Click"/>
285
-                    <Button Cursor="Hand" x:Name="btnGray" Background="#A7A9AC" Width="20" Height="20" Margin="5,0,0,0" Click="BtnGray_Click"/>
286
-                    <Button Cursor="Hand" x:Name="btnCyanBlue" Background="#63D600" Width="20" Height="20" Margin="5,0,0,0" Click="BtnCyanBlue_Click"/>
287
-                    <Button Cursor="Hand" x:Name="btnYellow" Background="#FFBC00" Width="20" Height="20" Margin="5,0,0,0" Click="BtnYellow_Click"/>
288
-                    <Button Cursor="Hand" x:Name="btnBlue" Background="#00B4FC" Width="20" Height="20" Margin="5,0,0,0" Click="BtnBlue_Click"/>
289
-                    <TextBlock Text="粗细:" FontSize="14" Padding="15,5,0,0" Margin="5,0,0,0"/>
290
-                    <RadioButton Cursor="Hand" x:Name="rbnFine" Content="细" FontSize="14" Margin="0,5,0,0" IsChecked="True" Click="RbnFine_Click"/>
291
-                    <RadioButton Cursor="Hand" x:Name="rbnIn" Content="中" FontSize="14" Margin="5,5,0,0" Click="RbnIn_Click"/>
292
-                    <RadioButton Cursor="Hand" x:Name="rbnCrude" Content="粗" FontSize="14" Margin="5,5,0,0" Click="RbnCrude_Click"/>
285
+            <Grid Grid.Row="2" Background="#EFF1F8" Margin="0,2,0,0">
286
+                <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
287
+                    <TextBlock Text="颜色:" FontSize="14" Padding="10,10,0,0"/>
288
+                    <Button Cursor="Hand" x:Name="btnWhite" Background="#FFFFFF" Width="20" Height="20" Click="BtnWhite_Click" Margin="0,2,0,0"/>
289
+                    <Button Cursor="Hand" x:Name="btnRed" Background="#FF0000" Width="20" Height="20" Margin="5,2,0,0" Click="BtnRed_Click"/>
290
+                    <Button Cursor="Hand" x:Name="btnGray" Background="#A7A9AC" Width="20" Height="20" Margin="5,2,0,0" Click="BtnGray_Click"/>
291
+                    <Button Cursor="Hand" x:Name="btnCyanBlue" Background="#63D600" Width="20" Height="20" Margin="5,2,0,0" Click="BtnCyanBlue_Click"/>
292
+                    <Button Cursor="Hand" x:Name="btnYellow" Background="#FFBC00" Width="20" Height="20" Margin="5,2,0,0" Click="BtnYellow_Click"/>
293
+                    <Button Cursor="Hand" x:Name="btnBlue" Background="#00B4FC" Width="20" Height="20" Margin="5,2,0,0" Click="BtnBlue_Click"/>
294
+                    <TextBlock Text="粗细:" FontSize="14" Padding="15,5,0,0" Margin="5,5,0,0"/>
295
+                    <RadioButton Cursor="Hand" x:Name="rbnFine" Content="细" FontSize="14" Margin="0,10,0,0" IsChecked="True" Click="RbnFine_Click"/>
296
+                    <RadioButton Cursor="Hand" x:Name="rbnIn" Content="中" FontSize="14" Margin="5,10,0,0" Click="RbnIn_Click"/>
297
+                    <RadioButton Cursor="Hand" x:Name="rbnCrude" Content="粗" FontSize="14" Margin="5,10,0,0" Click="RbnCrude_Click"/>
293 298
                     <StackPanel Orientation="Horizontal">
294
-                        <TextBlock Text="摄像头:" FontSize="14" Padding="15,5,0,0"/>
295
-                        <RadioButton Cursor="Hand" x:Name="rbnOpen" Content="开" FontSize="14" Margin="0,5,0,0" Click="RbnOpen_Click"/>
296
-                        <RadioButton Cursor="Hand" x:Name="rbnTurnOff" Content="关" FontSize="14" Margin="5,5,0,0" IsChecked="True" Click="RbnTurnOff_Click"/>
299
+                        <TextBlock Text="摄像头:" FontSize="14" Padding="15,10,0,0"/>
300
+                        <RadioButton Cursor="Hand" x:Name="rbnOpen" Content="开" FontSize="14" Margin="0,10,0,0" Click="RbnOpen_Click"/>
301
+                        <RadioButton Cursor="Hand" x:Name="rbnTurnOff" Content="关" FontSize="14" Margin="5,10,0,0" IsChecked="True" Click="RbnTurnOff_Click"/>
297 302
                     </StackPanel>
298 303
                 </StackPanel>
299
-                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,5,0">
304
+                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,10,0">
300 305
                     <TextBlock Text="智能笔状态:" FontSize="14" Padding="0,5,0,0"/>
301 306
                     <TextBlock x:Name="txbNotConnected" Text="未连接" FontSize="14" Padding="0,5,5,0"/>
302 307
                 </StackPanel>

+ 129
- 82
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs 查看文件

@@ -73,8 +73,8 @@ namespace XHWK.WKTool
73 73
             btnPrint.IsEnabled = false;
74 74
 
75 75
             myblackboard = new BlackboardNew(blackboard_canvas);
76
-            APP.pageData.pagenum = 1;
77
-            APP.pageData.currpage = 1;
76
+            APP.pageData.pagenum = 0;
77
+            APP.pageData.currpage = 0;
78 78
             DataContext = APP.pageData;
79 79
 
80 80
             //APP.SaveDraw();//画板模型第一页初始化
@@ -101,6 +101,13 @@ namespace XHWK.WKTool
101 101
         /// </summary>
102 102
         public void Initialize()
103 103
         {
104
+            #region 数据初始化
105
+            APP.pageData.pagenum = 0;
106
+            APP.pageData.currpage = APP.pageData.pagenum;
107
+            #endregion
108
+
109
+
110
+
104 111
             APP.CameraPosition = FileToolsCommon.GetConfigValue("CameraPosition");
105 112
             //创建 DrawingAttributes 类的一个实例  
106 113
             drawingAttributes = new DrawingAttributes();
@@ -360,7 +367,6 @@ namespace XHWK.WKTool
360 367
                         Thread.Sleep(100);
361 368
                     }
362 369
                     System.Environment.Exit(0);
363
-
364 370
                 }
365 371
                 else
366 372
                 {
@@ -686,8 +692,11 @@ namespace XHWK.WKTool
686 692
             {
687 693
                 if (!string.IsNullOrWhiteSpace(APP.ImgPath) && File.Exists(APP.ImgPath))
688 694
                 {
689
-                    //APP.JPaths[APP.pageData.currpage]= APP.ImgPath;
690
-                    //APP.JPaths[APP.pageData.currpage] = APP.ImgPath;
695
+                    if(APP.pageData.currpage==0)
696
+                    {
697
+                        APP.pageData.pagenum += 1;
698
+                        APP.pageData.currpage = APP.pageData.pagenum;
699
+                    }
691 700
                     if (APP.PageDrawList.Count >= APP.pageData.currpage)
692 701
                     {
693 702
                         APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath = APP.ImgPath;//zxycs
@@ -869,26 +878,37 @@ namespace XHWK.WKTool
869 878
                                 APP.SaveDraw();
870 879
                             }
871 880
                             myblackboard.clear();
872
-                            APP.pageData.pagenum = 1;
873
-                            APP.pageData.currpage = 1;
881
+                            APP.pageData.pagenum = 0;
882
+                            APP.pageData.currpage = 0;
874 883
                             for (int i = 0; i < APP.PageDrawList.Count; i++)
875 884
                             {
876 885
                                 APP.pageData.pagenum += 1;
877 886
                             }
878
-                            if (APP.pageData.pagenum > 1)
887
+                            //if (APP.pageData.pagenum > 1)
888
+                            //{
889
+                            //    APP.pageData.pagenum -= 1;
890
+                            //}
891
+                            if (IsStartCount && blackboard_canvas.Visibility == Visibility.Collapsed)
879 892
                             {
880
-                                APP.pageData.pagenum -= 1;
893
+                                blackboard_canvas.Visibility = Visibility.Visible;
881 894
                             }
882 895
                             if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage < APP.PageDrawList.Count)
883 896
                             {
884 897
                                 //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
885 898
                                 imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));//给当前页面展示图片
886 899
                                 imgCanvas.Source = null;
900
+                                ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
901
+                                ImgScreenshotTwo.Visibility = Visibility.Visible;
902
+                                btnScreenshot.IsEnabled = false;
887 903
                             }
888 904
                             else
889 905
                             {
890 906
                                 imgDocumentation.Source = null;
891 907
                                 imgCanvas.Source = null;
908
+                                ///截图可用
909
+                                ImgScreenshot.Visibility = Visibility.Visible;
910
+                                ImgScreenshotTwo.Visibility = Visibility.Collapsed;
911
+                                btnScreenshot.IsEnabled = true;
892 912
                             }
893 913
                         }
894 914
                         catch (Exception ex)
@@ -950,11 +970,18 @@ namespace XHWK.WKTool
950 970
                                 //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
951 971
                                 imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));//给当前页面展示图片
952 972
                                 imgCanvas.Source = null;
973
+                                ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
974
+                                ImgScreenshotTwo.Visibility = Visibility.Visible;
975
+                                btnScreenshot.IsEnabled = false;
953 976
                             }
954 977
                             else
955 978
                             {
956 979
                                 imgDocumentation.Source = null;
957 980
                                 imgCanvas.Source = null;
981
+                                ///截图可用
982
+                                ImgScreenshot.Visibility = Visibility.Visible;
983
+                                ImgScreenshotTwo.Visibility = Visibility.Collapsed;
984
+                                btnScreenshot.IsEnabled = true;
958 985
                             }
959 986
                         }
960 987
                         catch (Exception ex)
@@ -1020,7 +1047,10 @@ namespace XHWK.WKTool
1020 1047
         /// <param name="e"></param>
1021 1048
         private void BtnRecord_Click(object sender, RoutedEventArgs e)
1022 1049
         {
1023
-            blackboard_canvas.Visibility = Visibility.Visible;
1050
+            if(APP.pageData.currpage > 0)
1051
+            {
1052
+                blackboard_canvas.Visibility = Visibility.Visible;
1053
+            }
1024 1054
             StartRecord();
1025 1055
         }
1026 1056
         /// <summary>
@@ -1144,6 +1174,8 @@ namespace XHWK.WKTool
1144 1174
                 IsSuspendR = false;
1145 1175
                 //BtnRecording.Content = "暂停录制";
1146 1176
                 ImgRecord.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_23.png"));
1177
+                ImgStop.Visibility = Visibility.Collapsed;
1178
+                ImgStopTwo.Visibility = Visibility.Visible;
1147 1179
                 TxbRecordingWord.Text = "暂停";
1148 1180
                 try
1149 1181
                 {
@@ -1168,6 +1200,8 @@ namespace XHWK.WKTool
1168 1200
                 //暂停
1169 1201
                 IsSuspendR = true;
1170 1202
                 ImgRecord.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
1203
+                ImgStop.Visibility = Visibility.Visible;
1204
+                ImgStopTwo.Visibility = Visibility.Collapsed;
1171 1205
                 TxbRecordingWord.Text = "继续";
1172 1206
                 try
1173 1207
                 {
@@ -1218,6 +1252,7 @@ namespace XHWK.WKTool
1218 1252
         {
1219 1253
             if (!IsFirstR)
1220 1254
             {
1255
+                #region 恢复被禁用的按钮
1221 1256
                 ImgPrint.Visibility = Visibility.Visible;
1222 1257
                 ImgPrintTwo.Visibility = Visibility.Collapsed;
1223 1258
                 btnPrint.IsEnabled = true;
@@ -1242,9 +1277,13 @@ namespace XHWK.WKTool
1242 1277
                 ImgSetUpTwo.Visibility = Visibility.Collapsed;
1243 1278
                 btnSetUp.IsEnabled = true;
1244 1279
 
1245
-                btnLoginType.IsEnabled = true;
1280
+                btnLoginType.IsEnabled = true; 
1281
+                #endregion
1282
+
1246 1283
                 IsSuspendR = true;
1247 1284
                 ImgRecord.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
1285
+                ImgStop.Visibility = Visibility.Visible;
1286
+                ImgStopTwo.Visibility = Visibility.Collapsed;
1248 1287
                 TxbRecordingWord.Text = "已录制";
1249 1288
                 try
1250 1289
                 {
@@ -1314,26 +1353,29 @@ namespace XHWK.WKTool
1314 1353
         /// <param name="e"></param>
1315 1354
         private void BtnAdd_Click(object sender, RoutedEventArgs e)
1316 1355
         {
1317
-            if (APP.pageData.pagenum < 200)
1318
-            {
1319
-                if (APP.PageDrawList != null && APP.PageDrawList.Count > 0 && APP.PageDrawList.Count > APP.pageData.currpage - 1
1356
+                if (APP.pageData.currpage>0&&APP.PageDrawList != null && APP.PageDrawList.Count > 0 && APP.PageDrawList.Count > APP.pageData.currpage - 1
1320 1357
                     && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
1321 1358
                 {
1322 1359
                     APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
1323 1360
                 }
1361
+                if(IsStartCount&& blackboard_canvas.Visibility == Visibility.Collapsed)
1362
+                {
1363
+                    blackboard_canvas.Visibility = Visibility.Visible;
1364
+                }
1324 1365
                 APP.pageData.pagenum += 1;
1325 1366
                 APP.pageData.currpage = APP.pageData.pagenum;
1326 1367
                 myblackboard.changepage(APP.pageData.currpage - 1);
1368
+                ///清空页面图片UI
1327 1369
                 imgCanvas.Source = null;
1370
+                ///画板模型增加一页
1328 1371
                 Model_DrawData model_DrawData = new Model_DrawData();
1329 1372
                 model_DrawData.PageNum = APP.pageData.currpage;
1330 1373
                 APP.PageDrawList.Add(model_DrawData);
1331
-                APP.SaveDraw();//画板模型增加一页
1332
-            }
1333
-            else
1334
-            {
1335
-                System.Windows.Forms.MessageBox.Show("已达到最大页数无法继续增加!");
1336
-            }
1374
+                APP.SaveDraw();
1375
+            ///截图可用
1376
+            ImgScreenshot.Visibility = Visibility.Visible;
1377
+            ImgScreenshotTwo.Visibility = Visibility.Collapsed;
1378
+            btnScreenshot.IsEnabled = true;
1337 1379
         }
1338 1380
         /// <summary>
1339 1381
         /// 打印事件
@@ -1446,8 +1488,11 @@ namespace XHWK.WKTool
1446 1488
                     LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(last_button_Click)生成图片错误:" + ex.Message, ex);
1447 1489
                 }
1448 1490
                 APP.pageData.currpage -= 1;
1449
-
1450 1491
                 myblackboard.changepage(APP.pageData.currpage - 1);
1492
+                ///截图可用
1493
+                ImgScreenshot.Visibility = Visibility.Visible;
1494
+                ImgScreenshotTwo.Visibility = Visibility.Collapsed;
1495
+                btnScreenshot.IsEnabled = true;
1451 1496
                 if (APP.pageData.currpage <= APP.PageDrawList.Count)
1452 1497
                 {
1453 1498
                     if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
@@ -1462,6 +1507,9 @@ namespace XHWK.WKTool
1462 1507
                         {
1463 1508
                             imgCanvas.Source = null;
1464 1509
                             imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1510
+                            ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
1511
+                            ImgScreenshotTwo.Visibility = Visibility.Visible;
1512
+                            btnScreenshot.IsEnabled = false;
1465 1513
                         }
1466 1514
                         else
1467 1515
                         {
@@ -1484,7 +1532,6 @@ namespace XHWK.WKTool
1484 1532
                                 transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1485 1533
                                 transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1486 1534
                                 mouseDown = false;
1487
-
1488 1535
                             }
1489 1536
                         }
1490 1537
                     }
@@ -1494,10 +1541,6 @@ namespace XHWK.WKTool
1494 1541
                         imgDocumentation.Source = null;
1495 1542
                     }
1496 1543
                 }
1497
-                //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
1498
-                //{
1499
-                //    imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
1500
-                //}
1501 1544
             }
1502 1545
 
1503 1546
         }
@@ -1528,6 +1571,10 @@ namespace XHWK.WKTool
1528 1571
                 }
1529 1572
                 APP.pageData.currpage += 1;
1530 1573
                 myblackboard.changepage(APP.pageData.currpage - 1);
1574
+                ///截图可用
1575
+                ImgScreenshot.Visibility = Visibility.Visible;
1576
+                ImgScreenshotTwo.Visibility = Visibility.Collapsed;
1577
+                btnScreenshot.IsEnabled = true;
1531 1578
                 if (APP.pageData.currpage <= APP.PageDrawList.Count)
1532 1579
                 {
1533 1580
 
@@ -1541,6 +1588,9 @@ namespace XHWK.WKTool
1541 1588
                         {
1542 1589
                             imgCanvas.Source = null;
1543 1590
                             imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1591
+                            ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
1592
+                            ImgScreenshotTwo.Visibility = Visibility.Visible;
1593
+                            btnScreenshot.IsEnabled = false;
1544 1594
                         }
1545 1595
                         else
1546 1596
                         {
@@ -1564,9 +1614,6 @@ namespace XHWK.WKTool
1564 1614
                                 //var position = e.GetPosition(img);
1565 1615
                                 transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1566 1616
                                 transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1567
-
1568
-                                
1569
-
1570 1617
                                 mouseDown = false;
1571 1618
                             }
1572 1619
                         }
@@ -1879,59 +1926,59 @@ namespace XHWK.WKTool
1879 1926
                 //labPenStatus.Text = "PenDown";
1880 1927
                 isPenDown = true;
1881 1928
 
1882
-                Dispatcher.Invoke(new Action(() =>
1883
-                {
1884
-                    for (int i = 0; i < APP.PageDrawList.Count; i++)
1885
-                    {
1886
-                        if (APP.PageDrawList[i].PageCode == penSerial)
1887
-                        {
1888
-                            if (i < APP.pageData.pagenum)
1889
-                            {
1890
-                                if (i < APP.pageData.currpage)
1891
-                                {
1892
-                                    int num = APP.pageData.currpage - i;
1893
-                                    APP.pageData.currpage -= num;
1894
-                                    myblackboard.changepage(APP.pageData.currpage - 1);
1895
-                                    if (APP.PageDrawList.Count > 0)
1896
-                                    {
1897
-                                        if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && APP.pageData.currpage > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
1898
-                                        {
1899
-                                            //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
1900
-
1901
-                                            imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1902
-                                        }
1903
-                                        else
1904
-                                        {
1905
-                                            imgCanvas.Source = null;
1906
-                                        }
1907
-                                    }
1908
-                                }
1909
-                                else
1910
-                                {
1911
-                                    int num = i - APP.pageData.currpage;
1912
-                                    APP.pageData.currpage += num;
1913
-                                    myblackboard.changepage(APP.pageData.currpage - 1);
1914
-                                    if (APP.PageDrawList.Count > 0)
1915
-                                    {
1916
-
1917
-                                        if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
1918
-                                        {
1919
-                                            //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
1920
-                                            imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1921
-                                        }
1922
-                                        else
1923
-                                        {
1924
-                                            imgCanvas.Source = null;
1925
-                                        }
1926
-                                    }
1927
-                                }
1928
-                            }
1929
-                            return;
1930
-                        }
1931
-                    }
1932
-                    //myblackboard.changepages(0, 0, true);
1933
-                    //myblackboard.changepaget(0, 0, true, blackboard_canvas);
1934
-                }));
1929
+                //Dispatcher.Invoke(new Action(() =>
1930
+                //{
1931
+                //    for (int i = 0; i < APP.PageDrawList.Count; i++)
1932
+                //    {
1933
+                //        if (APP.PageDrawList[i].PageCode == penSerial)
1934
+                //        {
1935
+                //            if (i < APP.pageData.pagenum)
1936
+                //            {
1937
+                //                if (i < APP.pageData.currpage)
1938
+                //                {
1939
+                //                    int num = APP.pageData.currpage - i;
1940
+                //                    APP.pageData.currpage -= num;
1941
+                //                    myblackboard.changepage(APP.pageData.currpage - 1);
1942
+                //                    if (APP.PageDrawList.Count > 0)
1943
+                //                    {
1944
+                //                        if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && APP.pageData.currpage > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
1945
+                //                        {
1946
+                //                            //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
1947
+
1948
+                //                            imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1949
+                //                        }
1950
+                //                        else
1951
+                //                        {
1952
+                //                            imgCanvas.Source = null;
1953
+                //                        }
1954
+                //                    }
1955
+                //                }
1956
+                //                else
1957
+                //                {
1958
+                //                    int num = i - APP.pageData.currpage;
1959
+                //                    APP.pageData.currpage += num;
1960
+                //                    myblackboard.changepage(APP.pageData.currpage - 1);
1961
+                //                    if (APP.PageDrawList.Count > 0)
1962
+                //                    {
1963
+
1964
+                //                        if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
1965
+                //                        {
1966
+                //                            //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
1967
+                //                            imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1968
+                //                        }
1969
+                //                        else
1970
+                //                        {
1971
+                //                            imgCanvas.Source = null;
1972
+                //                        }
1973
+                //                    }
1974
+                //                }
1975
+                //            }
1976
+                //            return;
1977
+                //        }
1978
+                //    }
1979
+                //    //myblackboard.changepages(0, 0, true);
1980
+                //    //myblackboard.changepaget(0, 0, true, blackboard_canvas);
1981
+                //}));
1935 1982
             }
1936 1983
             //myblackboard.changepages(0, 0, true);
1937 1984
         }

Loading…
取消
儲存