Browse Source

合并

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
4a92e11ff7
2 changed files with 213 additions and 125 deletions
  1. 159
    110
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml
  2. 54
    15
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

+ 159
- 110
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

13
     <Window.Effect>
13
     <Window.Effect>
14
         <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
14
         <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
15
     </Window.Effect>
15
     </Window.Effect>
16
+    <!--<Grid>
17
+        <Border CornerRadius="0,0,0,0"
18
+                Background="White"
19
+                BorderBrush="Gray"
20
+                BorderThickness="1"
21
+                Margin="10,10,10,10">
22
+            <Border.Effect>
23
+                <DropShadowEffect Color="Gray" BlurRadius="10" ShadowDepth="0" Opacity="0.8" />
24
+            </Border.Effect>
25
+        </Border>
26
+    </Grid>-->
16
     <Window.Resources>
27
     <Window.Resources>
17
         <!--  ListBox容器样式  -->
28
         <!--  ListBox容器样式  -->
18
         <Style x:Key="ListBoxItemContainerStyle" TargetType="{x:Type ListBoxItem}">
29
         <Style x:Key="ListBoxItemContainerStyle" TargetType="{x:Type ListBoxItem}">
64
                         </Button>
75
                         </Button>
65
                     </StackPanel>
76
                     </StackPanel>
66
                 </Grid>
77
                 </Grid>
78
+
79
+
80
+                <!--分值-->
81
+                <!--
82
+                <TextBlock
83
+                    HorizontalAlignment="Center"
84
+                    VerticalAlignment="Center"
85
+                    FontSize="15"
86
+                    Text="{Binding VideoDuration}" />-->
87
+
88
+                <!--平均时长-->
67
                 <TextBlock
89
                 <TextBlock
68
                     HorizontalAlignment="Center"
90
                     HorizontalAlignment="Center"
69
                     VerticalAlignment="Center"
91
                     VerticalAlignment="Center"
75
                     VerticalAlignment="Center"
97
                     VerticalAlignment="Center"
76
                     FontSize="16"
98
                     FontSize="16"
77
                     Text="{Binding VideoTime}" />
99
                     Text="{Binding VideoTime}" />
100
+
78
                 <Grid>
101
                 <Grid>
79
                     <StackPanel Orientation="Horizontal"   HorizontalAlignment="Center"
102
                     <StackPanel Orientation="Horizontal"   HorizontalAlignment="Center"
80
                     VerticalAlignment="Center">
103
                     VerticalAlignment="Center">
104
                         </Button>
127
                         </Button>
105
                     </StackPanel>
128
                     </StackPanel>
106
                 </Grid>
129
                 </Grid>
130
+
131
+
107
             </UniformGrid>
132
             </UniformGrid>
108
         </DataTemplate>
133
         </DataTemplate>
109
     </Window.Resources>
134
     </Window.Resources>
122
             <RowDefinition Height="*"/>
147
             <RowDefinition Height="*"/>
123
             <RowDefinition Height="auto"/>
148
             <RowDefinition Height="auto"/>
124
         </Grid.RowDefinitions>
149
         </Grid.RowDefinitions>
125
-            <Grid Grid.Row="0" Background="#2D8CF0" MouseLeftButtonDown="Window_MouseLeftButtonDown" Margin="0,0,0,0" MinHeight="100px" MouseDown="Grid_MouseDown">
126
-                <Grid.RowDefinitions>
127
-                    <RowDefinition Height="auto"/>
128
-                    <RowDefinition Height="auto"/>
129
-                </Grid.RowDefinitions>
130
-                <!--第一行-->
131
-                <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="10,2,10,0">
132
-                    <Image Source="./Images/microLessonSystem_0.png"/>
133
-                    <TextBlock Text="星火微课系统" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"/>
134
-                </StackPanel>
150
+        <Grid Grid.Row="0" Background="#2D8CF0" MouseLeftButtonDown="Window_MouseLeftButtonDown" Margin="0,0,0,0" MinHeight="100px" MouseDown="Grid_MouseDown">
151
+            <Grid.RowDefinitions>
152
+                <RowDefinition Height="auto"/>
153
+                <RowDefinition Height="auto"/>
154
+            </Grid.RowDefinitions>
155
+            <!--第一行-->
156
+            <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="10,2,10,0">
157
+                <Image Source="./Images/microLessonSystem_0.png"/>
158
+                <TextBlock Text="星火微课系统" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"/>
159
+            </StackPanel>
135
 
