Explorar el Código

需求 BUG

tags/录制修改前
zhangxueyang hace 4 años
padre
commit
07ecaa8ad0

+ 17
- 9
Common/system/ImageHelper.cs Ver fichero

@@ -3,6 +3,7 @@ using System.Configuration;
3 3
 using System.Drawing;
4 4
 using System.Drawing.Imaging;
5 5
 using System.IO;
6
+using System.Security.Policy;
6 7
 using System.Text;
7 8
 using System.Threading;
8 9
 using System.Windows;
@@ -111,10 +112,13 @@ namespace Common.system
111 112
         /// </summary>
112 113
         /// <param name="ScreenSize">截图的区域,设置new Rectangle(0, 0, 0, 0)为截全屏</param>
113 114
         /// <param name="ImageSavePath">图片存储路径,为空或null则保存到临时文件夹</param>
115
+        /// <param name="IsRetImg">是否返回图片</param>
116
+        /// <param name="bitmapimg">图片</param>
114 117
         /// <param name="level">压缩等级,0到100,0 最差质量,100 最佳</param>
115 118
         /// <returns></returns>
116
-        public static BitmapImage GetScreenshot(Rectangle ScreenSize, string ImageSavePath, long level = -1)
119
+        public static bool GetScreenshot(Rectangle ScreenSize, string ImageSavePath, bool IsRetImg, out BitmapImage bitmapimg, long level = -1)
117 120
         {
121
+            bitmapimg = null;
118 122
             try
119 123
             {
120 124
                 System.Drawing.Size bounds = PrimaryScreen.DESKTOP;
@@ -143,15 +147,19 @@ namespace Common.system
143 147
                     g.CopyFromScreen(l, t, 0, 0, _Bitmap.Size, CopyPixelOperation.SourceCopy);
144 148
                     Compress(_Bitmap, ImageSavePath, level);
145 149
                 }
146
-                Uri uri = new Uri(ImageSavePath, UriKind.Absolute);
147
-                BitmapImage bimg = new BitmapImage(uri);
150
+                if (IsRetImg)
151
+                {
152
+
153
+                    Uri uri = new Uri(ImageSavePath, UriKind.Absolute);
154
+                    bitmapimg = new BitmapImage(uri);
155
+                }
148 156
                 GC.Collect();
149
-                return bimg;
157
+                return true;
150 158
             }
151 159
             catch (Exception ex)
152 160
             {
153 161
                 LogHelper.WriteErrLog("【截图】(GetBitmapSource)截图失败," + ex.Message, ex);
154
-                return null;
162
+                return false;
155 163
             }
156 164
         }
157 165
         /// <summary>
@@ -161,8 +169,8 @@ namespace Common.system
161 169
         public static string GetTempImagePath()
162 170
         {
163 171
             TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
164
-            
165
-            string TempPath=FileToolsCommon.GetFileAbsolutePath("/temp/Screenshot/");
172
+
173
+            string TempPath = FileToolsCommon.GetFileAbsolutePath("/temp/Screenshot/");
166 174
             FileToolsCommon.CreateDirectory(TempPath);
167 175
             TempPath += Convert.ToInt64(ts.TotalMilliseconds).ToString() + ".jpg";
168 176
             return TempPath;
@@ -468,7 +476,7 @@ namespace Common.system
468 476
                     break;
469 477
             }
470 478
 
471
-            if(right - left<=0)//zxyceshi
479
+            if (right - left <= 0)//zxyceshi
472 480
             {
473 481
                 //克隆位图对象的一部分。
474 482
                 System.Drawing.Rectangle cloneRect = new System.Drawing.Rectangle(left, top, 1, bottom - top);
@@ -486,7 +494,7 @@ namespace Common.system
486 494
                 //cloneBitmap.Save(@"d:\123.png", ImageFormat.Png);
487 495
                 return cloneBitmap;
488 496
             }
489
-         
497
+
490 498
         }
491 499
 
492 500
         /// <summary>

+ 12
- 21
XHWK.WKTool/FileDirectoryWindow.xaml Ver fichero

@@ -34,7 +34,7 @@
34 34
                 Height="36"
35 35
                 Margin="0,0,0,0"
36 36
                 Background="{Binding Colour}"
37
-                Columns="6"
37
+                Columns="5"
38 38
                 Rows="1">
39 39
                 <!--题号-->
40 40
                 <TextBlock 
@@ -62,12 +62,12 @@
62 62
                 </Grid>
63 63
           
64 64
            
65
-                <!--分值-->
65
+                <!--分值--><!--
66 66
                 <TextBlock
67 67
                     HorizontalAlignment="Center"
68 68
                     VerticalAlignment="Center"
69 69
                     FontSize="15"
70
-                    Text="{Binding VideoDuration}" />
70
+                    Text="{Binding VideoDuration}" />-->
71 71
 
72 72
                 <!--平均时长-->
73 73
                 <TextBlock
@@ -122,7 +122,7 @@
122 122
             <Grid.RowDefinitions>
123 123
                 <RowDefinition Height="45"/>
124 124
                 <RowDefinition Height="*"/>
125
-                <RowDefinition Height="80"/>
125
+                <RowDefinition Height="30"/>
126 126
             </Grid.RowDefinitions>
127 127
             <!--第一行 标题-->
128 128
             <Border Grid.Row="0" Background="#2D8CF0">
@@ -141,7 +141,7 @@
141 141
                 Grid.Row="0"
142 142
                 Margin="10,0,10,0"
143 143
                 Background="#2D8CF0"
144
-                Columns="6"
144
+                Columns="5"
145 145
                 Rows="1">
146 146
                     <TextBlock
147 147
                     HorizontalAlignment="Center"
@@ -153,11 +153,11 @@
153 153
                     VerticalAlignment="Center"
154 154
                     FontSize="15"
155 155
                     Text="视频名称" Foreground="White" />
156
-                    <TextBlock
156
+                    <!--<TextBlock
157 157
                     HorizontalAlignment="Center"
158 158
                     VerticalAlignment="Center"
159 159
                     FontSize="15"
160
-                    Text="视频时长" Foreground="White" />
160
+                    Text="视频时长" Foreground="White" />-->
161 161
                     <TextBlock
162 162
                     HorizontalAlignment="Center"
163 163
                     VerticalAlignment="Center"
@@ -185,28 +185,19 @@
185 185
                                 ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
186 186
             </Grid>
187 187
             <!--第三行 删除 上传 按钮-->
188
-            <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" Height="32">
188
+            <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Height="32">
189 189
                 <TextBlock Text="共" FontSize="20" Padding="0,5,0,0"/>
190 190
                 <TextBlock x:Name="txbSum" Text="0" FontSize="20" Padding="0,5,0,0"/>
191 191
                 <TextBlock Text="条" FontSize="20" Padding="0,5,0,0"/>
192 192
                 <Button Background="Transparent"
193 193
                                 Cursor="Hand"
