Просмотр исходного кода

zhao:1缩略图增加大小设置,缩小缩略图,2增加不占用图片方式打开图片 3修改我的,列表显示改为缩略图显示

tags/录制修改前
耀 4 лет назад
Родитель
Сommit
734d159ca9

+ 9
- 2
Common/system/FFMpeg.cs Просмотреть файл

@@ -566,7 +566,9 @@ namespace Common.system
566 566
         /// </summary>
567 567
         /// <param name="VideoPath">视频地址</param>
568 568
         /// <param name="ImagePath">图片地址</param>
569
-        public bool GenerateThumbnails(string VideoPath, string ImagePath)
569
+        /// <param name="Width">图片大小</param>
570
+        /// <param name="Height">图片大小</param>
571
+        public bool GenerateThumbnails(string VideoPath, string ImagePath,int Width=0,int Height=0)
570 572
         {
571 573
             while (myProcess != null)
572 574
             {
@@ -577,13 +579,18 @@ namespace Common.system
577 579
             {
578 580
                 KillProcess.Kill();
579 581
             }
582
+            string WHStr = "";
583
+            if(Width>0)
584
+            {
585
+                WHStr = " -s "+ Width + "x"+ Height;
586
+            }
580 587
             try
581 588
             {
582 589
                 myProcess = new Process();
583 590
                 LogPath = CreateffmpegLog();
584 591
                 myProcess.StartInfo.FileName = FileToolsCommon.GetFileAbsolutePath(@"/ffmpeg/bin/ffmpeg.exe");   //ffmpeg.exe的绝对路径
585 592
                                                                                                                  //myProcess.StartInfo.Arguments = "-i \"" + VideoPath + "\" -ss 1 -vframes 1 -r 1 -ac 1 -ab 2 -s " + thubWidth + "*" + thubHeight + " -f image2 \"" + ImagePath + "\"";
586
-                myProcess.StartInfo.Arguments = "-i \"" + VideoPath + "\" -ss 1 -vframes 1 -r 1 -ac 1 -ab 2 -f image2 \"" + ImagePath + "\"";
593
+                myProcess.StartInfo.Arguments = "-i \"" + VideoPath + "\" -ss 1 -vframes 1 -r 1 -ac 1 -ab 2"+ WHStr + " -f image2 \"" + ImagePath + "\"";
587 594
                 myProcess.StartInfo.UseShellExecute = false;           //不使用操作系统外壳程序启动
588 595
                 myProcess.StartInfo.RedirectStandardError = true;      //重定向标准错误输出
589 596
                 myProcess.StartInfo.CreateNoWindow = true;             //不显示程序窗口

+ 27
- 0
Common/system/ImageHelper.cs Просмотреть файл

@@ -78,6 +78,33 @@ namespace Common.system
78 78
                 return null;
79 79
             }
80 80
         }
81
+        /// <summary>
82
+        /// 通过FileStream 来打开文件,这样就可以实现不锁定Image文件,到时可以让多用户同时访问Image文件
83
+        /// </summary>
84
+        /// <param name="path">图片位置</param>
85
+        /// <returns></returns>
86
+        public static BitmapImage ReadBitmapImageFile(string path)
87
+        {
88
+            BitmapImage bitmap = new BitmapImage();
89
+            try
90
+            {
91
+                using (MemoryStream ms = new MemoryStream(File.ReadAllBytes(path)))
92
+                {
93
+                    bitmap = new BitmapImage();
94
+                    bitmap.DecodePixelHeight = 100;
95
+                    bitmap.BeginInit();
96
+                    bitmap.CacheOption = BitmapCacheOption.OnLoad;//设置缓存模式
97
+                    bitmap.StreamSource = ms;//通过StreamSource加载图片
98
+                    bitmap.EndInit();
99
+                    bitmap.Freeze();
100
+                }
101
+                return bitmap; 
102
+            }
103
+            catch (Exception)
104
+            {
105
+                return null;
106
+            }
107
+        }
81 108
         #region 获取RGB
82 109
 
83 110
         private static Bitmap _Bitmap = null;

Двоичные данные
XHWK.WKTool/Images/VideoList_OK.png Просмотреть файл


Двоичные данные
XHWK.WKTool/Images/VideoList_Play.png Просмотреть файл


+ 1
- 1
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs Просмотреть файл

@@ -504,7 +504,7 @@ namespace XHWK.WKTool
504 504
                         VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
505 505
                         VideoInfo.VideoPath = VideoSavePathName;
506 506
                         VideoInfo.ThumbnailPath = ThumbnailPathName;
507
-                        APP.FFmpeg.GenerateThumbnails(VideoSavePathName, ThumbnailPathName);
507
+                        APP.FFmpeg.GenerateThumbnails(VideoSavePathName, ThumbnailPathName,200,130);
508 508
                         VideoInfo.FileGuid = Guid.NewGuid().ToString();
509 509
                         VideoInfo.IsUpload = false;
510 510
                         VideoInfo.Uploaded = 0;

+ 37
- 0
XHWK.WKTool/UControl/Uc_VideoItem.xaml Просмотреть файл

@@ -0,0 +1,37 @@
1
+<UserControl x:Class="XHWK.WKTool.UControl.Uc_VideoItem"
2
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
5
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
6
+             xmlns:local="clr-namespace:XHWK.WKTool.UControl"
7
+             mc:Ignorable="d" 
8
+             d:DesignHeight="300" d:DesignWidth="250">
9
+    <Grid>
10
+        <Button x:Name="BtnVideoPlay" HorizontalAlignment="Center" Width="200" Height="130" Margin="25,10,25,0" VerticalAlignment="Top" Cursor="Hand" Click="BtnVideoPlay_Click">
11
+            <Image x:Name="ImgVideo" VerticalAlignment="Top"  Width="200" Height="130" Margin="0,0,0,0" Cursor="Hand" Stretch="Fill"/>
12
+        </Button>
13
+        <Image x:Name="ImgVideoPlay" Source="/星火微课;component/Images/VideoList_Play.png" HorizontalAlignment="Center" VerticalAlignment="Top" Width="60" Margin="0,50,0,0" Cursor="Hand" MouseLeftButtonDown="Image_MouseLeftButtonDown" />
14
+        <TextBlock x:Name="TbName" Text="一二三四五六七八九十..." HorizontalAlignment="Center" Margin="15,160,15,0" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="#FF3492F4" FontSize="18" TextAlignment="Center" ToolTip="" Visibility="Visible" MouseLeftButtonDown="TextBlock_MouseLeftButtonDown"/>
15
+        <TextBox x:Name="TxtModify" HorizontalAlignment="Left" Height="30" Margin="25,157,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="180" FontSize="16" Visibility="Hidden" LostFocus="TxtModify_LostFocus" KeyUp="TxtModify_KeyUp">
16
+            <TextBox.Resources>
17
+                <Style TargetType="{x:Type Border}">
18
+                    <Setter Property="CornerRadius" Value="3"/>
19
+                    <Setter Property="BorderBrush" Value="#3492F4"/>
20
+                </Style>
21
+            </TextBox.Resources>
22
+        </TextBox>
23
+        <Button x:Name="BtnNameModifyOK" HorizontalAlignment="Left" Margin="200,157,0,0" VerticalAlignment="Top" Width="30" Height="30" Background="White" BorderBrush="#FFABADB3" Click="BtnNameModifyOK_Click" Visibility="Hidden">
24
+            <Button.Resources>
25
+                <Style TargetType="{x:Type Border}">
26
+                    <Setter Property="CornerRadius" Value="3"/>
27
+                    <Setter Property="BorderBrush" Value="#3492F4"/>
28
+                </Style>
29
+            </Button.Resources>
30
+            <Image Source="/星火微课;component/Images/VideoList_OK.png"></Image>
31
+        </Button>
32
+        <Label x:Name="lblDateSize" Content="2020-10-10 10:10:00|1000.00MB" HorizontalAlignment="Center" Margin="0,205,0,0" VerticalAlignment="Top" Height="30" Width="240" Foreground="#FF9A9A9A" FontSize="13" HorizontalContentAlignment="Center"/>
33
+        <Button x:Name="BtnUpload" Content="上传" HorizontalAlignment="Left" Margin="25,248,0,0" VerticalAlignment="Top" Width="90" Height="34" Background="#FF3492F4" Foreground="White" FontSize="18" Click="BtnUpload_Click"/>
34
+        <Button x:Name="BtnDelVideo" Content="删除" HorizontalAlignment="Right" Margin="0,248,25,0" VerticalAlignment="Top" Width="90" Height="34" Foreground="White" FontSize="18" Background="#FFF0582C" Click="BtnDelVideo_Click"/>
35
+
36
+    </Grid>
37
+</UserControl>

+ 358
- 0
XHWK.WKTool/UControl/Uc_VideoItem.xaml.cs Просмотреть файл

@@ -0,0 +1,358 @@
1
+using Common.system;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Diagnostics;
5
+using System.Linq;
6
+using System.Text;
7
+using System.Threading.Tasks;
8
+using System.Windows;
9
+using System.Windows.Controls;
10
+using System.Windows.Data;
11
+using System.Windows.Documents;
12
+using System.Windows.Input;
13
+using System.Windows.Media;
14
+using System.Windows.Media.Imaging;
15
+using System.Windows.Navigation;
16
+using System.Windows.Shapes;
17
+using XHWK.Model;
18
+using XHWK.WKTool.DAL;
19
+
20
+namespace XHWK.WKTool.UControl
21
+{
22
+    /// <summary>
23
+    /// 视频信息
24
+    /// </summary>
25
+    public partial class Uc_VideoItem : UserControl
26
+    {
27
+        #region 初始值
28
+        /// <summary>
29
+        /// 视频模型
30
+        /// </summary>
31
+        Model_Video VideoModel = new Model_Video();
32
+        /// <summary>
33
+        /// 刷新视频列表
34
+        /// </summary>
35
+        public delegate void RefreshVideoList();
36
+        /// <summary>
37
+        /// 刷新视频列表事件
38
+        /// </summary>
39
+        public event RefreshVideoList Click_refreshVideoList;
40
+        /// <summary>
41
+        /// 登陆
42
+        /// </summary>
43
+        public delegate void UploadLogin();
44
+        /// <summary>
45
+        /// 登陆事件
46
+        /// </summary>
47
+        public event UploadLogin Click_UploadLogin;
48
+        /// <summary>
49
+        /// 上传页面
50
+        /// </summary>
51
+        UploadWindow W_UploadWindow = null;
52
+        /// <summary>
53
+        /// 是否正在
54
+        /// </summary>
55
+        bool IsUpLoad = false;
56
+        #endregion
57
+
58
+        #region 初始化
59
+        /// <summary>
60
+        /// 视频信息
61
+        /// </summary>
62
+        /// <param name="model_Video"></param>
63
+        public Uc_VideoItem(Model_Video model_Video)
64
+        {
65
+            InitializeComponent();
66
+            VideoModel = model_Video;
67
+            if (FileToolsCommon.IsExistFile(VideoModel.ThumbnailPath))
68
+            {
69
+                ImgVideo.Source = ImageHelper.ReadBitmapImageFile(VideoModel.ThumbnailPath);// new BitmapImage(new Uri(VideoModel.ThumbnailPath));
70
+            }
71
+            string videoName = FileToolsCommon.GetIOFileNameNoExtension(VideoModel.VideoPath);
72
+            TbName.Text = videoName.Length > 20 ? videoName.Substring(0, 20) + "..." : videoName;
73
+            TbName.ToolTip = videoName;
74
+            lblDateSize.Content = VideoModel.RSTime + "|" + VideoModel.VideoSize;
75
+            //if (VideoModel.IsUpload)
76
+            //{
77
+            //    BtnUpload.Visibility = Visibility.Hidden;
78
+            //}
79
+        }
80
+        #endregion
81
+
82
+        #region 修改视频名
83
+        /// <summary>
84
+        /// 双击修改视频名
85
+        /// </summary>
86
+        /// <param name="sender"></param>
87
+        /// <param name="e"></param>
88
+        private void TextBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
89
+        {
90
+            if(e.ClickCount==2)
91
+            {
92
+                TxtModify.Text = TbName.Text;
93
+                TbName.Visibility = Visibility.Hidden;
94
+                TxtModify.Visibility = Visibility.Visible;
95
+                BtnNameModifyOK.Visibility = Visibility.Visible;
96
+            }
97
+        }
98
+        /// <summary>
99
+        /// 失去焦点保存视频名
100
+        /// </summary>
101
+        /// <param name="sender"></param>
102
+        /// <param name="e"></param>
103
+        private void TxtModify_LostFocus(object sender, RoutedEventArgs e)
104
+        {
105
+            ModifyVideoName();
106
+        }
107
+
108
+        /// <summary>
109
+        /// Enter保存
110
+        /// </summary>
111
+        /// <param name="sender"></param>
112
+        /// <param name="e"></param>
113
+        private void TxtModify_KeyUp(object sender, KeyEventArgs e)
114
+        {
115
+            if (e.Key == System.Windows.Input.Key.Enter)
116
+            {
117
+                ModifyVideoName();
118
+            }
119
+        }
120
+        /// <summary>
121
+        /// 修改文件名保存
122
+        /// </summary>
123
+        /// <param name="sender"></param>
124
+        /// <param name="e"></param>
125
+        private void BtnNameModifyOK_Click(object sender, RoutedEventArgs e)
126
+        {
127
+            ModifyVideoName();
128
+        }
129
+        /// <summary>
130
+        /// 修改视频文件名
131
+        /// </summary>
132
+        void ModifyVideoName()
133
+        {
134
+            if (TxtModify.Text != TbName.Text)
135
+            {
136
+                string ErrMessage;
137
+                if (ModifyPathName(VideoModel.FileGuid, TxtModify.Text + "." + VideoModel.VideoType, out ErrMessage))
138
+                {
139
+                    //保存成功
140
+                    TbName.Text = TxtModify.Text.Length > 20 ? TxtModify.Text.Substring(0, 20) + "..." : TxtModify.Text;
141
+                    TbName.ToolTip = TxtModify.Text;
142
+                    TbName.Visibility = Visibility.Visible;
143
+                    TxtModify.Visibility = Visibility.Hidden;
144
+                    BtnNameModifyOK.Visibility = Visibility.Hidden;
145
+                }
146
+                else
147
+                {
148
+                    MessageWindow.Show(ErrMessage);
149
+                }
150
+            }
151
+            else
152
+            {
153
+                TbName.Visibility = Visibility.Visible;
154
+                TxtModify.Visibility = Visibility.Hidden;
155
+                BtnNameModifyOK.Visibility = Visibility.Hidden;
156
+            }
157
+        }
158
+        /// <summary>
159
+        /// 修改视频文件名
160
+        /// </summary>
161
+        /// <param name="Guid">唯一编号</param>
162
+        /// <param name="NewName">新文件名带后缀 不带路径</param>
163
+        /// <param name="Errmessage">错误信息</param>
164
+        /// <returns></returns>
165
+        private bool ModifyPathName(string FileGuid, string NewName, out string Errmessage)
166
+        {
167
+            Errmessage = "";
168
+            foreach (Model_WKData WKData in APP.WKDataList)
169
+            {
170
+                if (WKData.VideoList.Exists(x => x.FileGuid == FileGuid))
171
+                {
172
+
173
+                    Model_Video model_Video = WKData.VideoList.Find(x => x.FileGuid == FileGuid);
174
+
175
+                    string filePathName = model_Video.VideoPath;
176
+                    string filePath = FileToolsCommon.GetDirectoryName(filePathName);
177
+                    string newFilePathName = filePath + NewName;
178
+                    //缩略图
179
+                    string ThumbnailPath = filePath + "ThumbnailPath/";
180
+                    FileToolsCommon.CreateDirectory(ThumbnailPath);
181
+                    //缩略图存储位置
182
+                    string ThumbnailPathName = ThumbnailPath + NewName.Replace(".", "") + ".JPG";
183
+                    if (FileToolsCommon.IsExistFile(newFilePathName))
184
+                    {
185
+                        Errmessage = "文件已存在,请重新修改文件名!";
186
+                        return false;
187
+                    }
188
+                    else
189
+                    {
190
+                        //修改文件名
191
+                        FileToolsCommon.Copy(filePathName, newFilePathName);
192
+                        model_Video.VideoPath = newFilePathName;
193
+                        //修改缩略图名
194
+                        FileToolsCommon.DeleteFile(ThumbnailPathName);
195
+                        FileToolsCommon.Copy(model_Video.ThumbnailPath, ThumbnailPathName);
196
+                        model_Video.ThumbnailPath = ThumbnailPathName;
197
+                        APP.SaveWkData();
198
+                        return true;
199
+                    }
200
+                }
201
+                else
202
+                {
203
+                    continue;
204
+                }
205
+            }
206
+            Errmessage = "视频文件有改动,当前文件不存在,请关闭后重新打开“我的”";
207
+            return false;
208
+        }
209
+
210
+        #endregion
211
+
212
+        #region 删除视频
213
+        /// <summary>
214
+        /// 删除视频
215
+        /// </summary>
216
+        /// <param name="sender"></param>
217
+        /// <param name="e"></param>
218
+        private void BtnDelVideo_Click(object sender, RoutedEventArgs e)
219
+        {
220
+            MessageBoxResult dr = MessageWindow.Show("确定删除该视频?", "提示", MessageBoxButton.OKCancel);
221
+            if (dr == MessageBoxResult.OK)
222
+            {
223
+                foreach (Model_WKData wKData in APP.WKDataList)
224
+                {
225
+                    if (wKData.VideoList == null)
226
+                    {
227
+                        continue;
228
+                    }
229
+                    if (wKData.VideoList.Exists(x => x.FileGuid == VideoModel.FileGuid))
230
+                    {
231
+                        try
232
+                        {
233
+                            FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == VideoModel.FileGuid).VideoPath);
234
+                            string ThumbnailPath = wKData.VideoList.Find(x => x.FileGuid == VideoModel.FileGuid).ThumbnailPath;
235
+                            wKData.VideoList.Remove(wKData.VideoList.Find(x => x.FileGuid == VideoModel.FileGuid));
236
+                            //初始化页面  刷新视频列表
237
+                            Click_refreshVideoList();
238
+                            ImgVideo.Source = null;
239
+                            GC.Collect();
240
+                            FileToolsCommon.DeleteFile(ThumbnailPath);
241
+                            return;
242
+                        }
243
+                        catch (Exception ex)
244
+                        {
245
+                            MessageWindow.Show("无法删除视频!" + ex.Message);
246
+                            return;
247
+                        }
248
+                    }
249
+                }
250
+            }
251
+        }
252
+        #endregion
253
+
254
+        #region 播放视频
255
+
256
+        private void BtnVideoPlay_Click(object sender, RoutedEventArgs e)
257
+        {
258
+            try
259
+            {
260
+                ProcessStartInfo psi = new ProcessStartInfo(VideoModel.VideoPath);
261
+                Process pro = new Process
262
+                {
263
+                    StartInfo = psi
264
+                };
265
+                pro.Start();
266
+            }
267
+            catch (Exception ex)
268
+            {
269
+                LogHelper.WriteErrLog("【视频播放】(BtnVideoPlay_Click)" + ex.Message, ex);
270
+                System.Windows.MessageBox.Show(ex.Message);
271
+                return;
272
+            }
273
+        }
274
+        /// <summary>
275
+        /// 视频播放
276
+        /// </summary>
277
+        /// <param name="sender"></param>
278
+        /// <param name="e"></param>
279
+        private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
280
+        {
281
+            try
282
+            {
283
+                ProcessStartInfo psi = new ProcessStartInfo(VideoModel.VideoPath);
284
+                Process pro = new Process
285
+                {
286
+                    StartInfo = psi
287
+                };
288
+                pro.Start();
289
+            }
290
+            catch (Exception ex)
291
+            {
292
+                LogHelper.WriteErrLog("【视频播放】(BtnVideoPlay_Click)" + ex.Message, ex);
293
+                System.Windows.MessageBox.Show(ex.Message);
294
+                return;
295
+            }
296
+
297
+        }
298
+        #endregion
299
+
300
+        /// <summary>
301
+        /// 视频上传
302
+        /// </summary>
303
+        /// <param name="sender"></param>
304
+        /// <param name="e"></param>
305
+        private void BtnUpload_Click(object sender, RoutedEventArgs e)
306
+        {
307
+            if (APP.IsLoginType == false)
308
+            {
309
+                //登陆
310
+                Click_UploadLogin();
311
+                return;
312
+            }
313
+            if (!IsUpLoad)
314
+            {
315
+                IsUpLoad = true;
316
+                BtnUpload.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#9EA0A7"));
317
+                DAL_Upload dAL_Upload = new DAL_Upload();
318
+
319
+                if (dAL_Upload.UploadVideo(VideoModel.FileGuid, out string ErrMessage))
320
+                {
321
+                    //MessageWindow.Show("视频上传服务器成功!");
322
+                    if (W_UploadWindow == null)
323
+                    {
324
+                        W_UploadWindow = new UploadWindow
325
+                        {
326
+                            Owner = APP.W_XHMicroLessonSystemWindow
327
+                        };
328
+                        W_UploadWindow.ChangeTextEvents += frm_ChangeTextEvents; ;
329
+                    }
330
+
331
+                    //long size = Convert.ToInt64(FileToolsCommon.GetFileSizeByMB(pageData.menuList[i].FilePath));
332
+                    W_UploadWindow.Initialize(TbName.Text, VideoModel.VideoSizebyte, VideoModel.VideoType.ToString(), VideoModel.FileGuid, 0);
333
+                    W_UploadWindow.ShowDialog();
334
+                }
335
+                else
336
+                {
337
+                    IsUpLoad = false;
338
+                    BtnUpload.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3491F4"));
339
+                    MessageWindow.Show(ErrMessage);
340
+                }
341
+            }
342
+        }
343
+
344
+        /// <summary>
345
+        /// 上传返回事件
346
+        /// </summary>
347
+        /// <param name="text"></param>
348
+        private void frm_ChangeTextEvents(string text, int i)
349
+        {
350
+            if ("上传成功".Equals(text))
351
+            {
352
+                W_UploadWindow.Close();
353
+                BtnUpload.Visibility = Visibility.Hidden;
354
+            }
355
+        }
356
+
357
+    }
358
+}