160
 
136
-                <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,2,20,0">
137
-                    <Button Cursor="Hand" x:Name="btnLoginType" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,10,0" Click="BtnLoginType_Click">
138
-                        <StackPanel Orientation="Horizontal">
139
-                            <Image Source="./Images/microLessonSystem_9.png"/>
140
-                            <TextBlock x:Name="txbLoginType" Text="未登录" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"/>
141
-                        </StackPanel>
142
-                    </Button>
143
-                    <Button Cursor="Hand" x:Name="btnShrink" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnShrink_Click" Margin="8,0,8,0">
144
-                        <Image Source="./Images/microLessonSystem_19.png"/>
145
-                    </Button>
146
-                    <!--<Button Cursor="Hand" x:Name="btnEnlarge" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="8,0,8,0">
161
+            <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,2,20,0">
162
+                <Button Cursor="Hand" x:Name="btnLoginType" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,10,0" Click="BtnLoginType_Click">
163
+                    <StackPanel Orientation="Horizontal">
164
+                        <Image Source="./Images/microLessonSystem_9.png"/>
165
+                        <TextBlock x:Name="txbLoginType" Text="未登录" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"/>
166
+                    </StackPanel>
167
+                </Button>
168
+                <Button Cursor="Hand" x:Name="btnShrink" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnShrink_Click" Margin="8,0,8,0">
169
+                    <Image Source="./Images/microLessonSystem_19.png"/>
170
+                </Button>
171
+                <!--<Button Cursor="Hand" x:Name="btnEnlarge" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="8,0,8,0">
147
                         <Image Source="./Images/microLessonSystem_8.png"/>
172
                         <Image Source="./Images/microLessonSystem_8.png"/>
148
                     </Button>-->
173
                     </Button>-->
149
-                    <Button Cursor="Hand" x:Name="btnDown" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click" >
150
-                        <Image Source="./Images/microLessonSystem_10.png"/>
151
-                    </Button>
152
-                </StackPanel>
174
+                <Button Cursor="Hand" x:Name="btnDown" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click" >
175
+                    <Image Source="./Images/microLessonSystem_10.png"/>
176
+                </Button>
177
+            </StackPanel>
153
 
178
 
154
 
179
 
155
-                <!--第二行-->
180
+            <!--第二行-->
156
 
181
 