194
-                        BorderThickness="0">
195
-                    <Image Source="./Images/class_p1.png"/>
194
+                        BorderThickness="0" Content="上一页" FontSize="20" Margin="10,0,0,0" >
195
+                    <!--<Image Source="./Images/class_p1.png"/>-->
196 196
                 </Button>
197 197
                 <Button Background="Transparent"
198 198
                                 Cursor="Hand"
199
-                        BorderThickness="0" Content="1" FontSize="20" Width="30"/>
200
-                <Button Background="Transparent"
201
-                                Cursor="Hand"
202
-                        BorderThickness="0" Content="2" FontSize="20" Width="30"/>
203
-                <Button Background="Transparent"
204
-                                Cursor="Hand"
205
-                        BorderThickness="0" Content="3" FontSize="20" Width="30"/>
206
-                <Button Background="Transparent"
207
-                                Cursor="Hand"
208
-                        BorderThickness="0">
209
-                    <Image Source="./Images/class_p2.png"/>
199
+                        BorderThickness="0" Content="下一页" FontSize="20" Margin="10,0,0,0" >
200
+                    <!--<Image Source="./Images/class_p2.png"/>-->
210 201
                 </Button>
211 202
             </StackPanel>
212 203
             

BIN
XHWK.WKTool/Images/img_load.gif Ver fichero


+ 10
- 8
XHWK.WKTool/JieTuWindow.xaml.cs Ver fichero

@@ -81,7 +81,8 @@ namespace ComeCapture
81 81
                 Directory.CreateDirectory(tempPath);
82 82
             }
83 83
             string imagePath = Path.Combine(tempPath, time + ".jpg");
84
-            Background = new ImageBrush(ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), null));
84
+            if (ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), null, true, out BitmapImage bitmap))
85
+                Background = new ImageBrush(bitmap);
85 86
         }
86 87
 
87 88
         public void initialization()
@@ -233,7 +234,7 @@ namespace ComeCapture
233 234
             //string imagePath = ImageHelper.GetImagePath(out string serverSavePath);
234 235
 
235 236
             //BitmapSource bitmap = ImageHelper.GetBitmapSource((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2, out JieTuBitmapPtr);
236
-            BitmapImage bitmap = ImageHelper.GetScreenshot(new Rectangle((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2), imagePath);
237
+           /* BitmapImage bitmap = */ImageHelper.GetScreenshot(new Rectangle((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2), imagePath,true,out BitmapImage bitmapimg);
237 238
             _IsMouseDown = false;
238 239
             _IsCapture = false;
239 240
             ImageEditBar.Current.Visibility = Visibility.Collapsed;
@@ -241,18 +242,19 @@ namespace ComeCapture
241 242
             SizeRGB.Visibility = Visibility.Collapsed;
242 243
             MainImage.Visibility = Visibility.Collapsed;
243 244
             DataContext = new AppModel();
244
-            Background = new ImageBrush(ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), imagePath));//zxy
245
+            ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);//zxy
246
+            Background = new ImageBrush(bitmap);
245 247
             WpfHelper.MainDispatcher = Dispatcher;
246 248
             MaxWindow();
247 249
             MaskLeft.Height = ScreenHeight;
248 250
             MaskRight.Height = ScreenHeight;
249 251
             //计算Windows项目缩放比例
250 252
             ScreenHelper.ResetScreenScale();
251
-            if (bitmap != null)
252
-            {
253
-                //Shared.TeachingData.REQ_InteractiveLaunch.teacherpic = serverSavePath;
254
-                //Shared.TeachingData.FilePath = imagePath;
255
-            }
253
+            //if (bitmap != null)
254
+            //{
255
+            //    //Shared.TeachingData.REQ_InteractiveLaunch.teacherpic = serverSavePath;
256
+            //    //Shared.TeachingData.FilePath = imagePath;
257
+            //}
256 258
 
257 259
             ///修改为统一截图时存储到服务器 修改人:赵耀 修改时间:2020年8月11日
258 260
             //if (bitmap != null)

+ 239
- 0
XHWK.WKTool/LoadDialog.xaml Ver fichero

