Przeglądaj źródła

zhao:优化录制

tags/录制修改前
耀 4 lat temu
rodzic
commit
46f2037e4f

+ 16
- 16
Common/system/ImageHelper.cs Wyświetl plik

@@ -417,28 +417,28 @@ namespace Common.system
417 417
                     {
418 418
                         MemoryStream memoryStream = new MemoryStream();
419 419
                         encoder.Save(memoryStream);
420
-                        //System.Drawing.Image img = System.Drawing.Image.FromStream(memoryStream);
421
-                        Bitmap bit = new Bitmap(memoryStream);
422
-                        if (ImgWidth - 2 < bit.Width)
420
+                        new Thread(new ThreadStart(new Action(() =>
423 421
                         {
424
-                            try
422
+                        //System.Drawing.Image img = System.Drawing.Image.FromStream(memoryStream);
423
+                            Bitmap bit = new Bitmap(memoryStream);
424
+                            if (ImgWidth - 2 < bit.Width)
425 425
                             {
426
-                                Graphics g = Graphics.FromImage(Img);
427
-                                //g.InterpolationMode = InterpolationMode.HighQualityBicubic;
428
-                                g.DrawImage(bit, new Rectangle(0, 0, ImgWidth, ImgHeight), new Rectangle(0, 0, bit.Width, bit.Height), GraphicsUnit.Pixel);
429
-                                g.Dispose();
426
+                                try
427
+                                {
428
+                                    Graphics g = Graphics.FromImage(Img);
429
+                                    //g.InterpolationMode = InterpolationMode.HighQualityBicubic;
430
+                                    g.DrawImage(bit, new Rectangle(0, 0, ImgWidth, ImgHeight), new Rectangle(0, 0, bit.Width, bit.Height), GraphicsUnit.Pixel);
431
+                                    g.Dispose();
432
+                                }
433
+                                catch
434
+                                {
435
+                                    Img = bit;
436
+                                }
430 437
                             }
431
-                            catch
438
+                            else
432 439
                             {
433 440
                                 Img = bit;
434 441
                             }
435
-                        }
436
-                        else
437
-                        {
438
-                            Img = bit;
439
-                        }
440
-                        new Thread(new ThreadStart(new Action(() =>
441
-                        {
442 442
                             Img.Save(filePathName);
443 443
                             //Bitmap bitmap = CutImageWhitePart(Img);
444 444
                             //FileToolsCommon.DeleteFile(filePathName);

+ 6
- 2
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Wyświetl plik

@@ -3214,9 +3214,13 @@ namespace XHWK.WKTool
3214 3214
                         RsH = ((int)RsH) % 2 > 0 ? (int)RsH - 1 : (int)RsH;
3215 3215
                         //RsH = 898;
3216 3216
                     }
3217
+                    #endregion
3218
+                    //System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Send, new ThreadStart(delegate
3219
+                    //{
3220
+
3221
+                    //}));
3217 3222
                     Dispatcher.Invoke(() =>
3218 3223
                     {
3219
-                        #endregion
3220 3224
                         //保存图片
3221 3225
                         ImageHelper.SaveUIToImage(GridMain, FilePathName, gridActWidth, gridActHeight, (int)RsW, (int)RsH);
3222 3226
                         //ImageHelper.SaveUIToImage(GridMain, FilePathName, (int)(GridMain.ActualWidth * (PrimaryScreen.DpiX / 96f)), (int)(GridMain.ActualHeight * (PrimaryScreen.DpiY / 96f)), 0, 0);
@@ -3581,7 +3585,7 @@ namespace XHWK.WKTool
3581 3585
             imgCanvas.Source = null;
3582 3586
             imgDocumentation.Source = null;
3583 3587
             imgPPT.Source = null;
3584
-            if(APP.pageData.pagenum == 1)
3588
+            if (APP.pageData.pagenum == 1)
3585 3589
             {
3586 3590
                 APP.PageDrawList = new List<Model_DrawData>();
3587 3591
             }

Ładowanie…
Anuluj
Zapisz