157
-                <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,0,0,5" HorizontalAlignment="Left">
158
-                    <Button Cursor="Hand" x:Name="btnScreenRecording" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnScreenRecording_Click" Margin="30,0,0,0">
159
-                        <StackPanel Orientation="Vertical">
160
-                            <Image x:Name="ImgScreenRecording" Source="./Images/microLessonSystem_2.png"/>
161
-                            <Image x:Name="ImgScreenRecordingTwo" Source="./Images/microLessonSystem_3.png" Visibility="Collapsed"/>
162
-                            <TextBlock x:Name="TxbRecordScreenWord" Text="录屏" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
163
-                        </StackPanel>
164
-                    </Button>
165
-                    <Button Cursor="Hand" x:Name="btnScreenshot" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,0,0" Click="BtnScreenshot_Click">
166
-                        <StackPanel Orientation="Vertical">
167
-                            <Image x:Name="ImgScreenshot" Source="./Images/microLessonSystem_12.png"/>
168
-                            <Image x:Name="ImgScreenshotTwo" Source="./Images/microLessonSystem_11.png" Visibility="Collapsed"/>
169
-                            <TextBlock Text="截图" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
170
-                        </StackPanel>
171
-                    </Button>
172
-                    <Button Cursor="Hand" x:Name="btnImport" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnImport_Click" Margin="30,0,0,0">
173
-                        <StackPanel Orientation="Vertical">
174
-                            <Image x:Name="ImgImport" Source="./Images/microLessonSystem_6.png"/>
175
-                            <Image x:Name="ImgImportTwo" Source="./Images/microLessonSystem_7.png" Visibility="Collapsed"/>
176
-                            <TextBlock Text="导入" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
177
-                        </StackPanel>
178
-                    </Button>
179
-                    <Button Cursor="Hand" x:Name="BtnRecord" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="100,0,0,0" Click="BtnRecord_Click">
180
-                        <StackPanel Orientation="Vertical">
181
-                            <Image x:Name="ImgRecord" Source="./Images/microLessonSystem_14.png"/>
182
-                            <Image x:Name="ImgRecordTwo" Source="./Images/microLessonSystem_13.png" Visibility="Collapsed"/>
183
-                            <TextBlock x:Name="TxbRecordingWord" Text="录制" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
184
-                        </StackPanel>
185
-                    </Button>
186
-                    <Button Cursor="Hand" x:Name="btnStop" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnStop_Click" Margin="30,0,0,0">
187
-                        <StackPanel Orientation="Vertical">
188
-                            <Image x:Name="ImgStop" Source="./Images/microLessonSystem_21.png"/>
189
-                            <Image x:Name="ImgStopTwo" Source="./Images/microLessonSystem_20.png" Visibility="Collapsed"/>
190
-                            <TextBlock Text="停止" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
191
-                        </StackPanel>
192
-                    </Button>
193
-                    <TextBlock x:Name="txbTime" Text="" FontSize="20" Foreground="#FFFFFF" Margin="20,20,0,0"/>
194
-                </StackPanel>
195
-                <StackPanel Grid.Row="1" HorizontalAlignment="Center">
196
-                    <TextBlock x:Name="txbType" Text="" FontSize="20" Foreground="#FFFFFF" Margin="0,25,0,0"/>
197
-                </StackPanel>
198
-                <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,5">
199
-                    <Button Cursor="Hand" x:Name="btnAdd" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnAdd_Click" Margin="0,0,30,0">
200
-                        <StackPanel Orientation="Vertical">
201
-                            <Image x:Name="ImgAdd" Source="./Images/microLessonSystem_25.png" Visibility="Visible"/>
202
-                            <Image x:Name="ImgAddTwo" Source="./Images/microLessonSystem_24.png" Visibility="Collapsed"/>
203
-                            <TextBlock Text="增加" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
204
-                        </StackPanel>
205
-                    </Button>
206
-                    <Button Cursor="Hand" x:Name="btnPrint" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnPrint_Click">
207
-                        <StackPanel Orientation="Vertical">
208
-                            <Image x:Name="ImgPrint" Source="./Images/microLessonSystem_4.png" Visibility="Collapsed"/>
209
-                            <Image x:Name="ImgPrintTwo" Source="./Images/microLessonSystem_5.png" Visibility="Visible"/>
210
-                            <TextBlock Text="打印" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
211
-                        </StackPanel>
212
-                    </Button>
213
-                    <!--<Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click" Margin="0,0,30,0">
182
+            <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,0,0,5" HorizontalAlignment="Left">
183
+                <Button Cursor="Hand" x:Name="btnScreenRecording" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnScreenRecording_Click" Margin="30,0,0,0">
184
+                    <StackPanel Orientation="Vertical">
185
+                        <Image x:Name="ImgScreenRecording" Source="./Images/microLessonSystem_2.png"/>
186
+                        <Image x:Name="ImgScreenRecordingTwo" Source="./Images/microLessonSystem_3.png" Visibility="Collapsed"/>
187
+                        <TextBlock x:Name="TxbRecordScreenWord" Text="录屏" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
188
+                    </StackPanel>
189
+                </Button>
190
+                <Button Cursor="Hand" x:Name="btnScreenshot" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,0,0" Click="BtnScreenshot_Click">
191
+                    <StackPanel Orientation="Vertical">
192
+                        <Image x:Name="ImgScreenshot" Source="./Images/microLessonSystem_12.png"/>
193
+                        <Image x:Name="ImgScreenshotTwo" Source="./Images/microLessonSystem_11.png" Visibility="Collapsed"/>
194
+                        <TextBlock Text="截图" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
195
+                    </StackPanel>
196
+                </Button>
197
+                <Button Cursor="Hand" x:Name="btnImport" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnImport_Click" Margin="30,0,0,0">
198
+                    <StackPanel Orientation="Vertical">
199
+                        <Image x:Name="ImgImport" Source="./Images/microLessonSystem_6.png"/>
200
+                        <Image x:Name="ImgImportTwo" Source="./Images/microLessonSystem_7.png" Visibility="Collapsed"/>
201
+                        <TextBlock Text="导入" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
202
+                    </StackPanel>
203
+                </Button>
204
+                <Button Cursor="Hand" x:Name="BtnRecord" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="100,0,0,0" Click="BtnRecord_Click">
205
+                    <StackPanel Orientation="Vertical">
206
+                        <Image x:Name="ImgRecord" Source="./Images/microLessonSystem_14.png"/>
207
+                        <Image x:Name="ImgRecordTwo" Source="./Images/microLessonSystem_13.png" Visibility="Collapsed"/>
208
+                        <TextBlock x:Name="TxbRecordingWord" Text="录制" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
209
+                    </StackPanel>
210
+                </Button>
211
+                <Button Cursor="Hand" x:Name="btnStop" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnStop_Click" Margin="30,0,0,0">
212
+                    <StackPanel Orientation="Vertical">
213
+                        <Image x:Name="ImgStop" Source="./Images/microLessonSystem_21.png"/>
214
+                        <Image x:Name="ImgStopTwo" Source="./Images/microLessonSystem_20.png" Visibility="Collapsed"/>
215
+                        <TextBlock Text="停止" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
216
+                    </StackPanel>
217
+                </Button>
218
+                <TextBlock x:Name="txbTime" Text="" FontSize="20" Foreground="#FFFFFF" Margin="20,20,0,0"/>
219
+            </StackPanel>
220
+            <StackPanel Grid.Row="1" HorizontalAlignment="Center">
221
+                <TextBlock x:Name="txbType" Text="" FontSize="20" Foreground="#FFFFFF" Margin="0,25,0,0"/>
222
+            </StackPanel>
223
+            <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,5">
224
+                <Button Cursor="Hand" x:Name="btnAdd" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnAdd_Click" Margin="0,0,30,0">
225
+                    <StackPanel Orientation="Vertical">
226
+                        <Image x:Name="ImgAdd" Source="./Images/microLessonSystem_25.png" Visibility="Visible"/>
227
+                        <Image x:Name="ImgAddTwo" Source="./Images/microLessonSystem_24.png" Visibility="Collapsed"/>
228
+                        <TextBlock Text="增加" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
229
+                    </StackPanel>
230
+                </Button>
231
+                <Button Cursor="Hand" x:Name="btnPrint" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnPrint_Click">
232
+                    <StackPanel Orientation="Vertical">
233
+                        <Image x:Name="ImgPrint" Source="./Images/microLessonSystem_4.png" Visibility="Collapsed"/>
234
+                        <Image x:Name="ImgPrintTwo" Source="./Images/microLessonSystem_5.png" Visibility="Visible"/>
235
+                        <TextBlock Text="打印" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
236
+                    </StackPanel>
237
+                </Button>
238
+                <!--<Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click" Margin="0,0,30,0">
214
                         <StackPanel Orientation="Vertical">