@@ -0,0 +1,239 @@
1
+<Window x:Class="XHWK.WKTool.LoadDialog"
2
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
+        xmlns:local="clr-namespace:XHWK.WKTool"
7
+        mc:Ignorable="d"
8
+        Title="LoadDialog"  Width="100"
9
+    Height="100"
10
+    AllowsTransparency="True"
11
+    Background="Transparent"
12
+    Opacity="1"
13
+    ResizeMode="NoResize"
14
+    Topmost="True"
15
+    WindowStartupLocation="CenterScreen"
16
+    WindowStyle="None">
17
+    <Grid>
18
+        <Border Background="#66000000" CornerRadius="10 10 10 10">
19
+            <Grid Width="60" Height="60">
20
+                <Grid.Resources>
21
+                    <DrawingBrush
22
+                        x:Key="brush"
23
+                        AlignmentX="Center"
24
+                        AlignmentY="Top"
25
+                        Stretch="None">
26
+                        <DrawingBrush.Drawing>
27
+                            <GeometryDrawing Brush="White">
28
+                                <GeometryDrawing.Geometry>
29
+                                    <EllipseGeometry RadiusX="2" RadiusY="5" />
30
+                                </GeometryDrawing.Geometry>
31
+                            </GeometryDrawing>
32
+                        </DrawingBrush.Drawing>
33
+                    </DrawingBrush>
34
+                </Grid.Resources>
35
+
36
+                <Rectangle
37
+                    x:Name="r01"
38
+                    Fill="{StaticResource brush}"
39
+                    Opacity="0.8"
40
+                    RenderTransformOrigin="0.5,0.5">
41
+                    <Rectangle.RenderTransform>
42
+                        <RotateTransform Angle="0" />
43
+                    </Rectangle.RenderTransform>
44
+                </Rectangle>
45
+                <Rectangle
46
+                    x:Name="r02"
47
+                    Fill="{StaticResource brush}"
48
+                    Opacity="0.8"
49
+                    RenderTransformOrigin="0.5,0.5">
50
+                    <Rectangle.RenderTransform>
51
+                        <RotateTransform Angle="30" />
52
+                    </Rectangle.RenderTransform>
53
+                </Rectangle>
54
+                <Rectangle
55
+                    x:Name="r03"
56
+                    Fill="{StaticResource brush}"
57
+                    Opacity="0.8"
58
+                    RenderTransformOrigin="0.5,0.5">
59
+                    <Rectangle.RenderTransform>
60
+                        <RotateTransform Angle="60" />
61
+                    </Rectangle.RenderTransform>
62
+                </Rectangle>
63
+                <Rectangle
64
+                    x:Name="r04"
65
+                    Fill="{StaticResource brush}"
66
+                    Opacity="0.8"
67
+                    RenderTransformOrigin="0.5,0.5">
68
+                    <Rectangle.RenderTransform>
69
+                        <RotateTransform Angle="90" />
70
+                    </Rectangle.RenderTransform>
71
+                </Rectangle>
72
+                <Rectangle
73
+                    x:Name="r05"
74
+                    Fill="{StaticResource brush}"
75
+                    Opacity="0.8"
76
+                    RenderTransformOrigin="0.5,0.5">
77
+                    <Rectangle.RenderTransform>
78
+                        <RotateTransform Angle="120" />
79
+                    </Rectangle.RenderTransform>
80
+                </Rectangle>
81
+                <Rectangle
82
+                    x:Name="r06"
83
+                    Fill="{StaticResource brush}"
84
+                    Opacity="0.8"
85
+                    RenderTransformOrigin="0.5,0.5">
86
+                    <Rectangle.RenderTransform>
87
+                        <RotateTransform Angle="150" />
88
+                    </Rectangle.RenderTransform>
89
+                </Rectangle>
90
+                <Rectangle
91
+                    x:Name="r07"
92
+                    Fill="{StaticResource brush}"
93
+                    Opacity="0.8"
94
+                    RenderTransformOrigin="0.5,0.5">
95
+                    <Rectangle.RenderTransform>
96
+                        <RotateTransform Angle="180" />
97
+                    </Rectangle.RenderTransform>
98
+                </Rectangle>
99
+                <Rectangle
100
+                    x:Name="r08"
101
+                    Fill="{StaticResource brush}"
102
+                    Opacity="0.8"
103
+                    RenderTransformOrigin="0.5,0.5">
104
+                    <Rectangle.RenderTransform>
105
+                        <RotateTransform Angle="210" />
106
+                    </Rectangle.RenderTransform>
107
+                </Rectangle>
108
+                <Rectangle
109
+                    x:Name="r09"
110
+                    Fill="{StaticResource brush}"
111
+                    Opacity="0.8"
112
+                    RenderTransformOrigin="0.5,0.5">
113
+                    <Rectangle.RenderTransform>
114
+                        <RotateTransform Angle="240" />
115
+                    </Rectangle.RenderTransform>
116
+                </Rectangle>
117
+                <Rectangle
118
+                    x:Name="r10"
119
+                    Fill="{StaticResource brush}"
120
+                    Opacity="0.8"
121
+                    RenderTransformOrigin="0.5,0.5">
122
+                    <Rectangle.RenderTransform>
123
+                        <RotateTransform Angle="270" />
124
+                    </Rectangle.RenderTransform>
125
+                </Rectangle>
126
+                <Rectangle
127
+                    x:Name="r11"
128
+                    Fill="{StaticResource brush}"
129
+                    Opacity="0.8"
130
+                    RenderTransformOrigin="0.5,0.5">
131
+                    <Rectangle.RenderTransform>
132
+                        <RotateTransform Angle="300" />
133
+                    </Rectangle.RenderTransform>
134
+                </Rectangle>
135
+                <Rectangle
136
+                    x:Name="r12"
137
+                    Fill="{StaticResource brush}"
138
+                    Opacity="0.8"
139
+                    RenderTransformOrigin="0.5,0.5">
140
+                    <Rectangle.RenderTransform>
141
+                        <RotateTransform Angle="330" />
142
+                    </Rectangle.RenderTransform>
143
+                </Rectangle>
144
+                <Grid.Triggers>
145
+                    <EventTrigger RoutedEvent="Grid.Loaded">
146
+                        <BeginStoryboard>
147
+                            <Storyboard RepeatBehavior="Forever">
148
+                                <DoubleAnimation
149
+                                    AutoReverse="True"
150
+                                    BeginTime="0:0:0.00000"
151
+                                    Storyboard.TargetName="r01"
152
+                                    Storyboard.TargetProperty="Opacity"
153
+                                    To="0"
154
+                                    Duration="0:0:0.08333" />
155
+                                <DoubleAnimation
156
+                                    AutoReverse="True"
157
+                                    BeginTime="0:0:0.08333"
158
+                                    Storyboard.TargetName="r02"
159
+                                    Storyboard.TargetProperty="Opacity"
160
+                                    To="0"
161
+                                    Duration="0:0:0.08333" />
162
+                                <DoubleAnimation
163
+                                    AutoReverse="True"
164
+                                    BeginTime="0:0:0.16666"
165
+                                    Storyboard.TargetName="r03"
166
+                                    Storyboard.TargetProperty="Opacity"
167
+                                    To="0"
168
+                                    Duration="0:0:0.08333" />
169
+                                <DoubleAnimation
170
+                                    AutoReverse="True"
171
+                                    BeginTime="0:0:0.24999"
172
+                                    Storyboard.TargetName="r04"
173
+                                    Storyboard.TargetProperty="Opacity"
174
+                                    To="0"
175
+                                    Duration="0:0:0.08333" />
176
+                                <DoubleAnimation
177
+                                    AutoReverse="True"
178
+                                    BeginTime="0:0:0.33332"
179
+                                    Storyboard.TargetName="r05"
180
+                                    Storyboard.TargetProperty="Opacity"
181
+                                    To="0"
182
+                                    Duration="0:0:0.08333" />
183
+                                <DoubleAnimation
184
+                                    AutoReverse="True"
185
+                                    BeginTime="0:0:0.41665"
186
+                                    Storyboard.TargetName="r06"
187
+                                    Storyboard.TargetProperty="Opacity"
188
+                                    To="0"
189
+                                    Duration="0:0:0.08333" />
190
+                                <DoubleAnimation
191
+                                    AutoReverse="True"
192
+                                    BeginTime="0:0:0.49998"
193
+                                    Storyboard.TargetName="r07"
194
+                                    Storyboard.TargetProperty="Opacity"
195
+                                    To="0"
196
+                                    Duration="0:0:0.08333" />
197
+                                <DoubleAnimation
198
+                                    AutoReverse="True"
199
+                                    BeginTime="0:0:0.58331"
200
+                                    Storyboard.TargetName="r08"
201
+                                    Storyboard.TargetProperty="Opacity"
202
+                                    To="0"
203
+                                    Duration="0:0:0.08333" />
204
+                                <DoubleAnimation
205
+                                    AutoReverse="True"
206
+                                    BeginTime="0:0:0.66664"
207
+                                    Storyboard.TargetName="r09"
208
+                                    Storyboard.TargetProperty="Opacity"
209
+                                    To="0"
210
+                                    Duration="0:0:0.08333" />
211
+                                <DoubleAnimation
212
+                                    AutoReverse="True"
213
+                                    BeginTime="0:0:0.74997"
214
+                                    Storyboard.TargetName="r10"
215
+                                    Storyboard.TargetProperty="Opacity"
216
+                                    To="0"
217
+                                    Duration="0:0:0.08333" />
218
+                                <DoubleAnimation
219
+                                    AutoReverse="True"
220
+                                    BeginTime="0:0:0.83330"
221
+                                    Storyboard.TargetName="r11"
222
+                                    Storyboard.TargetProperty="Opacity"
223
+                                    To="0"
224
+                                    Duration="0:0:0.08333" />
225
+                                <DoubleAnimation
226
+                                    AutoReverse="True"
227
+                                    BeginTime="0:0:0.91663"
228
+                                    Storyboard.TargetName="r12"
229
+                                    Storyboard.TargetProperty="Opacity"
230
+                                    To="0"
231
+                                    Duration="0:0:0.08333" />
232
+                            </Storyboard>
233
+                        </BeginStoryboard>
234
+                    </EventTrigger>
235
+                </Grid.Triggers>
236
+            </Grid>
237
+        </Border>
238
+    </Grid>
239
+</Window>

