Browse Source

fix 0019760: 【urm调节】zoom分析结果后,点击保存视频,视频保存后,显示不对

jeremy 8 months ago
parent
commit
606ccdb4dc
1 changed files with 3 additions and 23 deletions
  1. 3 23
      Service/AIDiagnosisService.URM.cs

+ 3 - 23
Service/AIDiagnosisService.URM.cs

@@ -787,28 +787,6 @@ namespace WingAIDiagnosisService.Service
                         urmProcessRequest.PointsDataPath = File.Exists(pointsPath) ? pointsPath : string.Empty;
                         urmProcessRequest.PointsDataPath = File.Exists(pointsPath) ? pointsPath : string.Empty;
                         urmProcessRequest.PointNumsDataPath = File.Exists(pointNumsPath) ? pointNumsPath : string.Empty;
                         urmProcessRequest.PointNumsDataPath = File.Exists(pointNumsPath) ? pointNumsPath : string.Empty;
 
 
-                        if (!string.IsNullOrWhiteSpace(request.BackgroundImage))
-                        {
-                            var bgImgPath = Path.Combine(currentFolder, $"{Guid.NewGuid()}.png");
-                            var coverImageWidth = 0;
-                            var coverImageHeight = 0;
-                            byte[] bgImageBytes = Convert.FromBase64String(request.BackgroundImage);
-                            using (FileStream fs = new FileStream(bgImgPath, FileMode.Create))
-                            {
-                                fs.Write(bgImageBytes, 0, bgImageBytes.Length);
-                            }
-                            using (var image = Image.Load(bgImgPath))
-                            {
-                                coverImageWidth = image.Width;
-                                coverImageHeight = image.Height;
-                            }
-                            urmProcessRequest.Roix = (int)(coverImageWidth * request.RoiXPercent);
-                            urmProcessRequest.Roiy = (int)(coverImageHeight * request.RoiYPercent);
-                            urmProcessRequest.Roiwidth = (int)(coverImageWidth * request.RoiWPercent);
-                            urmProcessRequest.Roiheight = (int)(coverImageHeight * request.RoiHPercent);
-                            urmProcessRequest.ScreenWidth = coverImageWidth;
-                            urmProcessRequest.ScreenHeight = coverImageHeight;
-                        }
                         urmProcessRequest.GUID = urmProcessRequest.GetUniqueCode();
                         urmProcessRequest.GUID = urmProcessRequest.GetUniqueCode();
 
 
                         var imgList = MergeUrmImages(remedicalCode, currentFolder, request.BackgroundImage, urmProcessRequest, request);
                         var imgList = MergeUrmImages(remedicalCode, currentFolder, request.BackgroundImage, urmProcessRequest, request);
@@ -911,7 +889,9 @@ namespace WingAIDiagnosisService.Service
                                 var bitmapLogoSmall = bitmapLogo.Resize(new SKImageInfo(targetWidth, targetHeight), SKFilterQuality.High);
                                 var bitmapLogoSmall = bitmapLogo.Resize(new SKImageInfo(targetWidth, targetHeight), SKFilterQuality.High);
                                 using (var canvas = new SKCanvas(bitmapBg))
                                 using (var canvas = new SKCanvas(bitmapBg))
                                 {
                                 {
-                                    canvas.DrawBitmap(bitmap2, new SKPoint(0, 0));
+                                    var x = bitmapBg.Width * request.RoiXPercent;
+                                    var y = bitmapBg.Height * request.RoiYPercent;
+                                    canvas.DrawBitmap(bitmap2, new SKPoint((float)x, (float)y));
                                     canvas.DrawBitmap(bitmapLogoSmall, new SKPoint(leftLogoX, leftLogoY));
                                     canvas.DrawBitmap(bitmapLogoSmall, new SKPoint(leftLogoX, leftLogoY));
                                     canvas.DrawBitmap(bitmapLogoSmall, new SKPoint(rightLogoX, rightLogoY));
                                     canvas.DrawBitmap(bitmapLogoSmall, new SKPoint(rightLogoX, rightLogoY));
                                     canvas.DrawBitmap(bitmapColorbar, new SKPoint(colorBarX, colorBarY + 10));
                                     canvas.DrawBitmap(bitmapColorbar, new SKPoint(colorBarX, colorBarY + 10));