239
                         <StackPanel Orientation="Vertical">
215
                             <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_15.png" Visibility="Collapsed"/>
240
                             <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_15.png" Visibility="Collapsed"/>
216
                             <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_16.png" Visibility="Visible"/>
241
                             <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_16.png" Visibility="Visible"/>
217
                             <TextBlock Text="上传" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
242
                             <TextBlock Text="上传" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
218
                         </StackPanel>
243
                         </StackPanel>
219
                     </Button>-->
244
                     </Button>-->
220
-                    <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnUpload_Click">
221
-                        <StackPanel Orientation="Vertical">
222
-                            <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_22.png" Visibility="Collapsed"/>
223
-                            <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_1.png" Visibility="Visible"/>
224
-                            <TextBlock Text="我的" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
225
-                        </StackPanel>
226
-                    </Button>
227
-                    <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnSetUp_Click">
228
-                        <StackPanel Orientation="Vertical">
229
-                            <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png" Visibility="Visible"/>
230
-                            <Image x:Name="ImgSetUpTwo" Source="./Images/microLessonSystem_17.png" Visibility="Collapsed"/>
231
-                            <TextBlock Text="设置" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
232
-                        </StackPanel>
233
-                    </Button>
234
-                </StackPanel>
245
+                <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnUpload_Click">
246
+                    <StackPanel Orientation="Vertical">
247
+                        <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_22.png" Visibility="Collapsed"/>
248
+                        <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_1.png" Visibility="Visible"/>
249
+                        <TextBlock Text="我的" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
250
+                    </StackPanel>
251
+                </Button>
252
+                <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnSetUp_Click">
253
+                    <StackPanel Orientation="Vertical">
254
+                        <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png" Visibility="Visible"/>
255
+                        <Image x:Name="ImgSetUpTwo" Source="./Images/microLessonSystem_17.png" Visibility="Collapsed"/>
256
+                        <TextBlock Text="设置" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
257
+                    </StackPanel>
258
+                </Button>
259
+            </StackPanel>
235
             </Grid>