+ 27
- 0
XHWK.WKTool/LoadDialog.xaml.cs Ver fichero

@@ -0,0 +1,27 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+using System.Windows;
7
+using System.Windows.Controls;
8
+using System.Windows.Data;
9
+using System.Windows.Documents;
10
+using System.Windows.Input;
11
+using System.Windows.Media;
12
+using System.Windows.Media.Imaging;
13
+using System.Windows.Shapes;
14
+
15
+namespace XHWK.WKTool
16
+{
17
+    /// <summary>
18
+    /// LoadDialog.xaml 的交互逻辑
19
+    /// </summary>
20
+    public partial class LoadDialog : Window
21
+    {
22
+        public LoadDialog()
23
+        {
24
+            InitializeComponent();
25
+        }
26
+    }
27
+}

+ 4
- 4
XHWK.WKTool/PracticeWindow.xaml.cs Ver fichero

@@ -33,7 +33,7 @@ namespace XHWK.WKTool
33 33
         /// <summary>
34 34
         /// 当前画笔颜色
35 35
         /// </summary>
36
-        Color Colour=Colors.Black;
36
+        Color Colour=Colors.Red;
37 37
         /// <summary>
38 38
         /// 当前画笔宽
39 39
         /// </summary>
@@ -111,15 +111,15 @@ namespace XHWK.WKTool
111 111
             Colour = Colors.Red;
112 112
         }
113 113
         /// <summary>
114
-        /// 画笔颜色事件 
114
+        /// 画笔颜色事件 
115 115
         /// </summary>
116 116
         /// <param name="sender"></param>
117 117
         /// <param name="e"></param>
118 118
         public void Gray()
119 119
         {
120 120
             //flg = 0;
121
-            drawingAttributes.Color = Colors.Gray;
122
-            Colour = Colors.Gray;
121
+            drawingAttributes.Color = Colors.Black;
122
+            Colour = Colors.Black;
123 123
         }
124 124
         /// <summary>
125 125
         /// 画笔颜色事件 青色

+ 4
- 4
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml Ver fichero

@@ -13,7 +13,7 @@
13 13
         <SolidColorBrush Opacity="0" Color="#292C2E" />
14 14
     </Window.Background>
15 15
     <Viewbox>
16
-        <Grid>
16
+        <Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown">
17 17
             <Grid.RowDefinitions>
18 18
                 <RowDefinition Height="auto"/>
19 19
                 <RowDefinition Height="auto"/>
@@ -21,7 +21,7 @@
21 21
             <Image x:Name="imgCanvas" Visibility="Collapsed"/>
22 22
             <InkCanvas Grid.Row="0" x:Name="blackboard_canvas" Background="Transparent" Visibility="Collapsed" Grid.RowSpan="2" />
23 23
             <!--画笔工具栏-->
24
-            <Grid Grid.Row="0" x:Name="gridToolbar" Visibility="Visible">
24
+            <Grid Grid.Row="0" x:Name="gridToolbar" Visibility="Collapsed">
25 25
                 <Image Grid.Row="0"  Source="./Images/Toobar22.png" HorizontalAlignment="Right"/>
26 26
                 <StackPanel Grid.Row="0" Orientation="Vertical" HorizontalAlignment="Right" Margin="0,5,10,0">
27 27
                     <Button  Cursor="Hand" x:Name="btnToolbarDown" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,5,0,0" Click="BtnToolbarDown_Click">
@@ -51,7 +51,7 @@
51 51
                 </StackPanel>
52 52
             </Grid>
53 53
             <!--字体颜色-->
54
-            <Grid Grid.Row="0" x:Name="gridColour" Visibility="Visible">
54
+            <Grid Grid.Row="0" x:Name="gridColour" Visibility="Collapsed">
55 55
                 <Image Source="./Images/Toobar20.png" HorizontalAlignment="Right" Margin="0,200,62,0"/>
56 56
                 <StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="0,215,68,0">
57 57
                     <Button  Cursor="Hand" x:Name="btnWhite" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#FFFFFF" Height="15" Width="15" Margin="0,0,0,0" Click="BtnWhite_Click"/>
@@ -81,7 +81,7 @@
81 81
                 <Button x:Name="BtnStopRecordingScreen" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,15,0" Click="BtnStopRecordingScreen_Click">
82 82
                     <Image x:Name="ImgEndRecordingScreen" Source="./Images/Toobar14.png"/>
83 83
                 </Button>
84
-                <Button  Cursor="Hand" x:Name="btnBrush" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,10,0" Click="BtnBrush_Click">
84
+                <Button  Cursor="Hand" x:Name="btnBlackPen" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,10,0" Click="BtnBlackPen_Click">
85 85
                     <Image Source="./Images/Toobar8.png"/>
86 86
                 </Button>
87 87
             </StackPanel>

+ 18
- 1
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs Ver fichero

@@ -345,7 +345,7 @@ namespace XHWK.WKTool
345 345
                 Directory.CreateDirectory(tempPath);
346 346
             }
347 347
             string imagePath = Path.Combine(tempPath, time + ".jpg");
348
-            ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath);
348
+            //ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath);
349 349
             if (gridToolbar.Visibility == Visibility.Visible)
350 350
             {
351 351
                 gridToolbar.Visibility = Visibility.Hidden;
@@ -564,6 +564,23 @@ namespace XHWK.WKTool
564 564
         /// 停止录屏
565 565
         /// </summary>
566 566
         public event StopRecordingScreen Click_stopRecordingScreen;
567
+        /// <summary>
568
+        /// 黑笔
569
+        /// </summary>
570
+        /// <param name="sender"></param>
571
+        /// <param name="e"></param>
572
+        private void BtnBlackPen_Click(object sender, RoutedEventArgs e)
573
+        {
567 574
 
575
+        }
576
+        /// <summary>
577
+        /// 移动工具栏
578
+        /// </summary>
579
+        /// <param name="sender"></param>
580
+        /// <param name="e"></param>
581
+        private void Grid_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
582
+        {
583
+            DragMove();
584
+        }
568 585
     }
569 586
 }

+ 35
- 15
XHWK.WKTool/XHMicroLessonSystemWindow.xaml Ver fichero

@@ -5,6 +5,7 @@
5 5
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6 6
          xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
7 7
         xmlns:aforge ="clr-namespace:AForge.Controls;assembly=AForge.Controls"