+ 340
- 328
XHWK.WKTool/XHMicroLessonSystemWindow.xaml Просмотреть файл

@@ -156,141 +156,141 @@
156 156
     </Window.BorderBrush>
157 157
 
158 158
     <Viewbox>
159
-    <Grid x:Name="GridContent" Height="1030" Width="1276">
160
-        <!--分3行-->
161
-        <Grid.RowDefinitions>
162
-            <RowDefinition Height="auto"/>
163
-            <RowDefinition Height="*"/>
164
-            <RowDefinition Height="auto"/>
165
-        </Grid.RowDefinitions>
166
-        <Grid Grid.Row="0" Background="#2D8CF0" MouseLeftButtonDown="Window_MouseLeftButtonDown" Margin="0,0,0,0" MinHeight="100px" MouseDown="Grid_MouseDown">
159
+        <Grid x:Name="GridContent" Height="1030" Width="1276">
160
+            <!--分3行-->
167 161
             <Grid.RowDefinitions>
168 162
                 <RowDefinition Height="auto"/>
163
+                <RowDefinition Height="*"/>
169 164
                 <RowDefinition Height="auto"/>
170 165
             </Grid.RowDefinitions>
171
-            <!--第一行-->
172
-            <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="10,2,10,0">
173
-                <Image Source="./Images/microLessonSystem_0.png"/>
174
-                <TextBlock Text="星火微课系统" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"/>
175
-            </StackPanel>
176
-
177
-            <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,2,20,0">
178
-                <Button Cursor="Hand" x:Name="btnLoginType" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,10,0" Click="BtnLoginType_Click">
179
-                    <StackPanel Orientation="Horizontal">
180
-                        <Image Source="./Images/microLessonSystem_9.png"/>
181
-                        <TextBlock x:Name="txbLoginType" Text="未登录" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"
166
+            <Grid Grid.Row="0" Background="#2D8CF0" MouseLeftButtonDown="Window_MouseLeftButtonDown" Margin="0,0,0,0" MinHeight="100px" MouseDown="Grid_MouseDown">
167
+                <Grid.RowDefinitions>
168
+                    <RowDefinition Height="auto"/>
169
+                    <RowDefinition Height="auto"/>
170
+                </Grid.RowDefinitions>
171
+                <!--第一行-->
172
+                <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="10,2,10,0">
173
+                    <Image Source="./Images/microLessonSystem_0.png"/>
174
+                    <TextBlock Text="星火微课系统" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"/>
175
+                </StackPanel>
176
+
177
+                <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,2,20,0">
178
+                    <Button Cursor="Hand" x:Name="btnLoginType" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,10,0" Click="BtnLoginType_Click">
179
+                        <StackPanel Orientation="Horizontal">
180
+                            <Image Source="./Images/microLessonSystem_9.png"/>
181
+                            <TextBlock x:Name="txbLoginType" Text="未登录" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"
182 182
                                    />