260
             </Grid>
236
-            <!--主内容-->
261
+
262
+        <!--主内容-->
237
         <Grid Grid.Row="1" x:Name="GridMain" Visibility="Visible">
263
         <Grid Grid.Row="1" x:Name="GridMain" Visibility="Visible">
238
             <ScrollViewer x:Name="scroMain" VerticalScrollBarVisibility="Visible">
264
             <ScrollViewer x:Name="scroMain" VerticalScrollBarVisibility="Visible">
239
                 <Grid x:Name="gridM"  Margin="0,0,0,0" Background="#FFFFFF" Visibility="Visible" Height="1780">
265
                 <Grid x:Name="gridM"  Margin="0,0,0,0" Background="#FFFFFF" Visibility="Visible" Height="1780">
240
                     <Grid>
266
                     <Grid>
241
                         <Border Grid.Row="1"  CornerRadius="5">
267
                         <Border Grid.Row="1"  CornerRadius="5">
242
                             <Grid x:Name="IMG" Margin="0,0,0,0">
268
                             <Grid x:Name="IMG" Margin="0,0,0,0">
243
-                                    <Grid.Resources>
244
-                                        <TransformGroup x:Key="Imageview">
245
-                                            <ScaleTransform/>
246
-                                            <TranslateTransform/>
247
-                                        </TransformGroup>
248
-                                    </Grid.Resources>
249
-                                    <!--图片表框 -->
269
+                                <Grid.Resources>
270
+                                    <TransformGroup x:Key="Imageview">
271
+                                        <ScaleTransform/>
272
+                                        <TranslateTransform/>
273
+                                    </TransformGroup>
274
+                                </Grid.Resources>
275
+
276
+                                <!--<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled"   Cursor="SizeAll"
277
+                  Margin="0,0,0,0" Focusable="False" x:Name="BackFrame">
278
+                                            <ContentControl  MouseLeftButtonDown="IMG1_MouseLeftButtonDown"   
279
+                             MouseLeftButtonUp="IMG1_MouseLeftButtonUp"
280
+                             MouseMove="IMG1_MouseMove"
281
+                             MouseWheel="IMG1_MouseWheel" >
282
+                                            </ContentControl>
283
+                                        </ScrollViewer>-->
284
+                                <!--图片表框 -->
250
                                 <Rectangle x:Name="RectImgBorder" Cursor="SizeAll" Fill="#00000000" HorizontalAlignment="Left" Stroke="#2D8CF0" VerticalAlignment="Top" Width="300" Height="300" Visibility="Hidden" Margin="373,175,0,0" StrokeThickness="4" StrokeDashArray="4 4" SnapsToDevicePixels="True"/>