8
+        xmlns:gifLib="http://wpfanimatedgif.codeplex.com"
8 9
         xmlns:local="clr-namespace:XHWK.WKTool"
9 10
         mc:Ignorable="d"
10 11
         Title="星火微课系统" Height="1040" Width="1276" WindowStartupLocation="CenterScreen"
@@ -84,6 +85,7 @@
84 85
                             <TextBlock Text="停止" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
85 86
                         </StackPanel>
86 87
                     </Button>
88
+                    <TextBlock x:Name="txbType" Text="" FontSize="20" Foreground="#FFFFFF" Margin="20,20,0,0"/>
87 89
                 </StackPanel>
88 90
                 <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,10,10,0">
89 91
                     <Button Cursor="Hand" x:Name="btnAdd" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnAdd_Click" Margin="0,0,30,0">
@@ -100,12 +102,19 @@
100 102
                             <TextBlock Text="打印" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
101 103
                         </StackPanel>
102 104
                     </Button>
103
-                    <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click" Margin="0,0,30,0">
105
+                    <!--<Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click" Margin="0,0,30,0">
104 106
                         <StackPanel Orientation="Vertical">
105 107
                             <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_15.png" Visibility="Collapsed"/>
106 108
                             <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_16.png" Visibility="Visible"/>
107 109
                             <TextBlock Text="上传" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
108 110
                         </StackPanel>
111
+                    </Button>-->
112
+                    <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnUpload_Click">
113
+                        <StackPanel Orientation="Vertical">
114
+                            <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_22.png" Visibility="Collapsed"/>
115
+                            <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_1.png" Visibility="Visible"/>
116
+                            <TextBlock Text="我的" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
117
+                        </StackPanel>
109 118
                     </Button>
110 119
                     <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnSetUp_Click">
111 120
                         <StackPanel Orientation="Vertical">
@@ -115,6 +124,7 @@
115 124
                         </StackPanel>
116 125
                     </Button>
117 126
                 </StackPanel>
127
+                <Button Content="Button" HorizontalAlignment="Left" Margin="637,15,0,0" Grid.Row="1" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
118 128
             </Grid>
119 129
             <!--主内容-->
120 130
             <Grid Grid.Row="1" x:Name="GridMain" Width="1276">
@@ -136,13 +146,14 @@
136 146
                              MouseLeftButtonUp="IMG1_MouseLeftButtonUp"
137 147
                              MouseMove="IMG1_MouseMove"
138 148
                              MouseWheel="IMG1_MouseWheel" >
139
-                                            <Image Name="imgCanvas" Width="635" Height="auto" Stretch="Uniform" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}">
149
+                                            <Image Name="imgCanvas" Width="635" Height="auto" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Uniform" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}" MouseRightButtonDown="imgCanvas_MouseRightButtonDown">
140 150
                                             </Image>
141 151
                                         </ContentControl>
142 152
                                     </ScrollViewer>
143 153
                                 </Grid>
144 154
                             </Border>
145 155
                         </Grid>
156
+                        <!--导入图片-->
146 157
                         <Image x:Name="imgDocumentation"/>
147 158
                         <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
148 159
                         <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
@@ -150,10 +161,13 @@
150 161
                         <!--<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">
151 162
                     <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />
152 163
                 </wfi:WindowsFormsHost>-->
153
-             
154 164
 
155
-                    
156
-       
165
+
166
+
167
+                        <!--<Image x:Name="imgLoad"
168
+                    Width="300"
169
+                    Height="300"
170
+                    gifLib:ImageBehavior.AnimatedSource="./Images/img_load.gif" VerticalAlignment="Top" Margin="0,200,0,0" Visibility="Visible"/>-->
157 171
                     </Grid>
158 172
                 </ScrollViewer>
159 173
                 <Image x:Name="imgPlayerLeft" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
@@ -165,17 +179,17 @@
165 179
                 <Label Content="" Grid.Column="0" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="1,0,0,0"/>
166 180
                 <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,16,0"/>
167 181
             </Grid>
168
-           
169
-            <Grid Grid.Row="1">
182
+           <!--页码-->
183
+            <Grid Grid.Row="1" x:Name="gridPage" Visibility="Collapsed">
170 184
                 <StackPanel Grid.Row="0" Orientation="Horizontal" Background="#FFFFFF" Width="180" HorizontalAlignment="Center"
171
-            Height="58" Margin="0,520,0,0" Grid.Column="1" VerticalAlignment="Bottom">
185
+            Height="30" Margin="0,0,0,0" Grid.Column="1" VerticalAlignment="Bottom">
172 186
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
173 187
                     x:Name="last_button"
174
-                    Width="60" Height="50"
188
+                    Width="60" Height="20"
175 189
                     Click="last_button_Click">
176 190
                         <Button.Content>
177 191
                             <StackPanel>
178
-                                <Image Width="16" Source=".\Images\class_p1.png" />
192
+                                <Image Width="16" Height="12" Source=".\Images\class_p1.png" />
179 193
                             </StackPanel>
180 194
                         </Button.Content>
181 195
                     </Button>
@@ -184,8 +198,7 @@
184 198
                             <RowDefinition Height="311*"/>
185 199
                             <RowDefinition Height="483*"/>
186 200
                         </Grid.RowDefinitions>
187
-                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-25,0,0" Grid.Row="1"  Background="Transparent">
188
-
201
+                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-12,0,0" Grid.Row="1"  Background="Transparent">
189 202
                             <StackPanel HorizontalAlignment="Center" Orientation="Horizontal"  Background="Transparent">
190 203
                                 <TextBlock x:Name="txbCurrpage" Text="{Binding currpage}" TextAlignment="Center" FontSize="15"/>
191 204
                                 <TextBlock Text="/" TextAlignment="Center" FontSize="15"/>
@@ -195,16 +208,23 @@
195 208
                     </Grid>
196 209
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
197 210
                     x:Name="next_btn"  Background="Transparent"
198
-                    Width="60" Height="50"
211
+                    Width="60" Height="20"
199 212
                     Click="next_btn_Click">
200 213
                         <Button.Content>
201 214
                             <StackPanel>
202
-                                <Image Width="16" Source=".\Images\class_p2.png" />
215
+                                <Image Width="16" Height="12" Source=".\Images\class_p2.png" />
203 216
                             </StackPanel>
204 217
                         </Button.Content>
205 218
                     </Button>
206 219
                 </StackPanel>
207 220
             </Grid>
221
+            <!--Loding-->
222
+            <Grid Grid.Row="1">
223
+                <Image x:Name="imgLoad"
224
+                    Width="300"
225
+                    Height="300"
226
+                    gifLib:ImageBehavior.AnimatedSource="./Images/img_load.gif" VerticalAlignment="Top" Margin="0,200,0,0" Visibility="Collapsed"/>
227
+            </Grid>
208 228
             <!--设置-->
209 229
             <Grid Grid.Row="1" x:Name="gridSetUp"  Background="#FFFFFF" Visibility="Collapsed" Width="1276">