183
-                    </StackPanel>
184
-                </Button>
185
-                <Button Cursor="Hand" x:Name="btnShrink" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnShrink_Click" Margin="8,0,8,0">
186
-                    <Image Source="./Images/microLessonSystem_19.png"/>
187
-                </Button>
188
-                <!--<Button Cursor="Hand" x:Name="btnEnlarge" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="8,0,8,0">
183
+                        </StackPanel>
184
+                    </Button>
185
+                    <Button Cursor="Hand" x:Name="btnShrink" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnShrink_Click" Margin="8,0,8,0">
186
+                        <Image Source="./Images/microLessonSystem_19.png"/>
187
+                    </Button>
188
+                    <!--<Button Cursor="Hand" x:Name="btnEnlarge" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="8,0,8,0">
189 189
                         <Image Source="./Images/microLessonSystem_8.png"/>
190 190
                     </Button>-->
191
-                <Button Cursor="Hand" x:Name="btnDown" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click" >
192
-                    <Image Source="./Images/microLessonSystem_10.png"/>
193
-                </Button>
194
-            </StackPanel>
191
+                    <Button Cursor="Hand" x:Name="btnDown" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click" >
192
+                        <Image Source="./Images/microLessonSystem_10.png"/>
193
+                    </Button>
194
+                </StackPanel>
195 195
 
196 196
 
197
-            <!--第二行-->
197
+                <!--第二行-->
198 198
 
199
-            <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,0,0,5" HorizontalAlignment="Left">
200
-                <Button Cursor="Hand" x:Name="btnScreenRecording" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnScreenRecording_Click" Margin="30,0,0,0">
201
-                    <StackPanel Orientation="Vertical">
202
-                        <Image x:Name="ImgScreenRecording" Source="./Images/microLessonSystem_2.png"/>
203
-                        <Image x:Name="ImgScreenRecordingTwo" Source="./Images/microLessonSystem_3.png" Visibility="Collapsed"/>
204
-                        <TextBlock x:Name="TxbRecordScreenWord" Text="录屏" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
205
-                    </StackPanel>
206
-                </Button>
207
-                <Button Cursor="Hand" x:Name="btnScreenshot" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,0,0" Click="BtnScreenshot_Click">
208
-                    <StackPanel Orientation="Vertical">
209
-                        <Image x:Name="ImgScreenshot" Source="./Images/microLessonSystem_12.png"/>
210
-                        <Image x:Name="ImgScreenshotTwo" Source="./Images/microLessonSystem_11.png" Visibility="Collapsed"/>
211
-                        <TextBlock Text="截图" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
212
-                    </StackPanel>
213
-                </Button>
214
-                <Button Cursor="Hand" x:Name="btnImport" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnImport_Click" Margin="30,0,0,0">
215
-                    <StackPanel Orientation="Vertical">
216
-                        <Image x:Name="ImgImport" Source="./Images/microLessonSystem_6.png"/>
217
-                        <Image x:Name="ImgImportTwo" Source="./Images/microLessonSystem_7.png" Visibility="Collapsed"/>
218
-                        <TextBlock Text="导入" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
219
-                    </StackPanel>
220
-                </Button>
221
-                <Button Cursor="Hand" x:Name="BtnRecord" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="100,0,0,0" Click="BtnRecord_Click">
222
-                    <StackPanel Orientation="Vertical">
223
-                        <Image x:Name="ImgRecord" Source="./Images/microLessonSystem_14.png"/>
224
-                        <Image x:Name="ImgRecordTwo" Source="./Images/microLessonSystem_13.png" Visibility="Collapsed"/>
225
-                        <TextBlock x:Name="TxbRecordingWord" Text="录制" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
226
-                    </StackPanel>
227
-                </Button>
228
-                <Button Cursor="Hand" x:Name="btnStop" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnStop_Click" Margin="30,0,0,0">
229
-                    <StackPanel Orientation="Vertical">
230
-                        <Image x:Name="ImgStop" Source="./Images/microLessonSystem_21.png"/>
231
-                        <Image x:Name="ImgStopTwo" Source="./Images/microLessonSystem_20.png" Visibility="Collapsed"/>
232
-                        <TextBlock Text="停止" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
233
-                    </StackPanel>
234
-                </Button>
235
-                <TextBlock x:Name="txbTime" Text="" FontSize="20" Foreground="#FFFFFF" Margin="20,20,0,0"/>
236
-            </StackPanel>
237
-            <StackPanel Grid.Row="1" HorizontalAlignment="Center">
238
-                <TextBlock x:Name="txbType" Text="" FontSize="20" Foreground="#FFFFFF" Margin="0,25,0,0"/>
239
-            </StackPanel>
240
-            <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,5">
241
-                <Button Cursor="Hand" x:Name="btnAdd" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnAdd_Click" Margin="0,0,30,0">
242
-                    <StackPanel Orientation="Vertical">
243
-                        <Image x:Name="ImgAdd" Source="./Images/microLessonSystem_25.png" Visibility="Visible"/>
244
-                        <Image x:Name="ImgAddTwo" Source="./Images/microLessonSystem_24.png" Visibility="Collapsed"/>
245
-                        <TextBlock Text="增加" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
246
-                    </StackPanel>
247
-                </Button>
248
-                <Button Cursor="Hand" x:Name="btnPrint" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnPrint_Click">
249
-                    <StackPanel Orientation="Vertical">
250
-                        <Image x:Name="ImgPrint" Source="./Images/microLessonSystem_4.png" Visibility="Collapsed"/>
251
-                        <Image x:Name="ImgPrintTwo" Source="./Images/microLessonSystem_5.png" Visibility="Visible"/>
252
-                        <TextBlock Text="打印" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
253
-                    </StackPanel>
254
-                </Button>
255
-                <!--<Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click" Margin="0,0,30,0">
199
+                <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,0,0,5" HorizontalAlignment="Left">
200
+                    <Button Cursor="Hand" x:Name="btnScreenRecording" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnScreenRecording_Click" Margin="30,0,0,0">
201
+                        <StackPanel Orientation="Vertical">
202
+                            <Image x:Name="ImgScreenRecording" Source="./Images/microLessonSystem_2.png"/>
203
+                            <Image x:Name="ImgScreenRecordingTwo" Source="./Images/microLessonSystem_3.png" Visibility="Collapsed"/>
204
+                            <TextBlock x:Name="TxbRecordScreenWord" Text="录屏" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
205
+                        </StackPanel>
206
+                    </Button>
207
+                    <Button Cursor="Hand" x:Name="btnScreenshot" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,0,0" Click="BtnScreenshot_Click">
208
+                        <StackPanel Orientation="Vertical">
209
+                            <Image x:Name="ImgScreenshot" Source="./Images/microLessonSystem_12.png"/>
210
+                            <Image x:Name="ImgScreenshotTwo" Source="./Images/microLessonSystem_11.png" Visibility="Collapsed"/>
211
+                            <TextBlock Text="截图" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
212
+                        </StackPanel>
213
+                    </Button>
214
+                    <Button Cursor="Hand" x:Name="btnImport" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnImport_Click" Margin="30,0,0,0">
215
+                        <StackPanel Orientation="Vertical">
216
+                            <Image x:Name="ImgImport" Source="./Images/microLessonSystem_6.png"/>
217
+                            <Image x:Name="ImgImportTwo" Source="./Images/microLessonSystem_7.png" Visibility="Collapsed"/>
218
+                            <TextBlock Text="导入" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
219
+                        </StackPanel>
220
+                    </Button>
221
+                    <Button Cursor="Hand" x:Name="BtnRecord" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="100,0,0,0" Click="BtnRecord_Click">
222
+                        <StackPanel Orientation="Vertical">
223
+                            <Image x:Name="ImgRecord" Source="./Images/microLessonSystem_14.png"/>
224
+                            <Image x:Name="ImgRecordTwo" Source="./Images/microLessonSystem_13.png" Visibility="Collapsed"/>
225
+                            <TextBlock x:Name="TxbRecordingWord" Text="录制" Padding="0,6,0,0" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
226
+                        </StackPanel>
227
+                    </Button>
228
+                    <Button Cursor="Hand" x:Name="btnStop" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnStop_Click" Margin="30,0,0,0">
229
+                        <StackPanel Orientation="Vertical">
230
+                            <Image x:Name="ImgStop" Source="./Images/microLessonSystem_21.png"/>
231
+                            <Image x:Name="ImgStopTwo" Source="./Images/microLessonSystem_20.png" Visibility="Collapsed"/>
232
+                            <TextBlock Text="停止" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
233
+                        </StackPanel>
234
+                    </Button>
235
+                    <TextBlock x:Name="txbTime" Text="" FontSize="20" Foreground="#FFFFFF" Margin="20,20,0,0"/>
236
+                </StackPanel>
237
+                <StackPanel Grid.Row="1" HorizontalAlignment="Center">
238
+                    <TextBlock x:Name="txbType" Text="" FontSize="20" Foreground="#FFFFFF" Margin="0,25,0,0"/>
239
+                </StackPanel>
240
+                <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,5">
241
+                    <Button Cursor="Hand" x:Name="btnAdd" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnAdd_Click" Margin="0,0,30,0">
242
+                        <StackPanel Orientation="Vertical">
243
+                            <Image x:Name="ImgAdd" Source="./Images/microLessonSystem_25.png" Visibility="Visible"/>
244
+                            <Image x:Name="ImgAddTwo" Source="./Images/microLessonSystem_24.png" Visibility="Collapsed"/>
245
+                            <TextBlock Text="增加" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
246
+                        </StackPanel>
247
+                    </Button>
248
+                    <Button Cursor="Hand" x:Name="btnPrint" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnPrint_Click">
249
+                        <StackPanel Orientation="Vertical">
250
+                            <Image x:Name="ImgPrint" Source="./Images/microLessonSystem_4.png" Visibility="Collapsed"/>
251
+                            <Image x:Name="ImgPrintTwo" Source="./Images/microLessonSystem_5.png" Visibility="Visible"/>
252
+                            <TextBlock Text="打印" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
253
+                        </StackPanel>
254
+                    </Button>
255
+                    <!--<Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click" Margin="0,0,30,0">
256 256
                         <StackPanel Orientation="Vertical">