285
                                 <Rectangle x:Name="RectImgBorder" Cursor="SizeAll" Fill="#00000000" HorizontalAlignment="Left" Stroke="#2D8CF0" VerticalAlignment="Top" Width="300" Height="300" Visibility="Hidden" Margin="373,175,0,0" StrokeThickness="4" StrokeDashArray="4 4" SnapsToDevicePixels="True"/>
251
                                 <Image Name="imgCanvas" Height="0" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Fill" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}" MouseRightButtonDown="imgCanvas_MouseRightButtonDown" MouseLeftButtonDown="imgCanvas_MouseLeftButtonDown" Focusable="True" MouseMove="imgCanvas_MouseMove" MouseUp="imgCanvas_MouseUp"/>
286
                                 <Image Name="imgCanvas" Height="0" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Fill" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}" MouseRightButtonDown="imgCanvas_MouseRightButtonDown" MouseLeftButtonDown="imgCanvas_MouseLeftButtonDown" Focusable="True" MouseMove="imgCanvas_MouseMove" MouseUp="imgCanvas_MouseUp"/>
252
                                 <!--四个点 -->
287
                                 <!--四个点 -->
259
                             </Grid>
294
                             </Grid>
260
                         </Border>
295
                         </Border>
261
                     </Grid>
296
                     </Grid>
262
-                        <Image x:Name="imgDocumentation" Visibility="Visible"/>
263
-                        <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
264
-                    </Grid>
297
+                    <Image x:Name="imgDocumentation" Visibility="Visible"/>
298
+
299
+                    <!--导入图片-->
300
+                    <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
301
+                    <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
302
+
303
+
304
+                    <!--摄像头-->
305
+                    <!--<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">
306
+                    <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />
307
+                </wfi:WindowsFormsHost>-->
308
+                    <!--<Image x:Name="imgLoad"
309
+                    Width="300"
310
+                    Height="300"
311
+                    gifLib:ImageBehavior.AnimatedSource="./Images/img_load.gif" VerticalAlignment="Top" Margin="0,200,0,0" Visibility="Visible"/>-->
312
+                </Grid>
265
             </ScrollViewer>
313
             </ScrollViewer>
266
             <Image x:Name="imgPlayerLeft" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
314
             <Image x:Name="imgPlayerLeft" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
267
             <Image x:Name="imgPlayerRight" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right"  Margin="10,7,26,10" VerticalAlignment="Top" Visibility="Collapsed"/>
315
             <Image x:Name="imgPlayerRight" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right"  Margin="10,7,26,10" VerticalAlignment="Top" Visibility="Collapsed"/>
271
             <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,16,0"/>
319
             <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,16,0"/>
272
             <Label Content="" Grid.Column="0" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="1,0,0,0"/>
320
             <Label Content="" Grid.Column="0" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="1,0,0,0"/>
273
             <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,16,0"/>
321
             <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,16,0"/>
274
-            </Grid>
322
+            <!--<TextBlock x:Name="txbTime" Text="123456" FontSize="20" Foreground="#000000" Margin="0,0,0,10" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>-->
323
+        </Grid>
275
         <!--页码-->
324
         <!--页码-->