210 230
                 <Grid.RowDefinitions>
@@ -294,7 +314,7 @@
294 314
                     <TextBlock Text="颜色:" FontSize="14" Padding="10,10,0,0"/>
295 315
                     <Button Cursor="Hand" x:Name="btnWhite" Background="#FFFFFF" Width="20" Height="20" Click="BtnWhite_Click" Margin="0,2,0,0"/>
296 316
                     <Button Cursor="Hand" x:Name="btnRed" Background="#FF0000" Width="20" Height="20" Margin="5,2,0,0" Click="BtnRed_Click"/>
297
-                    <Button Cursor="Hand" x:Name="btnGray" Background="#A7A9AC" Width="20" Height="20" Margin="5,2,0,0" Click="BtnGray_Click"/>
317
+                    <Button Cursor="Hand" x:Name="btnGray" Background="#333333" Width="20" Height="20" Margin="5,2,0,0" Click="BtnGray_Click"/>
298 318
                     <Button Cursor="Hand" x:Name="btnCyanBlue" Background="#63D600" Width="20" Height="20" Margin="5,2,0,0" Click="BtnCyanBlue_Click"/>
299 319
                     <Button Cursor="Hand" x:Name="btnYellow" Background="#FFBC00" Width="20" Height="20" Margin="5,2,0,0" Click="BtnYellow_Click"/>
300 320
                     <Button Cursor="Hand" x:Name="btnBlue" Background="#00B4FC" Width="20" Height="20" Margin="5,2,0,0" Click="BtnBlue_Click"/>

+ 160
- 30
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Ver fichero

@@ -23,6 +23,7 @@ using XHWK.WKTool.DAL;
23 23
 using System.Text;
24 24
 using System.Collections.Specialized;
25 25
 using XHWK.WKTool.Config;
26
+using System.Windows.Threading;
26 27
 
27 28
 namespace XHWK.WKTool
28 29
 {
@@ -55,11 +56,29 @@ namespace XHWK.WKTool
55 56
         /// <summary>
56 57
         /// 当前颜色
57 58
         /// </summary>
58
-        private System.Windows.Media.Color Color = System.Windows.Media.Colors.Black;
59
+        private System.Windows.Media.Color Color = System.Windows.Media.Colors.Red;
59 60
         /// <summary>
60 61
         /// 笔迹粗细
61 62
         /// </summary>
62 63
         private int PenSize = 2;
64
+        private DispatcherTimer t = null;
65
+        /// <summary>
66
+        /// 计时器状态
67
+        /// </summary>
68
+        private enum State
69
+        {
70
+            Start,
71
+            Pause,
72
+            End
73
+        }
74
+        /// <summary>
75
+        /// 状态
76
+        /// </summary>
77
+        private State _state = State.End;
78
+        /// <summary>
79
+        /// 计时用
80
+        /// </summary>
81
+        private TimeSpan _timeSpan = new TimeSpan(0, 0, 0, 0, 0);
63 82
         #endregion
64 83
 
65 84
         #region 初始化
@@ -105,6 +124,7 @@ namespace XHWK.WKTool
105 124
             #region 数据初始化
106 125
             APP.pageData.pagenum = 0;
107 126
             APP.pageData.currpage = APP.pageData.pagenum;
127
+            btnStop.IsEnabled = false;//停止录制按钮不可点击
108 128
             #endregion
109 129
 
110 130
 
@@ -125,6 +145,63 @@ namespace XHWK.WKTool
125 145
             //wfhCamera.Visibility = Visibility.Hidden;
126 146
             ImgPDFPath = null;
127 147
             ImgPDFPath = new string[300];
148
+          
149
+        }
150
+        /// <summary>
151
+        /// 开始
152
+        /// </summary>
153
+        /// <param name="sender"></param>
154
+        /// <param name="e"></param>
155
+        private void Stack()
156
+        {
157
+            _state = State.Start;
158
+        }
159
+        /// <summary>
160
+        /// 暂停
161
+        /// </summary>
162
+        private void TimeOut()
163
+        {
164
+            _state = State.Pause;
165
+        }
166
+        /// <summary>
167
+        /// 结束
168
+        /// </summary>
169
+        /// <param name="sender"></param>
170
+        /// <param name="e"></param>
171
+        private void End()
172
+        {
173
+            _state = State.End;
174
+        }
175
+        /// <summary>
176
+        /// 时钟回调
177
+        /// </summary>
178
+        /// <param name="sender"></param>
179
+        /// <param name="e"></param>
180
+        private void OnTimer(object sender, EventArgs e)
181
+        {
182
+            switch (_state)
183
+            {
184
+                case State.Start:
185
+                    {
186
+                        _timeSpan += new TimeSpan(0, 0, 0, 1);
187
+                    }
188
+                    break;
189
+
190
+                case State.Pause:
191
+                    {
192
+                    }
193
+                    break;
194
+
195
+                case State.End:
196
+                    {
197
+                        _timeSpan = new TimeSpan();
198
+                        //_timeSpan = new TimeSpan(0, 23, 12, 45, 54);
199
+                    }
200
+                    break;
201
+            }
202
+
203
+            string time = string.Format("{0:D2}:{1:D2}",/* _timeSpan.Hours,*/ _timeSpan.Minutes, _timeSpan.Seconds);
204
+            //txbTime.Text = time;
128 205
         }
129 206
         /// <summary>
130 207
         /// 修改布局
@@ -350,7 +427,6 @@ namespace XHWK.WKTool
350 427
             }))).Start();
351 428
 
352 429
         }
353
-
354 430
         /// <summary>
355 431
         /// 上传事件
356 432
         /// </summary>
@@ -445,6 +521,9 @@ namespace XHWK.WKTool
445 521
             //}
446 522
             #endregion
447 523
 
524
+            ImgRecord.Visibility = Visibility.Visible;//设置结束时可录制
525
+            ImgRecordTwo.Visibility = Visibility.Collapsed;//设置结束时可录制
526
+            BtnRecord.IsEnabled = true;//设置结束时可录制
448 527
             if (rbnMP4.IsChecked == true)