257 257
                             <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_15.png" Visibility="Collapsed"/>
258 258
                             <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_16.png" Visibility="Visible"/>
259 259
                             <TextBlock Text="上传" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
260 260
                         </StackPanel>
261 261
                     </Button>-->
262
-                <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnUpload_Click">
263
-                    <StackPanel Orientation="Vertical">
264
-                        <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_22.png" Visibility="Visible"/>
265
-                        <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_1.png" Visibility="Collapsed"/>
266
-                        <TextBlock Text="我的" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
267
-                    </StackPanel>
268
-                </Button>
269
-                <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnSetUp_Click">
270
-                    <StackPanel Orientation="Vertical">
271
-                        <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png" Visibility="Visible"/>
272
-                        <Image x:Name="ImgSetUpTwo" Source="./Images/microLessonSystem_17.png" Visibility="Collapsed"/>
273
-                        <TextBlock Text="设置" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
274
-                    </StackPanel>
275
-                </Button>
276
-            </StackPanel>
262
+                    <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnUpload_Click">
263
+                        <StackPanel Orientation="Vertical">
264
+                            <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_22.png" Visibility="Visible"/>
265
+                            <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_1.png" Visibility="Collapsed"/>
266
+                            <TextBlock Text="我的" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
267
+                        </StackPanel>
268
+                    </Button>
269
+                    <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnSetUp_Click">
270
+                        <StackPanel Orientation="Vertical">
271
+                            <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png" Visibility="Visible"/>
272
+                            <Image x:Name="ImgSetUpTwo" Source="./Images/microLessonSystem_17.png" Visibility="Collapsed"/>
273
+                            <TextBlock Text="设置" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
274
+                        </StackPanel>
275
+                    </Button>
276
+                </StackPanel>
277 277
             </Grid>
278 278
 
279
-        <!--主内容-->
280
-        <Grid Grid.Row="1" x:Name="GridMain" Visibility="Visible">
281
-            <ScrollViewer x:Name="scroMain" VerticalScrollBarVisibility="Visible">
282
-                <Grid x:Name="gridM"  Margin="0,0,0,0" Background="#FFFFFF" Visibility="Visible" Height="1780">
283
-                    <Grid>
284
-                        <Border Grid.Row="1"  CornerRadius="5">
285
-                            <Grid x:Name="IMG" Margin="0,0,0,0">
286
-                                <Grid.Resources>
287
-                                    <TransformGroup x:Key="Imageview">
288
-                                        <ScaleTransform/>
289
-                                        <TranslateTransform/>
290
-                                    </TransformGroup>
291
-                                </Grid.Resources>
292
-
293
-                                <!--<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled"   Cursor="SizeAll"
279
+            <!--主内容-->
280
+            <Grid Grid.Row="1" x:Name="GridMain" Visibility="Visible">
281
+                <ScrollViewer x:Name="scroMain" VerticalScrollBarVisibility="Visible">
282
+                    <Grid x:Name="gridM"  Margin="0,0,0,0" Background="#FFFFFF" Visibility="Visible" Height="1780">
283
+                        <Grid>
284
+                            <Border Grid.Row="1"  CornerRadius="5">
285
+                                <Grid x:Name="IMG" Margin="0,0,0,0">
286
+                                    <Grid.Resources>
287
+                                        <TransformGroup x:Key="Imageview">
288
+                                            <ScaleTransform/>
289
+                                            <TranslateTransform/>
290
+                                        </TransformGroup>
291
+                                    </Grid.Resources>
292
+
293
+                                    <!--<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled"   Cursor="SizeAll"
294 294
                   Margin="0,0,0,0" Focusable="False" x:Name="BackFrame">
295 295
                                             <ContentControl  MouseLeftButtonDown="IMG1_MouseLeftButtonDown"   
296 296
                              MouseLeftButtonUp="IMG1_MouseLeftButtonUp"
@@ -298,100 +298,100 @@
298 298
                              MouseWheel="IMG1_MouseWheel" >
299 299
                                             </ContentControl>
300 300
                                         </ScrollViewer>-->
301
-                                <!--图片表框 -->
302
-                                <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"/>
303
-                                <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"/>
304
-                                <!--四个点 -->
305
-                                <Canvas>
306
-                                    <Thumb x:Name="RectLeftUp" Cursor="SizeNWSE"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="314" Canvas.Top="157" Background="White" BorderBrush="#2D8CF0" BorderThickness="2"  DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
307
-                                    <Thumb x:Name="RectRightUp" Cursor="SizeNESW"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="775" Canvas.Top="157" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
308
-                                    <Thumb x:Name="RectLeftDown" Cursor="SizeNESW"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="314" Canvas.Top="508" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
309
-                                    <Thumb x:Name="RectRightDown" Cursor="SizeNWSE"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="775" Canvas.Top="508" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
310
-                                </Canvas>
311
-                            </Grid>
312
-                        </Border>
313
-                    </Grid>
314
-                    <Image x:Name="imgDocumentation" Visibility="Visible" VerticalAlignment="Top"/>
301
+                                    <!--图片表框 -->
302
+                                    <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"/>
303
+                                    <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"/>
304
+                                    <!--四个点 -->
305
+                                    <Canvas>
306
+                                        <Thumb x:Name="RectLeftUp" Cursor="SizeNWSE"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="314" Canvas.Top="157" Background="White" BorderBrush="#2D8CF0" BorderThickness="2"  DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
307
+                                        <Thumb x:Name="RectRightUp" Cursor="SizeNESW"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="775" Canvas.Top="157" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
308
+                                        <Thumb x:Name="RectLeftDown" Cursor="SizeNESW"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="314" Canvas.Top="508" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
309
+                                        <Thumb x:Name="RectRightDown" Cursor="SizeNWSE"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="775" Canvas.Top="508" Background="White" BorderBrush="#2D8CF0" BorderThickness="2" DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
310
+                                    </Canvas>
311
+                                </Grid>
312
+                            </Border>
313
+                        </Grid>
314
+                        <Image x:Name="imgDocumentation" Visibility="Visible" VerticalAlignment="Top"/>
315 315
 
316
-                    <!--导入图片-->
317
-                    <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
318
-                    <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
316
+                        <!--导入图片-->
317
+                        <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
318
+                        <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
319 319
 
320 320
 
321
-                    <!--摄像头-->
322
-                    <!--<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">
321
+                        <!--摄像头-->
322
+                        <!--<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">
323 323
                     <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />
324 324
                 </wfi:WindowsFormsHost>-->
325
-                    <!--<Image x:Name="imgLoad"
325
+                        <!--<Image x:Name="imgLoad"
326 326
                     Width="300"
327 327
                     Height="300"
328 328
                     gifLib:ImageBehavior.AnimatedSource="./Images/img_load.gif" VerticalAlignment="Top" Margin="0,200,0,0" Visibility="Visible"/>-->
329
-                </Grid>
330
-            </ScrollViewer>
331
-            <Image x:Name="imgPlayerLeft" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
332
-            <Image x:Name="imgPlayerRight" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right"  Margin="10,7,26,10" VerticalAlignment="Top" Visibility="Collapsed"/>
333
-            <Image x:Name="imgPlayerLeftUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
334
-            <Image x:Name="imgPlayerRightUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right" Margin="10,7,26,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
335
-            <Label Content="" Grid.Column="0" Height="2" Width="2" HorizontalAlignment="Left"  VerticalAlignment="Top" Background="#FF0F0F0F" Margin="1,0,0,0"/>
336
-            <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,16,0"/>
337
-            <Label Content="" Grid.Column="0" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="1,0,0,0"/>
338
-            <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,16,0"/>
339
-            <!--<TextBlock x:Name="txbTime" Text="123456" FontSize="20" Foreground="#000000" Margin="0,0,0,10" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>-->
340
-        </Grid>
341
-        <!--页码-->
342
-        <Grid Grid.Row="1" x:Name="gridPage" Visibility="Collapsed">
343
-            <StackPanel Grid.Row="0" Orientation="Horizontal" Background="Transparent" Width="180" HorizontalAlignment="Center"
329
+                    </Grid>
330
+                </ScrollViewer>
331
+                <Image x:Name="imgPlayerLeft" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
332
+                <Image x:Name="imgPlayerRight" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right"  Margin="10,7,26,10" VerticalAlignment="Top" Visibility="Collapsed"/>
333
+                <Image x:Name="imgPlayerLeftUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
334
+                <Image x:Name="imgPlayerRightUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right" Margin="10,7,26,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
335
+                <Label Content="" Grid.Column="0" Height="2" Width="2" HorizontalAlignment="Left"  VerticalAlignment="Top" Background="#FF0F0F0F" Margin="1,0,0,0"/>
336
+                <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,16,0"/>
337
+                <Label Content="" Grid.Column="0" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="1,0,0,0"/>
338
+                <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,16,0"/>
339
+                <!--<TextBlock x:Name="txbTime" Text="123456" FontSize="20" Foreground="#000000" Margin="0,0,0,10" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>-->
340
+            </Grid>
341
+            <!--页码-->
342
+            <Grid Grid.Row="1" x:Name="gridPage" Visibility="Collapsed">
343
+                <StackPanel Grid.Row="0" Orientation="Horizontal" Background="Transparent" Width="180" HorizontalAlignment="Center"
344 344
             Height="30" Margin="0,0,0,0" Grid.Column="1" VerticalAlignment="Bottom">
345
-                <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
345
+                    <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
346 346
                     x:Name="last_button"
347 347
                     Width="60" Height="20"
348 348
                     Click="last_button_Click">
349
-                    <Button.Content>
350
-                        <StackPanel>
351
-                            <Image Width="16" Height="12" Source=".\Images\class_p1.png" />
352
-                        </StackPanel>
353
-                    </Button.Content>
354
-                </Button>
355
-                <Grid Width="60"  Background="Transparent">
356
-                    <Grid.RowDefinitions>
357
-                        <RowDefinition Height="311*"/>
358
-                        <RowDefinition Height="483*"/>
359
-                    </Grid.RowDefinitions>
360
-                    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-12,0,0" Grid.Row="1"  Background="Transparent">
361
-                        <StackPanel HorizontalAlignment="Center" Orientation="Horizontal"  Background="Transparent">
362
-                            <TextBlock x:Name="txbCurrpage" Text="{Binding currpage}" TextAlignment="Center" FontSize="15"/>
363
-                            <TextBlock Text="/" TextAlignment="Center" FontSize="15"/>
364
-                            <TextBlock Text="{Binding pagenum}" TextAlignment="Center" FontSize="15"/>
349
+                        <Button.Content>
350
+                            <StackPanel>
351
+                                <Image Width="16" Height="12" Source=".\Images\class_p1.png" />
352
+                            </StackPanel>
353
+                        </Button.Content>
354
+                    </Button>
355
+                    <Grid Width="60"  Background="Transparent">
356
+                        <Grid.RowDefinitions>
357
+                            <RowDefinition Height="311*"/>
358
+                            <RowDefinition Height="483*"/>
359
+                        </Grid.RowDefinitions>
360
+                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-12,0,0" Grid.Row="1"  Background="Transparent">
361
+                            <StackPanel HorizontalAlignment="Center" Orientation="Horizontal"  Background="Transparent">
362
+                                <TextBlock x:Name="txbCurrpage" Text="{Binding currpage}" TextAlignment="Center" FontSize="15"/>
363
+                                <TextBlock Text="/" TextAlignment="Center" FontSize="15"/>
364
+                                <TextBlock Text="{Binding pagenum}" TextAlignment="Center" FontSize="15"/>
365
+                            </StackPanel>
365 366
                         </StackPanel>