276
         <Grid Grid.Row="1" x:Name="gridPage" Visibility="Collapsed">
325
         <Grid Grid.Row="1" x:Name="gridPage" Visibility="Collapsed">
277
             <StackPanel Grid.Row="0" Orientation="Horizontal" Background="Transparent" Width="180" HorizontalAlignment="Center"
326
             <StackPanel Grid.Row="0" Orientation="Horizontal" Background="Transparent" Width="180" HorizontalAlignment="Center"

+ 54
- 15
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

2282
                     #endregion
2282
                     #endregion
2283
                     IsFirstR = false;
2283
                     IsFirstR = false;
2284
                     RsImgName = new List<string>();
2284
                     RsImgName = new List<string>();
2285
-                    ///启动截图
2286
-                    timer = new System.Threading.Timer(new TimerCallback(Timer_Elapsed), null, 0, 200);
2287
                     SRTime = Convert.ToDateTime("2020-01-01 00:00:00");
2285
                     SRTime = Convert.ToDateTime("2020-01-01 00:00:00");
2286
+                    ///启动截图
2287
+                    timer = new System.Threading.Timer(new TimerCallback(Timer_Elapsed), null, 0, 20);
2288
                     //{
2288
                     //{
2289
                     //    AutoReset = true//设置是否执行System.Timers.Timer.Elapsed事件
2289
                     //    AutoReset = true//设置是否执行System.Timers.Timer.Elapsed事件
2290
                     //};//设置执行一次(false)还是一直执行(true)
2290
                     //};//设置执行一次(false)还是一直执行(true)
2324
                         Thread.Sleep(1000);
2324
                         Thread.Sleep(1000);
2325
                         Dispatcher.Invoke(() =>
2325
                         Dispatcher.Invoke(() =>
2326
                         {
2326
                         {
2327
+                            Recorddt = DateTime.Now;
2327
                             IsStartCount = true;
2328
                             IsStartCount = true;
2328
                             //Stack();
2329
                             //Stack();
2329
                             //timer.Start();
2330
                             //timer.Start();
2379
             }
2380
             }
2380
         }
2381
         }
2381
         /// <summary>
2382
         /// <summary>
2382
-        /// 录制保存图片
2383
+        /// 记录上次截图时间
2384
+        /// </summary>
2385
+        DateTime Recorddt = DateTime.Now;
2386
+        /// <summary>
2387
+        /// 录制保存图片计时器
2383
         /// </summary>
2388
         /// </summary>
2384
         /// <param name="sender"></param>
2389
         /// <param name="sender"></param>
2385
         private void Timer_Elapsed(object sender)
2390
         private void Timer_Elapsed(object sender)
