浏览代码

降低压缩图片质量

KWD 2 月之前
父节点
当前提交
d8d3f8ef56
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      TeamAAS-VM/Core/ImageHelper.cs
  2. 2 2
      TeamAAS-VM/Views/Home/ShowVisionRender.xaml.cs

+ 1 - 1
TeamAAS-VM/Core/ImageHelper.cs

@@ -21,7 +21,7 @@ namespace TeamAAS_VP.Core
         /// <param name="bitmap"></param>
         /// <param name="path">目标图像存储路径JPEG</param>
         /// <param name="quality">压缩等级,0到100,0 最差质量,100 最佳</param>
-        public static void CompressImage(Bitmap bitmap, string path, long quality = 100)
+        public static void CompressImage(Bitmap bitmap, string path, long quality = 20)
         {
             ImageCodecInfo codecInfo = GetEncoderInfo("image/jpeg");
             System.Drawing.Imaging.Encoder encoder = System.Drawing.Imaging.Encoder.Quality;

+ 2 - 2
TeamAAS-VM/Views/Home/ShowVisionRender.xaml.cs

@@ -750,7 +750,7 @@ namespace TeamAAS_VP.Views.Home
 
                         if (isCompress)
                         {
-                            ImageHelper.CompressImage(reimage, Recordedpath, 100);
+                            ImageHelper.CompressImage(reimage, Recordedpath, 20);
                         }
                         else
                         {
@@ -857,7 +857,7 @@ namespace TeamAAS_VP.Views.Home
 
                         if (isCompress)
                         {
-                            ImageHelper.CompressImage(reimage, Recordedpath, 100);
+                            ImageHelper.CompressImage(reimage, Recordedpath, 20);
                         }
                         else
                         {