366
-                    </StackPanel>
367
-                </Grid>
368
-                <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
367
+                    </Grid>
368
+                    <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
369 369
                     x:Name="next_btn"  Background="Transparent"
370 370
                     Width="60" Height="20"
371 371
                     Click="next_btn_Click">
372
-                    <Button.Content>
373
-                        <StackPanel>
374
-                            <Image Width="16" Height="12" Source=".\Images\class_p2.png" />
375
-                        </StackPanel>
376
-                    </Button.Content>
377
-                </Button>
378
-            </StackPanel>
379
-        </Grid>
380
-        <!--设置-->
381
-        <Grid Grid.Row="1" x:Name="gridSetUp"  Background="#FFFFFF" Visibility="Collapsed" Width="1276">
382
-            <Grid.RowDefinitions>
383
-                <RowDefinition Height="90"/>
384
-                <RowDefinition Height="70"/>
385
-                <RowDefinition Height="50"/>
386
-                <RowDefinition Height="60"/>
387
-                <RowDefinition Height="70"/>
388
-                <RowDefinition Height="70"/>
389
-                <RowDefinition Height="70"/>
390
-                <RowDefinition Height="70"/>
391
-                <RowDefinition Height="70"/>
392
-                <RowDefinition Height="70"/>
393
-                <RowDefinition Height="*"/>
394
-            </Grid.RowDefinitions>
372
+                        <Button.Content>
373
+                            <StackPanel>
374
+                                <Image Width="16" Height="12" Source=".\Images\class_p2.png" />
375
+                            </StackPanel>
376
+                        </Button.Content>
377
+                    </Button>
378
+                </StackPanel>
379
+            </Grid>
380
+            <!--设置-->
381
+            <Grid Grid.Row="1" x:Name="gridSetUp"  Background="#FFFFFF" Visibility="Collapsed" Width="1276">
382
+                <Grid.RowDefinitions>
383
+                    <RowDefinition Height="90"/>
384
+                    <RowDefinition Height="70"/>
385
+                    <RowDefinition Height="50"/>
386
+                    <RowDefinition Height="60"/>
387
+                    <RowDefinition Height="70"/>
388
+                    <RowDefinition Height="70"/>
389
+                    <RowDefinition Height="70"/>
390
+                    <RowDefinition Height="70"/>
391
+                    <RowDefinition Height="70"/>
392
+                    <RowDefinition Height="70"/>
393
+                    <RowDefinition Height="*"/>
394
+                </Grid.RowDefinitions>
395 395
                 <Grid.ColumnDefinitions>
396 396
                     <ColumnDefinition Width="100"/>
397 397
                     <ColumnDefinition Width="*"/>
@@ -403,154 +403,154 @@
403 403
                 <TextBlock Grid.Row="1" Grid.Column="0" Text="视频格式" FontSize="16" Foreground="#333333" FontWeight="Black" HorizontalAlignment="Right"/>
404 404
                 <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
405 405
                     <RadioButton x:Name="rbnMP4" Cursor="Hand" Content="MP4" FontSize="14" Foreground="#333333" Margin="0,2,0,0" IsChecked="True"/>
406
-                <RadioButton x:Name="rbnFLV" Cursor="Hand" Content="FLV" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
407
-                <RadioButton x:Name="rbnAVI" Cursor="Hand" Content="AVI" FontSize="14" Foreground="#333333" Margin="20,2,0,0" Visibility="Collapsed"/>
408
-            </StackPanel>
406
+                    <RadioButton x:Name="rbnFLV" Cursor="Hand" Content="FLV" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
407
+                    <RadioButton x:Name="rbnAVI" Cursor="Hand" Content="AVI" FontSize="14" Foreground="#333333" Margin="20,2,0,0" Visibility="Collapsed"/>
408
+                </StackPanel>
409 409
 
410 410
                 <TextBlock Grid.Row="2" Grid.Column="0" Text="摄像头位置" FontSize="16" Foreground="#333333" FontWeight="Black" HorizontalAlignment="Right"/>
411 411
                 <StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
412 412
                     <RadioButton Cursor="Hand" x:Name="rbnRight" Content="右上" FontSize="14" Foreground="#333333" Margin="0,2,0,0" IsChecked="True"/>
413
-                <RadioButton Cursor="Hand" x:Name="rbnRightUnder" Content="右下" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
414
-                <RadioButton Cursor="Hand" x:Name="rbnLeft" Content="左上" FontSize="14" Foreground="#333333" Margin="20,2,0,0" />
415
-                <RadioButton Cursor="Hand" x:Name="rbnLeftUnder" Content="左下" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
416
-            </StackPanel>
417
-            <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0" Visibility="Collapsed">
418
-                <TextBlock Text="视频声音" FontSize="16" Foreground="#2D8CF0" Width="80"/>
419
-                <RadioButton x:Name="rbnY" Cursor="Hand" Content="有" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
420
-                <RadioButton x:Name="rbnN" Cursor="Hand" Content="无" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
421
-            </StackPanel>
422
-
423
-
424
-            <!--接口地址-->
413
+                    <RadioButton Cursor="Hand" x:Name="rbnRightUnder" Content="右下" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
414
+                    <RadioButton Cursor="Hand" x:Name="rbnLeft" Content="左上" FontSize="14" Foreground="#333333" Margin="20,2,0,0" />
415
+                    <RadioButton Cursor="Hand" x:Name="rbnLeftUnder" Content="左下" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
416
+                </StackPanel>
417
+                <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0" Visibility="Collapsed">
418
+                    <TextBlock Text="视频声音" FontSize="16" Foreground="#2D8CF0" Width="80"/>
419
+                    <RadioButton x:Name="rbnY" Cursor="Hand" Content="有" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
420
+                    <RadioButton x:Name="rbnN" Cursor="Hand" Content="无" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
421
+                </StackPanel>
422
+
423
+
424
+                <!--接口地址-->
425 425
                 <TextBlock Grid.Row="3" Grid.Column="0" Text="接口地址" FontSize="16" Foreground="#333333" FontWeight="Black" HorizontalAlignment="Right" Padding="0,20,0,0"/>
426 426
                 <StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" Margin="30,0,0,0">
427 427
                     <TextBlock Text="http://" FontSize="16" Padding="0,20,5,0"/>
428
-                <TextBox x:Name="txbInterfaceAddress" FontSize="16" Width="467" Height="41"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
429
-            </StackPanel>
430
-            
431
-            <!--上传地址-->
428
+                    <TextBox x:Name="txbInterfaceAddress" FontSize="16" Width="467" Height="41"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
429
+                </StackPanel>
430
+
431
+                <!--上传地址-->
432 432
                 <TextBlock Grid.Row="4" Grid.Column="0" Text="上传地址" FontSize="16" Foreground="#333333" FontWeight="Black" HorizontalAlignment="Right" Padding="0,35,0,0"/>
433 433
                 <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal" Margin="30,20,0,0">
434 434
                     <TextBlock Text="http://" FontSize="16" Padding="0,15,5,0"/>
435
-                <TextBox x:Name="txbImageUploadAddress" FontSize="16" Width="467" Height="41"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
436
-            </StackPanel>
437
-            
438
-            <!--下载地址-->
435
+                    <TextBox x:Name="txbImageUploadAddress" FontSize="16" Width="467" Height="41"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
436
+                </StackPanel>
437
+
438
+                <!--下载地址-->
439 439
                 <TextBlock Grid.Row="5" Grid.Column="0" Text="下载地址" FontSize="16" Foreground="#333333" FontWeight="Black" HorizontalAlignment="Right" Padding="0,35,0,0"/>
440 440
                 <StackPanel Grid.Row="5" Grid.Column="1" Orientation="Horizontal" Margin="30,20,0,0">
441 441
                     <TextBlock Text="http://" FontSize="16" Padding="0,15,5,0"/>
442
-                <TextBox x:Name="txbPictureShowsAddress" FontSize="16" Width="467" Height="41"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
443
-            </StackPanel>
442
+                    <TextBox x:Name="txbPictureShowsAddress" FontSize="16" Width="467" Height="41"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
443
+                </StackPanel>
444 444
 
445 445
                 <TextBlock Grid.Row="6" Grid.Column="0" x:Name="txbFilePath" Text="文件路径" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" FontWeight="Black" Padding="0,35,0,0" />
446 446
                 <StackPanel Grid.Row="6" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,20,0,0">
447 447
                     <Border Background="#CDD6E0" Width="522" Height="43" CornerRadius="3" Margin="0,0,0,0">
448
-                    <Label x:Name="txbStoragePath" Background="#FFFFFF" Content="D:\" FontSize="16" Foreground="#333333" Padding="10,12,2,2" Width="520" Height="41" BorderBrush="{x:Null}" BorderThickness="0"/>
449
-                </Border>
450
-                <!--浏览按钮-->
451
-                <Button Cursor="Hand" x:Name="btnBrowse" Content="浏览" FontSize="18" Width="80" Height="43" Margin="18,0,0,0" Click="BtnBrowse_Click">
452
-                    <Button.Template>
453
-                        <ControlTemplate TargetType="{x:Type Button}">
454
-                            <Border
448
+                        <Label x:Name="txbStoragePath" Background="#FFFFFF" Content="D:\" FontSize="16" Foreground="#333333" Padding="10,12,2,2" Width="520" Height="41" BorderBrush="{x:Null}" BorderThickness="0"/>
449
+                    </Border>
450
+                    <!--浏览按钮-->
451
+                    <Button Cursor="Hand" x:Name="btnBrowse" Content="浏览" FontSize="18" Width="80" Height="43" Margin="18,0,0,0" Click="BtnBrowse_Click">
452
+                        <Button.Template>
453
+                            <ControlTemplate TargetType="{x:Type Button}">
454
+                                <Border
455 455
                                 BorderBrush="{TemplateBinding Control.BorderBrush}"
456 456
                                 BorderThickness="1"
457 457
                                 CornerRadius="2">
458
-                                <Border.Background>#EBEFF3</Border.Background>
459
-                                <ContentPresenter
458
+                                    <Border.Background>#EBEFF3</Border.Background>
459
+                                    <ContentPresenter
460 460
                                     HorizontalAlignment="Center"
461 461
                                     VerticalAlignment="Center"
462 462
                                     Content="{TemplateBinding ContentControl.Content}" />
463
-                            </Border>
464
-                        </ControlTemplate>
465
-                    </Button.Template>
466
-                </Button>
467
-            </StackPanel>
463
+                                </Border>
464
+                            </ControlTemplate>
465
+                        </Button.Template>
466
+                    </Button>
467
+                </StackPanel>
468 468
 