2386
         {
2391
         {
2387
             if (IsStartCount)
2392
             if (IsStartCount)
2388
             {
2393
             {
2389
-                try
2394
+                DateTime dt = DateTime.Now;
2395
+                TimeSpan ts = dt.Subtract(Recorddt);//时间差   
2396
+                double tsmi = ts.TotalMilliseconds;
2397
+                if (tsmi > 200.0)
2390
                 {
2398
                 {
2391
-                    Dispatcher.Invoke(() =>
2399
+                    Recorddt = Recorddt.AddMilliseconds(200);
2400
+                    Thread thread = new Thread(RecordSaveImage);
2401
+                    //开启线程
2402
+                    thread.Start();
2403
+                }
2404
+            }
2405
+        }
2406
+        /// <summary>
2407
+        /// 录制保存图片
2408
+        /// </summary>
2409
+        void RecordSaveImage()
2410
+        {
2411
+            try
2412
+            {
2413
+                Dispatcher.Invoke(() =>
2414
+                {
2415
+                    if (IsStartCount)
2392
                     {
2416
                     {
2393
                         string FilePathName = ImgPath + RsImgName.Count + ".png";
2417
                         string FilePathName = ImgPath + RsImgName.Count + ".png";
2394
                         RsImgName.Add(FilePathName);
2418
                         RsImgName.Add(FilePathName);
2395
-                        ImageHelper.SaveUIToImage(GridMain, FilePathName, (int)ActualWidth, (int)ActualHeight);
2396
-                        SRTime=SRTime.AddMilliseconds(200);
2419
+                        ImageHelper.SaveUIToImage(GridMain, FilePathName, (int)(ActualWidth * (PrimaryScreen.DpiX / 96f)), (int)(ActualHeight * (PrimaryScreen.DpiY / 96f)));
2420
+                        SRTime = SRTime.AddMilliseconds(200);
2421
+                        if (txbTime.Visibility == Visibility.Hidden)
2422
+                        {
2423
+                            txbTime.Visibility = Visibility.Visible;
2424
+                        }
2397
                         if (SRTime.Hour > 0)
2425
                         if (SRTime.Hour > 0)
2398
                         {
2426
                         {
2427
+                            //Dispatcher.Invoke(() =>
2428
+                            //{
2399
                             txbTime.Text = SRTime.ToString("HH:mm:ss");
2429
                             txbTime.Text = SRTime.ToString("HH:mm:ss");
2430
+                            //});
2400
                         }
2431
                         }
2401
                         else
2432
                         else
2402
                         {
2433
                         {
2434
+                            //Dispatcher.Invoke(() =>
2435
+                            //{
2403
                             txbTime.Text = SRTime.ToString("mm:ss");
2436
                             txbTime.Text = SRTime.ToString("mm:ss");
2437
+                            //});
2404
                         }
2438
                         }
2405
-                    });
2406
-                }
2407
-                catch (Exception ex)
2408
-                {
2409
-                    LogHelper.WriteErrLog("【录制】(Timer_Elapsed)生成图片错误:" + ex.Message, ex);
2410
-                }
2439
+                    }
2440
+                });
2441
+            }
2442
+            catch (Exception ex)
2443
+            {
2444
+                LogHelper.WriteErrLog("【录制】(Timer_Elapsed)生成图片错误:" + ex.Message, ex);
2411
             }
2445
             }
2412
         }
2446
         }
2413
-
2414
         /// <summary>
2447
         /// <summary>
2415
         /// 停止录制并生成录制文件
2448
         /// 停止录制并生成录制文件
2416
         /// </summary>
2449
         /// </summary>
2503
                     APP.FFmpeg.StopFFmpeg(AudioPathName);
2536
                     APP.FFmpeg.StopFFmpeg(AudioPathName);
2504
                     new Thread(new ThreadStart(new Action(() =>
2537
                     new Thread(new ThreadStart(new Action(() =>
2505
                     {
2538
                     {
2539
+                        IsStartCount = false;
2506
                         //停止截图
2540
                         //停止截图
2507
                         while (APP.FFmpeg.myProcess != null)
2541
                         while (APP.FFmpeg.myProcess != null)
2508
                         {
2542
                         {
2510
                         }
2544
                         }
2511
                         Dispatcher.Invoke(() =>
2545
                         Dispatcher.Invoke(() =>
2512
                         {
2546
                         {
2513
-                            IsStartCount = false;
2514
                             timer.Change(-1, 0);
2547
                             timer.Change(-1, 0);
2515
                             timer.Dispose();
2548
                             timer.Dispose();
2516
                                     //End();
2549
                                     //End();
4150
         {
4183
         {
4151
             Thread.Sleep(2000);
4184
             Thread.Sleep(2000);
4152
         }
4185
         }
4186
+
4187
+        private void Button_Click_2(object sender, RoutedEventArgs e)
4188
+        {
4189
+            
4190
+            MessageWindow.Show("A:"+ActualWidth*(PrimaryScreen.DpiX / 96f)+"x" +ActualHeight * (PrimaryScreen.DpiY / 96f) + "  wh:"+Width+"x"+Height);
4191
+        }
4153
     }
4192
     }
4154
 }
4193
 }

Loading…
Cancel
Save