449 528
             {
450 529
                 //存储文件
@@ -503,6 +582,9 @@ namespace XHWK.WKTool
503 582
                 GridMain.Visibility = Visibility.Collapsed;
504 583
                 gridSetUp.Visibility = Visibility.Visible;
505 584
                 txbStoragePath.Content = APP.WKData.WkPath;
585
+                ImgRecord.Visibility = Visibility.Collapsed;//设置时不可录制
586
+                ImgRecordTwo.Visibility = Visibility.Visible;//设置时不可录制
587
+                BtnRecord.IsEnabled = false;//设置时不可录制
506 588
                 ///  < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
507 589
                 if ("1".Equals(APP.CameraPosition))
508 590
                 {
@@ -576,14 +658,14 @@ namespace XHWK.WKTool
576 658
             Color = Colors.Red;
577 659
         }
578 660
         /// <summary>
579
-        /// 画笔颜色事件 
661
+        /// 画笔颜色事件 
580 662
         /// </summary>
581 663
         /// <param name="sender"></param>
582 664
         /// <param name="e"></param>
583 665
         private void BtnGray_Click(object sender, RoutedEventArgs e)
584 666
         {
585
-            drawingAttributes.Color = Colors.Gray;
586
-            Color = Colors.Gray;
667
+            drawingAttributes.Color = Colors.Black;
668
+            Color = Colors.Black;
587 669
         }
588 670
         /// <summary>
589 671
         /// 画笔颜色事件 青色
@@ -698,8 +780,11 @@ namespace XHWK.WKTool
698 780
         {
699 781
             string time = GetTimeStamp();
700 782
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
701
-            ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath);
702
-
783
+            ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath,false,out BitmapImage bitmap);
784
+            if (this.WindowState == WindowState.Normal)//截图隐藏窗口
785
+            {
786
+                this.WindowState = WindowState.Minimized;
787
+            }
703 788
             if (APP.W_JieTuWindow != null)
704 789
             {
705 790
                 APP.W_JieTuWindow.initialization();
@@ -726,12 +811,17 @@ namespace XHWK.WKTool
726 811
         {
727 812
             if ("关闭窗口".Equals(text))
728 813
             {
814
+                if (this.WindowState == WindowState.Minimized)//截图完恢复窗口
815
+                {
816
+                    this.WindowState = WindowState.Normal;
817
+                }
729 818
                 if (!string.IsNullOrWhiteSpace(APP.ImgPath) && File.Exists(APP.ImgPath))
730 819
                 {
731 820
                     if (APP.pageData.currpage == 0)
732 821
                     {
733 822
                         APP.pageData.pagenum += 1;
734 823
                         APP.pageData.currpage = APP.pageData.pagenum;
824
+                        gridPage.Visibility = Visibility.Visible;//页码大于0 显示
735 825
                     }
736 826
                     if (APP.PageDrawList.Count >= APP.pageData.currpage)
737 827
                     {
@@ -745,18 +835,10 @@ namespace XHWK.WKTool
745 835
                         model_DrawData.PdfImagePath = APP.ImgPath;
746 836
                         APP.PageDrawList.Add(model_DrawData);
747 837
                     }
748
-                    //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
749
-                    //{
750
-                    //    //imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
751
-                    //    imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage-1].PageImagePath));
752
-                    //}
753 838
                     if (APP.PageDrawList.Count >= APP.pageData.currpage && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
754 839
                     {
755
-                        //imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
756 840
                         imgDocumentation.Source = null;
757 841
                         imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
758
-                        //btnOk.Visibility = Visibility.Visible;
759
-                        //blackboard_canvas.Visibility = Visibility.Collapsed;
760 842
                         APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation = false;
761 843
                         ImgPrint.Visibility = Visibility.Visible;//截图成功可打印
762 844
                         ImgPrintTwo.Visibility = Visibility.Collapsed;
@@ -770,6 +852,10 @@ namespace XHWK.WKTool
770 852
         /// </summary>
771 853
         private void JietuWindow_click_closeJietuWindowClick()
772 854
         {
855
+            if (this.WindowState == WindowState.Minimized)//截图完恢复窗口
856
+            {
857
+                this.WindowState = WindowState.Normal;
858
+            }
773 859
             APP.W_JieTuWindow = null;
774 860
         }
775 861
         /// <summary>
@@ -829,6 +915,8 @@ namespace XHWK.WKTool
829 915
             {
830 916
                 if (ofd.FileName != "")
831 917
                 {
918
+                    imgLoad.Visibility = Visibility.Visible;
919
+
832 920
                     #region PPT转PDF
833 921
                     string filepath = ofd.FileName;
834 922
                     string path = ofd.SafeFileName.Replace(".ppt", "").Trim();
@@ -910,6 +998,7 @@ namespace XHWK.WKTool
910 998
                             {
911 999
                                 APP.pageData.currpage = APP.pageData.pagenum + 1;
912 1000
                                 APP.pageData.pagenum += num;
1001
+                                gridPage.Visibility = Visibility.Visible;//页码大于0 显示
913 1002
                             }
914 1003
                             if (APP.pageData.currpage > 0 && APP.pageData.currpage < APP.PageDrawList.Count)
915 1004
                             {
@@ -928,9 +1017,11 @@ namespace XHWK.WKTool
928 1017
                                 ImgScreenshotTwo.Visibility = Visibility.Collapsed;
929 1018
                                 btnScreenshot.IsEnabled = true;
930 1019
                             }
1020
+                            imgLoad.Visibility = Visibility.Collapsed;
931 1021
                         }
932 1022
                         catch (Exception ex)
933 1023
                         {
1024
+                            imgLoad.Visibility = Visibility.Collapsed;
934 1025
                             LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(OpenDialog PPT)" + ex.Message, ex);
935 1026
                         }
936 1027
                     }
@@ -988,9 +1079,11 @@ namespace XHWK.WKTool
988 1079
                                 ImgScreenshotTwo.Visibility = Visibility.Collapsed;
989 1080
                                 btnScreenshot.IsEnabled = true;
990 1081
                             }
1082
+                            imgLoad.Visibility = Visibility.Collapsed;
991 1083
                         }
992 1084
                         catch (Exception ex)
993 1085
                         {
1086
+                            imgLoad.Visibility = Visibility.Collapsed;
994 1087
                             LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(OpenDialog 导入文档)" + ex.Message, ex);
995 1088
                         }
996 1089
                     }
@@ -1061,6 +1154,8 @@ namespace XHWK.WKTool
1061 1154
                 System.Windows.MessageBox.Show("请先导入文档或截图!");
1062 1155
                 return;
1063 1156
             }
1157
+
1158
+            //btnStop.IsEnabled = true;//停止录制按钮可点击
1064 1159
             StartRecord();
1065 1160
         }
1066 1161
         /// <summary>
@@ -1090,6 +1185,19 @@ namespace XHWK.WKTool
1090 1185
             {
1091 1186
                 if (IsFirstR)//是否第一次录制  初始化录制
1092 1187
                 {
1188
+                    #region 计时器初始化
1189
+                    if (t == null)
1190
+                    {
1191
+                        t = new DispatcherTimer();
1192
+                        t.Tick += OnTimer;
1193
+                        t.Interval = new TimeSpan(0, 0, 0, 1);
1194
+                        t.IsEnabled = true;
1195
+                        t.Start();
1196
+                    }
1197
+                    t.Interval = new TimeSpan(0, 0, 0, 1);
1198
+                    Stack(); 
1199
+                    #endregion
1200
+
1093 1201
                     VideoInfo = new Model_Video();
1094 1202
                     VideoInfo.VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"));
1095 1203
                     VideoInfo.WkType = Enum_WKVidetype.RecordingLessons;
@@ -1159,7 +1267,19 @@ namespace XHWK.WKTool
1159 1267
 
1160 1268
                     btnLoginType.IsEnabled = false;
1161 1269
                     #endregion
1162
-
1270
+                    #region 录像倒计时
1271
+                    if (APP.W_CountdownWindow == null)
1272
+                    {
1273
+                        APP.W_CountdownWindow = new CountdownWindow();
1274
+                        //APP.W_CountdownWindow.Topmost = true;
1275
+                    }
1276
+                    else
1277
+                    {
1278
+                        APP.W_CountdownWindow.Initialize();
1279
+                        //APP.W_CountdownWindow.Topmost = true;
1280
+                    }
1281
+                    APP.W_CountdownWindow.Show();
1282
+                    #endregion
1163 1283
                     IsFirstR = false;
1164 1284
                     RsImgName = new List<string>();
1165 1285
                     timer = new System.Timers.Timer(200);//设置执行一次(false)还是一直执行(true)
@@ -1167,19 +1287,7 @@ namespace XHWK.WKTool
1167 1287
                     timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
1168 1288
                     timer.Enabled = true; //启动计时器
1169 1289
                 }
1170
-                #region 录像倒计时
1171
-                if (APP.W_CountdownWindow == null)
1172
-                {
1173
-                    APP.W_CountdownWindow = new CountdownWindow();
1174
-                    //APP.W_CountdownWindow.Topmost = true;
1175
-                }
1176
-                else
1177
-                {
1178
-                    APP.W_CountdownWindow.Initialize();
1179
-                    //APP.W_CountdownWindow.Topmost = true;
1180
-                }
1181
-                APP.W_CountdownWindow.Show();
1182
-                #endregion
1290
+            
1183 1291
                 //继续录制
1184 1292
                 IsSuspendR = false;
1185 1293
                 //BtnRecording.Content = "暂停录制";
@@ -1320,13 +1428,17 @@ namespace XHWK.WKTool
1320 1428
                 btnSetUp.IsEnabled = true;
1321 1429
 
1322 1430
                 btnLoginType.IsEnabled = true;
1431
+
1432
+
1433
+                //btnStop.IsEnabled = false;//停止录制按钮不可点击
1434
+
1323 1435
                 #endregion
1324 1436
 
1325 1437
                 IsSuspendR = true;
1326 1438
                 ImgRecord.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
1327 1439
                 ImgStop.Visibility = Visibility.Visible;
1328 1440
                 ImgStopTwo.Visibility = Visibility.Collapsed;
1329
-                TxbRecordingWord.Text = "保存中";
1441
+                txbType.Text = "保存中";
1330 1442
                 #region 2秒内不可点击
1331 1443
                 new Thread(new ThreadStart(new Action(() =>
1332 1444
                 {
@@ -1388,6 +1500,7 @@ namespace XHWK.WKTool
1388 1500
                             BtnRecord.IsEnabled = true;
1389 1501
                             btnStop.IsEnabled = true;
1390 1502
                             TxbRecordingWord.Text = "录制";
1503
+                            txbType.Text = "";
1391 1504
                         });
1392 1505
                         FileToolsCommon.DeleteFile(ThumbnailPathName);
1393 1506
                         VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
@@ -1431,6 +1544,7 @@ namespace XHWK.WKTool
1431 1544
                 blackboard_canvas.Visibility = Visibility.Visible;
1432 1545
             }
1433 1546
             APP.pageData.pagenum += 1;
1547
+            gridPage.Visibility = Visibility.Visible;//页码大于0 显示
1434 1548
             APP.pageData.currpage = APP.pageData.pagenum;
1435 1549
             myblackboard.changepage(APP.pageData.currpage - 1);
1436 1550
             ///清空页面图片UI
@@ -2398,6 +2512,22 @@ namespace XHWK.WKTool
2398 2512
             //btnOk.Visibility = Visibility.Collapsed;
2399 2513
             //blackboard_canvas.Visibility = Visibility.Visible;
2400 2514
         }
2515
+        /// <summary>
2516
+        /// 截图的图片鼠标右键事件
2517
+        /// </summary>
2518
+        /// <param name="sender"></param>
2519
+        /// <param name="e"></param>
2520
+        private void imgCanvas_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
2521
+        {
2522
+            imgCanvas.Source = null;
2523
+        }
2401 2524
 
2525
+        private void Button_Click(object sender, RoutedEventArgs e)
2526
+        {
2527
+            //System.Windows.SplashScreen(LoadDialog);
2528
+            //Common.system.SplashScreen.Show(typeof(LoadDialog));
2529
+            //Thread.Sleep(5000);
2530
+            //Common.system.SplashScreen.Close();
2531
+        }
2402 2532
     }
2403 2533
 }