469 469
                 <TextBlock Grid.Row="7" Grid.Column="0" Text="版本号" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" FontWeight="Black" Margin="0,30,0,0"/>
470 470
                 <StackPanel Grid.Row="7" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
471 471
                     <TextBlock x:Name="txbv" Text="V0.0.0" FontSize="16" Foreground="#333333"/>
472
-            </StackPanel>
472
+                </StackPanel>
473 473
 
474 474
                 <TextBlock Grid.Row="8" Grid.Column="0" Text="版权所有" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" FontWeight="Black" Margin="0,30,0,0"/>
475 475
                 <StackPanel Grid.Row="8" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
476 476
                     <TextBlock Text="河南星火燎原软件科技有限公司" FontSize="14" Foreground="#333333"/>
477
-            </StackPanel>
477
+                </StackPanel>
478 478
 
479 479
                 <TextBlock Grid.Row="9" Grid.Column="0" Text="录屏快捷键" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" FontWeight="Black" Margin="0,30,0,0"/>
480 480
                 <StackPanel Grid.Row="9" Grid.Column="1">
481 481
                     <TextBlock  FontSize="14" Foreground="#333333" Text="开始/暂停:Ctrl+F5     停止:Ctrl+S     退出讲评:鼠标右键" Margin="30,30,0,0"/>
482 482
                 </StackPanel>
483 483
                 <!--第四行 开始按钮-->
484
-            <Button Cursor="Hand" Grid.Row="10" Grid.ColumnSpan="2" x:Name="btnSave" Content="保存" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="10,0,10,0" Click="BtnSave_Click">
485
-                <Button.Template>
486
-                    <ControlTemplate TargetType="{x:Type Button}">
487
-                        <Border
484
+                <Button Cursor="Hand" Grid.Row="10" Grid.ColumnSpan="2" x:Name="btnSave" Content="保存" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="10,0,10,0" Click="BtnSave_Click">
485
+                    <Button.Template>
486
+                        <ControlTemplate TargetType="{x:Type Button}">
487
+                            <Border
488 488
                                 BorderBrush="{TemplateBinding Control.BorderBrush}"
489 489
                                 BorderThickness="1"
490 490
                                 CornerRadius="2">
491
-                            <Border.Background>#2D8CF0</Border.Background>
492
-                            <ContentPresenter
491
+                                <Border.Background>#2D8CF0</Border.Background>
492
+                                <ContentPresenter
493 493
                                     HorizontalAlignment="Center"
494 494
                                     VerticalAlignment="Center"
495 495
                                     Content="{TemplateBinding ContentControl.Content}" />
496
-                        </Border>
497
-                    </ControlTemplate>
498
-                </Button.Template>
499
-            </Button>
500
-        </Grid>
501
-        <!--上传-->
502
-        <Grid Grid.Row="1" x:Name="gridUpload" Visibility="Hidden">
503
-            <Border Background="#EFF1F8">
504
-                <Grid Background="#FFFFFF" Margin="0,0,0,0">
505
-                    <!--分4行-->
506
-                    <Grid.RowDefinitions>
507
-                        <RowDefinition Height="*"/>
508
-                        <RowDefinition Height="30"/>
509
-                    </Grid.RowDefinitions>
510
-                    <!--第二行 内容-->
511
-                    <Grid Grid.Row="0" Margin="0,0,0,0">
496
+                            </Border>
497
+                        </ControlTemplate>
498
+                    </Button.Template>
499
+                </Button>
500
+            </Grid>
501
+            <!--上传-->
502
+            <Grid Grid.Row="1" x:Name="gridUpload" Visibility="Hidden">
503
+                <Border Background="#EFF1F8">
504
+                    <Grid Background="#FFFFFF" Margin="0,0,0,0">
505
+                        <!--分4行-->
512 506
                         <Grid.RowDefinitions>
513
-                            <RowDefinition Height="45"/>
514 507
                             <RowDefinition Height="*"/>
508
+                            <RowDefinition Height="30"/>
515 509
                         </Grid.RowDefinitions>
516
-                        <UniformGrid x:Name="uniStatisticsByTitle"
510
+                        <!--第二行 内容-->
511
+                        <Grid Grid.Row="0" Margin="0,0,0,0">
512
+                            <Grid.RowDefinitions>
513
+                                <RowDefinition Height="45"/>
514
+                                <RowDefinition Height="*"/>
515
+                            </Grid.RowDefinitions>
516
+                            <UniformGrid x:Name="uniStatisticsByTitle"
517 517
                 Grid.Row="0"
518 518
                 Margin="0,0,0,0"
519 519
                 Background="#E6F0FF"
520 520
                 Columns="5"
521 521
                 Rows="1">
522
-                            <TextBlock
522
+                                <TextBlock
523 523
                     HorizontalAlignment="Center"
524 524
                     VerticalAlignment="Center"
525 525
                     FontSize="16"
526 526
                     Text="序号"  />
527
-                            <TextBlock
527
+                                <TextBlock
528 528
                     HorizontalAlignment="Center"
529 529
                     VerticalAlignment="Center"
530 530
                     FontSize="16"
531 531
                     Text="视频名称"/>
532
-                            <!--<TextBlock
532
+                                <!--<TextBlock
533 533
                     HorizontalAlignment="Center"
534 534
                     VerticalAlignment="Center"
535 535
                     FontSize="15"
536 536
                     Text="视频时长" Foreground="White" />-->
537
-                            <TextBlock
537
+                                <TextBlock
538 538
                     HorizontalAlignment="Center"
539 539
                     VerticalAlignment="Center"
540 540
                     FontSize="16"
541 541
                     Text="视频大小"/>
542
-                            <TextBlock
542
+                                <TextBlock
543 543
                     HorizontalAlignment="Center"
544 544
                     VerticalAlignment="Center"
545 545
                     FontSize="16"
546 546
                     Text="日期"/>
547
-                            <TextBlock
547
+                                <TextBlock
548 548
                     HorizontalAlignment="Center"
549 549
                     VerticalAlignment="Center"
550 550
                     FontSize="16"
551 551
                     Text="操作"/>
552
-                        </UniformGrid>
553
-                        <ListBox Grid.Row="1" Margin="0,0,0,0"
552
+                            </UniformGrid>
553
+                            <ListBox Grid.Row="1" Margin="0,0,0,0"
554 554
                     x:Name="listView1"
555 555
                     BorderThickness="0"
556 556
                     FontSize="20"
@@ -559,100 +559,112 @@
559 559
                     ItemsSource="{Binding menuList}" 
560 560
                            ScrollViewer.HorizontalScrollBarVisibility="Disabled"
561 561
                                 ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
562
-                    </Grid>
563
-                    <StackPanel Grid.Row="3" x:Name="stpUp" Orientation="Horizontal" Background="Transparent" Width="180" HorizontalAlignment="Center"
562
+                        </Grid>
563
+                        <StackPanel Grid.Row="3" x:Name="stpUp" Orientation="Horizontal" Background="Transparent" Width="180" HorizontalAlignment="Center"
564 564
             Height="30" Margin="0,0,0,0" Grid.Column="1" VerticalAlignment="Bottom">
565
-                        <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
565
+                            <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
566 566
                     x:Name="btnLastPage"
567 567
                     Width="60" Height="20"
568 568
                     Click="BtnLastPage_Click">
569
-                            <Button.Content>
570
-                                <StackPanel>
571
-                                    <Image Width="16" Height="12" Source=".\Images\class_p1.png" />
572
-                                </StackPanel>
573
-                            </Button.Content>
574
-                        </Button>
575
-                        <Grid Width="60"  Background="Transparent">
576
-                            <Grid.RowDefinitions>
577
-                                <RowDefinition Height="311*"/>
578
-                                <RowDefinition Height="483*"/>
579
-                            </Grid.RowDefinitions>
580
-                            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-12,0,0" Grid.Row="1"  Background="Transparent">
581
-                                <StackPanel HorizontalAlignment="Center" Orientation="Horizontal"  Background="Transparent">
582
-                                    <TextBlock x:Name="txbCurrpageTwo" TextAlignment="Center" FontSize="15"/>
583
-                                    <TextBlock Text="/" TextAlignment="Center" FontSize="15"/>
584
-                                    <TextBlock x:Name="txbPageNumTwo" TextAlignment="Center" FontSize="15"/>
569
+                                <Button.Content>
570
+                                    <StackPanel>
571
+                                        <Image Width="16" Height="12" Source=".\Images\class_p1.png" />
572
+                                    </StackPanel>
573
+                                </Button.Content>
574
+                            </Button>
575
+                            <Grid Width="60"  Background="Transparent">
576
+                                <Grid.RowDefinitions>
577
+                                    <RowDefinition Height="311*"/>
578
+                                    <RowDefinition Height="483*"/>
579
+                                </Grid.RowDefinitions>
580
+                                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-12,0,0" Grid.Row="1"  Background="Transparent">
581
+                                    <StackPanel HorizontalAlignment="Center" Orientation="Horizontal"  Background="Transparent">
582
+                                        <TextBlock x:Name="txbCurrpageTwo" TextAlignment="Center" FontSize="15"/>
583
+                                        <TextBlock Text="/" TextAlignment="Center" FontSize="15"/>
584
+                                        <TextBlock x:Name="txbPageNumTwo" TextAlignment="Center" FontSize="15"/>
585
+                                    </StackPanel>
585 586
                                 </StackPanel>
586
-                            </StackPanel>
587
-                        </Grid>
588
-                        <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
587
+                            </Grid>
588
+                            <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
589 589
                     x:Name="btnNextPage"  Background="Transparent"
590 590
                     Width="60" Height="20"
591 591
                     Click="BtnNextPage_Click">
592
-                            <Button.Content>
593
-                                <StackPanel>
594
-                                    <Image Width="16" Height="12" Source=".\Images\class_p2.png" />
595
-                                </StackPanel>
596
-                            </Button.Content>
597
-                        </Button>
598
-                    </StackPanel>
592
+                                <Button.Content>
593
+                                    <StackPanel>
594
+                                        <Image Width="16" Height="12" Source=".\Images\class_p2.png" />
595
+                                    </StackPanel>
596
+                                </Button.Content>
597
+                            </Button>
598
+                        </StackPanel>
599 599
 
600
-                </Grid>
601
-            </Border>
602
-        </Grid>
603
-        <Grid Grid.Row="2" Background="#EFF1F8" Margin="0,0,0,0">
604
-            <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
605
-                <TextBlock Text="颜色:" FontSize="14" Padding="10,5,0,0"/>
606
-                <Button Cursor="Hand" x:Name="btnWhite" Background="#FFFFFF" Width="20" Height="20" Click="BtnWhite_Click" Margin="0,2,0,0" Visibility="Collapsed"/>
600
+                    </Grid>
601
+                </Border>
602
+            </Grid>
603
+
604
+            <Grid x:Name="GridMyVideo" Grid.Row="1" Margin="0" Background="White" Visibility="Hidden">
605
+                <Grid.RowDefinitions>
606
+                    <RowDefinition Height="*"/>
607
+                    <RowDefinition Height="50"/>
608
+                </Grid.RowDefinitions>
609
+                <Label x:Name="lblVideoMess" Grid.Row="0" Content="暂无微课录制信息,请录制并等待保存完成后重试!" HorizontalAlignment="Center" Margin="0,0,0,100" VerticalAlignment="Center" FontSize="20" Visibility="Hidden"/>
610
+                <Button x:Name="BtnVideoUpPage" Content="上一页" HorizontalAlignment="Center" Margin="0,0,150,10" Grid.Row="1" VerticalAlignment="Bottom" Width="60" Background="{x:Null}" BorderBrush="{x:Null}" FontSize="16" Foreground="#FF333333" Click="BtnVideoUpPage_Click"/>
611
+                <Label x:Name="lblVideoPageNum" Grid.Row="1" FontSize="14" Content="100/100" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,10" Foreground="#FF333333" />
612
+                <Button x:Name="BtnVideoDownPage" Content="下一页" HorizontalAlignment="Center" Margin="150,0,0,10" Grid.Row="1" VerticalAlignment="Bottom" Width="60" Background="{x:Null}" BorderBrush="{x:Null}" FontSize="16" Foreground="#FF333333" Click="BtnVideoDownPage_Click"/>
613
+            </Grid>
614
+
615
+            <Grid Grid.Row="2" Background="#EFF1F8" Margin="0,0,0,0">
616
+                <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
617
+                    <TextBlock Text="颜色:" FontSize="14" Padding="10,5,0,0"/>
618
+                    <Button Cursor="Hand" x:Name="btnWhite" Background="#FFFFFF" Width="20" Height="20" Click="BtnWhite_Click" Margin="0,2,0,0" Visibility="Collapsed"/>
607 619
 
