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

zhao:1修改转码设置 2录制设置统一大小

tags/录制修改前
耀 4 лет назад
Родитель
Сommit
9b273a2979
1 измененных файлов: 21 добавлений и 6 удалений
  1. 21
    6
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

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

@@ -2289,6 +2289,7 @@ namespace XHWK.WKTool
2289 2289
         }
2290 2290
 
2291 2291
         #endregion
2292
+
2292 2293
         #region 新上传 显示缩略图
2293 2294
         #region 初始值
2294 2295
         /// <summary>
@@ -2333,7 +2334,7 @@ namespace XHWK.WKTool
2333 2334
                 //根据页面大小获取每页显示的数量 H300W250
2334 2335
                 int videoRow = (int)((GridMyVideo.ActualHeight - 50) / 300);
2335 2336
                 int videColumn = (int)(GridMyVideo.ActualWidth / 250);
2336
-                PageShowNum = videoRow * videColumn;
2337
+                PageShowNum = (videoRow == 0 ? 1 : videoRow) * (videColumn == 0 ? 1 : videColumn);
2337 2338
                 //获取总页数
2338 2339
                 TotalPage = model_VideoList.Count / PageShowNum + (model_VideoList.Count % PageShowNum > 0 ? 1 : 0);
2339 2340
                 //如果当前页大于总页数 总页数为当前页
@@ -2445,6 +2446,7 @@ namespace XHWK.WKTool
2445 2446
         }
2446 2447
         #endregion
2447 2448
         #endregion
2449
+
2448 2450
         #region 录制窗口
2449 2451
         #region 变量
2450 2452
         /// <summary>
@@ -2504,6 +2506,15 @@ namespace XHWK.WKTool
2504 2506
         /// 录制计时
2505 2507
         /// </summary>
2506 2508
         private DateTime SRTime = DateTime.Now;
2509
+        /// <summary>
2510
+        /// 录制大小
2511
+        /// </summary>
2512
+        int gridActWidth = 1276;
2513
+        /// <summary>
2514
+        /// 录制大小
2515
+        /// </summary>
2516
+        int gridActHeight = 898;
2517
+        
2507 2518
         #endregion
2508 2519
 
2509 2520
         #region 录屏
@@ -2800,6 +2811,13 @@ namespace XHWK.WKTool
2800 2811
                     //blackboard_canvas.Cursor = System.Windows.Input.Cursors.Pen;
2801 2812
                     #endregion
2802 2813
 
2814
+                    #region 设置录制大小
2815
+                    //gridActWidth = (int)GridMain.ActualWidth==0?1276: (int)GridMain.ActualWidth;
2816
+                    //gridActHeight = (int)GridMain.ActualHeight==0?898: (int)GridMain.ActualHeight;
2817
+                    gridActWidth = 1276;
2818
+                    gridActHeight = 898;
2819
+                    #endregion
2820
+
2803 2821
                     #region 录像倒计时
2804 2822
                     if (APP.W_CountdownWindow == null)
2805 2823
                     {
@@ -2825,6 +2843,7 @@ namespace XHWK.WKTool
2825 2843
                     //};//设置执行一次(false)还是一直执行(true)
2826 2844
                     //timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
2827 2845
                     //timer.Enabled = true; //启动计时器
2846
+
2828 2847
                 }
2829 2848
 
2830 2849
                 //继续录制
@@ -3072,8 +3091,6 @@ namespace XHWK.WKTool
3072 3091
                     FileToolsCommon.CreateDirectory(ThumbnailPath);
3073 3092
                     //缩略图存储位置
3074 3093
                     string ThumbnailPathName = ThumbnailPath + FileToolsCommon.GetIOFileName(VideoSavePathName).Replace(".", "") + ".JPG";
3075
-                    int gridActWidth = (int)GridMain.ActualWidth;
3076
-                    int gridActHeight = (int)GridMain.ActualHeight;
3077 3094
                     APP.FFmpeg.StopFFmpeg(AudioPathName);
3078 3095
                     new Thread(new ThreadStart(new Action(() =>
3079 3096
                     {
@@ -3149,8 +3166,6 @@ namespace XHWK.WKTool
3149 3166
                         //生成缩略图
3150 3167
                         bool ThuRes = APP.FFmpeg.GenerateThumbnails(VideoSynthesisPathName, ThumbnailPathName,200,130);
3151 3168
                         Thread.Sleep(500);
3152
-                        int imgW = (int)GridMain.ActualWidth + (((int)GridMain.ActualWidth) % 2 > 0 ? 1 : 0);
3153
-                        int imgH = (int)GridMain.ActualHeight + (((int)GridMain.ActualHeight) % 2 > 0 ? 1 : 0);
3154 3169
                         //if (ThuRes)
3155 3170
                         //{
3156 3171
                         //    Bitmap bmp = ImageHelper.ReadBitmapFile(ThumbnailPathName);
@@ -3161,7 +3176,7 @@ namespace XHWK.WKTool
3161 3176
                         //    }
3162 3177
                         //}
3163 3178
 
3164
-                        APP.FFmpeg.VideoTranscode(VideoSynthesisPathName, VideoSavePathName, imgW, imgH);
3179
+                        APP.FFmpeg.VideoTranscode(VideoSynthesisPathName, VideoSavePathName, gridActWidth, gridActHeight);
3165 3180
                         VideoInfo.FileGuid = Guid.NewGuid().ToString();
3166 3181
                         VideoInfo.IsUpload = false;
3167 3182
                         VideoInfo.Uploaded = 0;

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