+ 10
- 0
XHWK.WKTool/XHWK.WKTool.csproj Ver fichero

@@ -135,6 +135,9 @@
135 135
     <Compile Include="JieTuWindow.xaml.cs">
136 136
       <DependentUpon>JieTuWindow.xaml</DependentUpon>
137 137
     </Compile>
138
+    <Compile Include="LoadDialog.xaml.cs">
139
+      <DependentUpon>LoadDialog.xaml</DependentUpon>
140
+    </Compile>
138 141
     <Compile Include="LoginWindow.xaml.cs">
139 142
       <DependentUpon>LoginWindow.xaml</DependentUpon>
140 143
     </Compile>
@@ -181,6 +184,10 @@
181 184
       <SubType>Designer</SubType>
182 185
       <Generator>MSBuild:Compile</Generator>
183 186
     </Page>
187
+    <Page Include="LoadDialog.xaml">
188
+      <SubType>Designer</SubType>
189
+      <Generator>MSBuild:Compile</Generator>
190
+    </Page>
184 191
     <Page Include="PracticeWindow.xaml">
185 192
       <SubType>Designer</SubType>
186 193
       <Generator>MSBuild:Compile</Generator>
@@ -1515,5 +1522,8 @@
1515 1522
   <ItemGroup>
1516 1523
     <Resource Include="Images\APP.png" />
1517 1524
   </ItemGroup>
1525
+  <ItemGroup>
1526
+    <Resource Include="Images\img_load.gif" />
1527
+  </ItemGroup>
1518 1528
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1519 1529
 </Project>

+ 2
- 2
XHWK.WKTool/ZConfig.cs Ver fichero

@@ -13,9 +13,9 @@ namespace XHWK.WKTool.Config
13 13
         /// <summary>
14 14
         /// 当前版本号
15 15
         /// </summary>
16
-        public static int versionCode = 1;
16
+        public static int versionCode = 2;
17 17
 
18
-        public static string versionName = "1.0.0";
18
+        public static string versionName = "1.0.1";
19 19
 
20 20
         //接口地址
21 21
         public static string apiUrl = isDebug ? "http://schoolapitest.xhkjedu.com" : "http://schoolapi.xhkjedu.com";

Loading…
Cancelar
Guardar