608 620
                     <Border Background="#666666" Width="20" Height="20" Margin="5,2,0,0">
609 621
                         <Button Cursor="Hand" x:Name="btnRed" Width="20" Height="20" Background="#FF0000" Margin="1,1,1,1" HorizontalAlignment="Center"  Click="BtnRed_Click" Style="{StaticResource NoMouseOverButtonStyle}">
610
-                    <Image x:Name="imgRed" Source=".\Images\microLessonSystem_999.png" Width="12" Visibility="Visible"/>
611
-                </Button>
622
+                            <Image x:Name="imgRed" Source=".\Images\microLessonSystem_999.png" Width="12" Visibility="Visible"/>
623
+                        </Button>
612 624
                     </Border>
613 625
                     <Border Background="#666666" Width="20" Height="20" Margin="5,2,0,0">
614 626
                         <Button Cursor="Hand" x:Name="btnGray" Background="#333333" Width="20" Height="20" Margin="1,1,1,1" Click="BtnGray_Click" Style="{StaticResource NoMouseOverButtonStyle}">
615
-                    <Image x:Name="imgGray" Source=".\Images\microLessonSystem_999.png" Width="12" Visibility="Collapsed"/>
616
-                </Button>
627
+                            <Image x:Name="imgGray" Source=".\Images\microLessonSystem_999.png" Width="12" Visibility="Collapsed"/>
628
+                        </Button>
617 629
                     </Border>
618 630
                     <Border Background="#666666" Width="20" Height="20" Margin="5,2,0,0">
619 631
 
620 632
 
621 633
                         <Button Cursor="Hand" x:Name="btnCyanBlue" Background="#63D600" Width="20" Height="20" Margin="1,1,1,1" Click="BtnCyanBlue_Click" Style="{StaticResource NoMouseOverButtonStyle}">
622
-                    <Image x:Name="imgCyanBlue" Source=".\Images\microLessonSystem_999.png" Width="12" Visibility="Collapsed"/>
623
-                </Button>
634
+                            <Image x:Name="imgCyanBlue" Source=".\Images\microLessonSystem_999.png" Width="12" Visibility="Collapsed"/>
635
+                        </Button>
624 636
                     </Border>
625 637
                     <Border Background="#666666" Width="20" Height="20" Margin="5,2,0,0">
626 638
 
627 639
 
628 640
                         <Button Cursor="Hand" x:Name="btnYellow" Background="#FFBC00" Width="20" Height="20" Margin="1,1,1,1" Click="BtnYellow_Click" Style="{StaticResource NoMouseOverButtonStyle}">
629
-                   
630
-                    <Image x:Name="imgYellow" Source=".\Images\microLessonSystem_999.png" Width="12" Visibility="Collapsed"/>
631
-                </Button>
641
+
642
+                            <Image x:Name="imgYellow" Source=".\Images\microLessonSystem_999.png" Width="12" Visibility="Collapsed"/>
643
+                        </Button>
632 644
                     </Border>
633 645
                     <Border Background="#666666" Width="20" Height="20" Margin="5,2,0,0">
634 646
 
635 647
 
636 648
                         <Button Cursor="Hand" x:Name="btnBlue" Background="#00B4FC" Width="20" Height="20" Margin="1,1,1,1" Click="BtnBlue_Click" Style="{StaticResource NoMouseOverButtonStyle}">
637
-                    <Image x:Name="imgBlue" Source=".\Images\microLessonSystem_999.png" Width="12" Visibility="Collapsed"/>
638
-                </Button>
649
+                            <Image x:Name="imgBlue" Source=".\Images\microLessonSystem_999.png" Width="12" Visibility="Collapsed"/>
650
+                        </Button>
639 651
                     </Border>
640 652
                     <TextBlock Text="粗细:" FontSize="14" Padding="15,0,0,0" Margin="5,5,0,0"/>
641 653
                     <RadioButton Cursor="Hand" x:Name="rbnFine" Content="细" FontSize="14" Margin="0,7,0,0" IsChecked="True" Click="RbnFine_Click"/>
642
-                <RadioButton Cursor="Hand" x:Name="rbnIn" Content="中" FontSize="14" Margin="5,7,0,0" Click="RbnIn_Click"/>
643
-                <RadioButton Cursor="Hand" x:Name="rbnCrude" Content="粗" FontSize="14" Margin="5,7,0,0" Click="RbnCrude_Click"/>
644
-                <StackPanel Orientation="Horizontal">
645
-                    <TextBlock Text="摄像头:" FontSize="14" Padding="15,6,0,0"/>
646
-                    <RadioButton Cursor="Hand" x:Name="rbnOpen" Content="开" FontSize="14" Margin="0,7,0,0" Click="RbnOpen_Click"/>
647
-                    <RadioButton Cursor="Hand" x:Name="rbnTurnOff" Content="关" FontSize="14" Margin="5,7,0,0" IsChecked="True" Click="RbnTurnOff_Click"/>
654
+                    <RadioButton Cursor="Hand" x:Name="rbnIn" Content="中" FontSize="14" Margin="5,7,0,0" Click="RbnIn_Click"/>
655
+                    <RadioButton Cursor="Hand" x:Name="rbnCrude" Content="粗" FontSize="14" Margin="5,7,0,0" Click="RbnCrude_Click"/>
656
+                    <StackPanel Orientation="Horizontal">
657
+                        <TextBlock Text="摄像头:" FontSize="14" Padding="15,6,0,0"/>
658
+                        <RadioButton Cursor="Hand" x:Name="rbnOpen" Content="开" FontSize="14" Margin="0,7,0,0" Click="RbnOpen_Click"/>
659
+                        <RadioButton Cursor="Hand" x:Name="rbnTurnOff" Content="关" FontSize="14" Margin="5,7,0,0" IsChecked="True" Click="RbnTurnOff_Click"/>
660
+                    </StackPanel>
648 661
                 </StackPanel>
649
-            </StackPanel>
650
-            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
651
-                <TextBlock Text="智能笔状态:" FontSize="14" Padding="0,4,0,0"/>
652
-                <TextBlock x:Name="txbNotConnected" Text="未连接" FontSize="14" Padding="0,4,5,0"/>
653
-            </StackPanel>
654
-        </Grid>
662
+                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
663
+                    <TextBlock Text="智能笔状态:" FontSize="14" Padding="0,4,0,0"/>
664
+                    <TextBlock x:Name="txbNotConnected" Text="未连接" FontSize="14" Padding="0,4,5,0"/>
665
+                </StackPanel>
666
+            </Grid>
655 667
 
656
-    </Grid>
668
+        </Grid>
657 669
     </Viewbox>
658 670
 </Window>

+ 195
- 22
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Просмотреть файл

@@ -29,7 +29,7 @@ using TStudyDigitalPen.HID;
29 29
 
30 30
 using XHWK.Model;
31 31
 using XHWK.WKTool.DAL;
32
-
32
+using XHWK.WKTool.UControl;
33 33
 
34 34
 namespace XHWK.WKTool
35 35
 {
@@ -1633,7 +1633,7 @@ namespace XHWK.WKTool
1633 1633
         }
1634 1634
         #endregion
1635 1635
 
1636
-        #region 上传
1636
+        #region 上传 列表
1637 1637
         /// <summary>
1638 1638
         /// 上传事件
1639 1639
         /// </summary>
@@ -1641,18 +1641,34 @@ namespace XHWK.WKTool
1641 1641
         /// <param name="e"></param>
1642 1642
         private void BtnUpload_Click(object sender, RoutedEventArgs e)
1643 1643
         {
1644
-            if (APP.IsLoginType == false)
1645
-            {
1646
-                Login();
1647
-                return;
1648
-            }
1649
-            if (gridUpload.Visibility == Visibility.Visible)
1644
+            //if (gridUpload.Visibility == Visibility.Visible)
1645
+            //{
1646
+            //    gridUpload.Visibility = Visibility.Collapsed;
1647
+            //    GridMain.Visibility = Visibility.Visible;
1648
+            //    //ImgRecord.Visibility = Visibility.Visible;//上传结束时可录制
1649
+            //    //ImgRecordTwo.Visibility = Visibility.Collapsed;//上传结束时可录制
1650
+            //    //BtnRecord.IsEnabled = true;//设置结束时可录制
1651
+            //    if (APP.pageData.pagenum > 0)
1652
+            //    {
1653
+            //        gridPage.Visibility = Visibility.Visible;
1654
+            //    }
1655
+            //    DataContext = APP.pageData;
1656
+            //}
1657
+            //else
1658
+            //{
1659
+            //    gridPage.Visibility = Visibility.Collapsed;
1660
+            //    gridUpload.Visibility = Visibility.Visible;
1661
+            //    GridMain.Visibility = Visibility.Collapsed;
1662
+            //    //ImgRecord.Visibility = Visibility.Collapsed;//上传时不可录制
1663
+            //    //ImgRecordTwo.Visibility = Visibility.Visible;//上传时不可录制
1664
+            //    //BtnRecord.IsEnabled = false;//上传时不可录制
1665
+            //    InitializeUpload();
1666
+            //}
1667
+
1668
+            if (GridMyVideo.Visibility == Visibility.Visible)
1650 1669
             {
1651
-                gridUpload.Visibility = Visibility.Collapsed;
1670
+                GridMyVideo.Visibility = Visibility.Collapsed;
1652 1671
                 GridMain.Visibility = Visibility.Visible;
1653
-                //ImgRecord.Visibility = Visibility.Visible;//上传结束时可录制
1654
-                //ImgRecordTwo.Visibility = Visibility.Collapsed;//上传结束时可录制
1655
-                //BtnRecord.IsEnabled = true;//设置结束时可录制
1656 1672
                 if (APP.pageData.pagenum > 0)
1657 1673
                 {
1658 1674
                     gridPage.Visibility = Visibility.Visible;
@@ -1662,12 +1678,9 @@ namespace XHWK.WKTool
1662 1678
             else
1663 1679
             {
1664 1680
                 gridPage.Visibility = Visibility.Collapsed;
1665
-                gridUpload.Visibility = Visibility.Visible;
1681
+                GridMyVideo.Visibility = Visibility.Visible;
1666 1682
                 GridMain.Visibility = Visibility.Collapsed;
1667
-                //ImgRecord.Visibility = Visibility.Collapsed;//上传时不可录制
1668
-                //ImgRecordTwo.Visibility = Visibility.Visible;//上传时不可录制
1669
-                //BtnRecord.IsEnabled = false;//上传时不可录制
1670
-                InitializeUpload();
1683
+                LoadUploadInitData();
1671 1684
             }
1672 1685
             //btnStop.IsEnabled = true;//停止录制按钮可点击
1673 1686
         }
@@ -1845,6 +1858,11 @@ namespace XHWK.WKTool
1845 1858
         /// <param name="e"></param>
1846 1859
         private void BtnUploads_Click(object sender, RoutedEventArgs e)
1847 1860
         {
1861
+            if (APP.IsLoginType == false)
1862
+            {
1863
+                Login();
1864
+                return;
1865
+            }
1848 1866
             pageData.menuList[Subscript].IsEnabled = false;
1849 1867
             List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnUpload");
1850 1868
             for (int i = 0; i < buttons.Count; i++)
@@ -2267,7 +2285,162 @@ namespace XHWK.WKTool
2267 2285
         }
2268 2286
 
2269 2287
         #endregion
2288
+        #region 新上传 显示缩略图
2289
+        #region 初始值
2290
+        /// <summary>
2291
+        /// 总页数
2292
+        /// </summary>
2293
+        int TotalPage=0;
2294
+        /// <summary>
2295
+        /// 当前页
2296
+        /// </summary>
2297
+        int CurrentPage = 1;
2298
+        /// <summary>
2299
+        /// 每页显示的视频数
2300
+        /// </summary>
2301
+        int PageShowNum = 0;
2302
+        /// <summary>
2303
+        /// 视频信息列表
2304
+        /// </summary>
2305
+        List<Uc_VideoItem> VideoControlList = new List<Uc_VideoItem>();
2306
+        /// <summary>
2307
+        /// 横向间隔
2308
+        /// </summary>
2309
+        double IntervalX = 0;
2310
+        /// <summary>
2311
+        /// 纵向间隔
2312
+        /// </summary>
2313
+        double IntervalY = 0;
2314
+        #endregion
2315
+        /// <summary>
2316
+        /// 初始化加载上传页面数据
2317
+        /// </summary>
2318
+        void LoadUploadInitData()
2319
+        {
2320
+            APP.myloading.Show();
2321
+            //加载视频列表
2322
+            LoadingVideoList();
2323
+            if (model_VideoList.Count > 0)
2324
+            {
2325
+                lblVideoMess.Visibility = Visibility.Hidden;
2326
+                BtnVideoUpPage.Visibility = Visibility.Visible;
2327
+                lblVideoPageNum.Visibility = Visibility.Visible;
2328
+                BtnVideoDownPage.Visibility = Visibility.Visible;
2329
+                //根据页面大小获取每页显示的数量 H300W250
2330
+                int videoRow = (int)((GridMyVideo.ActualHeight - 50) / 300);
2331
+                int videColumn = (int)(GridMyVideo.ActualWidth / 250);
2332
+                PageShowNum = videoRow * videColumn;
2333
+                //获取总页数
2334
+                TotalPage = model_VideoList.Count / PageShowNum + (model_VideoList.Count % PageShowNum > 0 ? 1 : 0);
2335
+                //如果当前页大于总页数 总页数为当前页
2336
+                if (TotalPage < CurrentPage)
2337
+                {
2338
+                    CurrentPage = TotalPage;
2339
+                }
2340
+                //横向间隔
2341
+                IntervalX = (GridMyVideo.ActualWidth - (videColumn * 250)) / (videColumn + 1);
2342
+                IntervalY = (GridMyVideo.ActualHeight - 50 - (videoRow * 300)) / (videoRow + 1);
2343
+                LoadCurrentPageData();
2344
+            }
2345
+            else
2346
+            {
2347
+                lblVideoMess.Visibility = Visibility.Visible;
2348
+                BtnVideoUpPage.Visibility = Visibility.Hidden;
2349
+                lblVideoPageNum.Visibility = Visibility.Hidden;
2350
+                BtnVideoDownPage.Visibility = Visibility.Hidden;
2351
+            }
2352
+            APP.myloading.Hide();
2353
+        }
2354
+        /// <summary>
2355
+        /// 加载当前页数据
2356
+        /// </summary>
2357
+        private void LoadCurrentPageData()
2358
+        {
2359
+            lblVideoPageNum.Content = CurrentPage + "/" + TotalPage;
2360
+            //隐藏显示的控件
2361
+            if(VideoControlList.Count>0)
2362
+            {
2363
+                foreach(Uc_VideoItem item in VideoControlList)
2364
+                {
2365
+                    if (item.Visibility != Visibility.Hidden)
2366
+                    {
2367
+                        item.Visibility = Visibility.Hidden;
2368
+                    }
2369
+                }
2370
+            }
2371
+            double W = IntervalX;//每次增加250
2372
+            double H = IntervalY;//每次增加300
2373
+            //加载控件
2374
+            for(int i=0;i< PageShowNum;i++)
2375
+            {
2376
+                int DataIndex = (CurrentPage - 1) * PageShowNum + i;
2377
+                if(DataIndex== model_VideoList.Count)
2378
+                {
2379
+                    return;
2380
+                }
2381
+                Uc_VideoItem videoItem;
2382
+                if (VideoControlList.Exists(x => x.Tag.ToString() == model_VideoList[DataIndex].FileGuid))
2383
+                {
2384
+                    videoItem = VideoControlList.Find(x => x.Tag.ToString() == model_VideoList[DataIndex].FileGuid);
2385
+                }
2386
+                else
2387
+                {
2388
+                    videoItem = new Uc_VideoItem(model_VideoList[DataIndex]);
2389
+                    videoItem.Tag = model_VideoList[DataIndex].FileGuid;
2390
+                    videoItem.Click_refreshVideoList += LoadUploadInitData;
2391
+                    videoItem.Click_UploadLogin += Login;
2392
+                    videoItem.Width = 250;
2393
+                    videoItem.Height = 300;
2394
+                    videoItem.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
2395
+                    videoItem.VerticalAlignment = System.Windows.VerticalAlignment.Top;
2396
+                    GridMyVideo.Children.Add(videoItem);
2397
+                    VideoControlList.Add(videoItem);
2398
+                }
2399
+                videoItem.Margin = new Thickness(W, H, 0, 0);
2400
+                videoItem.Visibility = Visibility.Visible;
2401
+                if (W + 250+250>GridMyVideo.ActualWidth)
2402
+                {
2403
+                    W = IntervalX;
2404
+                    H += 300+ IntervalY;
2405
+                }
2406
+                else
2407
+                {
2408
+                    W += 250+ IntervalX;
2409
+                }
2410
+                //Uc_VideoItem videoItem = new Uc_VideoItem();
2411
+                //return;
2412
+            }
2413
+        }
2270 2414
 
2415
+        #region 分页
2416
+        /// <summary>
2417
+        /// 上一页
2418
+        /// </summary>
2419
+        /// <param name="sender"></param>
2420
+        /// <param name="e"></param>
2421
+        private void BtnVideoUpPage_Click(object sender, RoutedEventArgs e)
2422
+        {
2423
+            if(CurrentPage>1)
2424
+            {
2425
+                CurrentPage--;
2426
+                LoadCurrentPageData();
2427
+            }
2428
+        }
2429
+        /// <summary>
2430
+        /// 下一页
2431
+        /// </summary>
2432
+        /// <param name="sender"></param>
2433
+        /// <param name="e"></param>
2434
+        private void BtnVideoDownPage_Click(object sender, RoutedEventArgs e)
2435
+        {
2436
+            if (CurrentPage < TotalPage)
2437
+            {
2438
+                CurrentPage++;
2439
+                LoadCurrentPageData();
2440
+            }
2441
+        }
2442
+        #endregion
2443
+        #endregion
2271 2444
         #region 录制窗口
2272 2445
         #region 变量
2273 2446
         /// <summary>
@@ -2970,7 +3143,7 @@ namespace XHWK.WKTool
2970 3143
                         VideoInfo.VideoPath = VideoSavePathName;
2971 3144
                         VideoInfo.ThumbnailPath = ThumbnailPathName;
2972 3145
                         //生成缩略图
2973
-                        bool ThuRes = APP.FFmpeg.GenerateThumbnails(VideoSynthesisPathName, ThumbnailPathName);
3146
+                        bool ThuRes = APP.FFmpeg.GenerateThumbnails(VideoSynthesisPathName, ThumbnailPathName,200,130);
2974 3147
                         Thread.Sleep(500);
2975 3148
                         int imgW = (int)GridMain.ActualWidth + (GridMain.ActualWidth % 2 > 0 ? 1 : 0);
2976 3149
                         int imgH = (int)GridMain.ActualHeight + (GridMain.ActualHeight % 2 > 0 ? 1 : 0);
@@ -3043,15 +3216,15 @@ namespace XHWK.WKTool
3043 3216
             {
3044 3217
                 txbLoginType.Text = APP.UserInfo.Username;
3045 3218
 
3046
-                ImgUpload.Visibility = Visibility.Visible;
3047
-                ImgUploadTwo.Visibility = Visibility.Collapsed;
3219
+                //ImgUpload.Visibility = Visibility.Visible;
3220
+                //ImgUploadTwo.Visibility = Visibility.Collapsed;
3048 3221
             }
3049 3222
             else
3050 3223
             {
3051 3224
                 txbLoginType.Text = "未登录";
3052 3225
 
3053
-                ImgUpload.Visibility = Visibility.Collapsed;
3054
-                ImgUploadTwo.Visibility = Visibility.Visible;
3226
+                //ImgUpload.Visibility = Visibility.Collapsed;
3227
+                //ImgUploadTwo.Visibility = Visibility.Visible;
3055 3228
             }
3056 3229
         }
3057 3230
         /// <summary>

+ 13
- 0
XHWK.WKTool/XHWK.WKTool.csproj Просмотреть файл

@@ -181,6 +181,9 @@
181 181
     <Compile Include="ScreenRecordingToolbarWindow.xaml.cs">
182 182
       <DependentUpon>ScreenRecordingToolbarWindow.xaml</DependentUpon>
183 183
     </Compile>
184
+    <Compile Include="UControl\Uc_VideoItem.xaml.cs">
185
+      <DependentUpon>Uc_VideoItem.xaml</DependentUpon>
186
+    </Compile>
184 187
     <Compile Include="UploadWindow.xaml.cs">
185 188
       <DependentUpon>UploadWindow.xaml</DependentUpon>
186 189
     </Compile>
@@ -240,6 +243,10 @@
240 243
       <Generator>MSBuild:Compile</Generator>
241 244
       <SubType>Designer</SubType>
242 245
     </Page>
246
+    <Page Include="UControl\Uc_VideoItem.xaml">
247
+      <SubType>Designer</SubType>
248
+      <Generator>MSBuild:Compile</Generator>
249
+    </Page>
243 250
     <Page Include="UploadWindow.xaml">
244 251
       <SubType>Designer</SubType>
245 252
       <Generator>MSBuild:Compile</Generator>
@@ -1595,5 +1602,11 @@
1595 1602
   <ItemGroup>
1596 1603
     <Resource Include="Images\rollCall_1.png" />
1597 1604
   </ItemGroup>
1605
+  <ItemGroup>
1606
+    <Resource Include="Images\VideoList_Play.png" />
1607
+  </ItemGroup>
1608
+  <ItemGroup>
1609
+    <Resource Include="Images\VideoList_OK.png" />
1610
+  </ItemGroup>
1598 1611
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1599 1612
 </Project>

Загрузка…
Отмена
Сохранить