From 11bd5c5ca096abe678651f8afdc37e1d8e011f0c Mon Sep 17 00:00:00 2001 From: lsm Date: Tue, 16 Jul 2024 16:50:02 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=A7=A3=E5=86=B3=E5=BF=83=E7=94=B5?= =?UTF-8?q?=E5=9B=BE=E6=8A=A5=E5=91=8A=E5=88=86=E6=A3=80=E3=80=81=E6=80=BB?= =?UTF-8?q?=E6=A3=80=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=EF=BC=8C2?= =?UTF-8?q?=E3=80=81=E7=A7=91=E5=AE=A4=E5=B0=8F=E7=BB=93=E5=88=86=E5=8F=B7?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E7=A7=91=E5=AE=A4=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PEIS/Model/Exam/PartModel.cs | 9 +++++++-- PEIS/Utils/ReportHelper.cs | 31 ------------------------------- PEIS/View/Exam/PartForm.cs | 23 +++++++++++------------ PEIS/View/Exam/TotalForm.cs | 23 ++++++++++------------- 4 files changed, 28 insertions(+), 58 deletions(-) diff --git a/PEIS/Model/Exam/PartModel.cs b/PEIS/Model/Exam/PartModel.cs index 9fcdb49..37f7726 100644 --- a/PEIS/Model/Exam/PartModel.cs +++ b/PEIS/Model/Exam/PartModel.cs @@ -199,7 +199,7 @@ namespace PEIS.Model { "3101", //病理科 "3201", //放射科 - "3202", //超声科 + "3203", //超声科 }; var index = 1; @@ -208,11 +208,16 @@ namespace PEIS.Model if (index > 1) summary += Environment.NewLine; summary += $@"{index}.{items.Key}:" + Environment.NewLine; - if (!deptCodeList.Contains(deptCode)) + if (!deptCodeList.Contains(deptCode) && deptCode != "0141" ) { summary += string.Join(Environment.NewLine, items.Select(s => $@" {s.RptItemName}:{s.TextResult} {s.Unit} {s.UnusualFlag};").ToList()); } + else if(deptCode == "0141") + { + summary += string.Join(Environment.NewLine, + items.Select(s => $@" {s.RptItemName}:{s.TextResult} {s.Unit} {s.UnusualFlag}").ToList()); + } else { summary += string.Join(Environment.NewLine, items.Select(s => $@" {s.TextResult}").ToList()); diff --git a/PEIS/Utils/ReportHelper.cs b/PEIS/Utils/ReportHelper.cs index 848182f..4674bd3 100644 --- a/PEIS/Utils/ReportHelper.cs +++ b/PEIS/Utils/ReportHelper.cs @@ -33,37 +33,6 @@ namespace PEIS.Utils { public static class ReportHelper { - - // 逆时针旋转图片的函数 - public static Image RotateImage(Image img) - { - // 旋转角度为负90度 - float angle = -90f; - - // 计算旋转后的图像的矩形范围 - RectangleF bounds = new RectangleF(0, 0, img.Height, img.Width); - - // 创建旋转后的位图 - Bitmap rotatedImage = new Bitmap((int)bounds.Width, (int)bounds.Height); - rotatedImage.SetResolution(img.HorizontalResolution, img.VerticalResolution); - - using (Graphics g = Graphics.FromImage(rotatedImage)) - { - // 设置插值模式以改善旋转后图像的质量 - g.InterpolationMode = InterpolationMode.HighQualityBicubic; - // 设置旋转中心点 - g.TranslateTransform(rotatedImage.Width / 2, rotatedImage.Height / 2); - // 旋转角度 - g.RotateTransform(angle); - // 将旋转中心点恢复到原点 - g.TranslateTransform(-img.Width / 2, -img.Height / 2); - // 绘制旋转后的图片 - g.DrawImage(img, new PointF(0, 0)); - } - - return rotatedImage; - } - /// /// PDF to Image /// diff --git a/PEIS/View/Exam/PartForm.cs b/PEIS/View/Exam/PartForm.cs index ced17cd..43e89ab 100644 --- a/PEIS/View/Exam/PartForm.cs +++ b/PEIS/View/Exam/PartForm.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Drawing; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text.RegularExpressions; -using System.Windows.Forms; -using DevExpress.XtraEditors; +using DevExpress.XtraEditors; using DevExpress.XtraEditors.Repository; using DevExpress.XtraGrid.Views.Base; using DevExpress.XtraGrid.Views.Grid; @@ -20,6 +11,15 @@ using PEIS.Model.Exam; using PEIS.Presenter; using PEIS.Utils; using PEIS.View.UControl; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using System.Windows.Forms; using static PEIS.Utils.ColorHelper; using static PEIS.Utils.Global; @@ -1001,8 +1001,7 @@ namespace PEIS.View.Exam var img = ReportHelper.PdfToImg(item.ReportImg); if (img != null) { - var newImg = ReportHelper.RotateImage(img); - Invoke(new Action(() => { picReportExt.Image = newImg; })); + Invoke(new Action(() => { picReportExt.Image = img; picReportExt.Dock = DockStyle.Fill; picReportExt.SizeMode = PictureBoxSizeMode.Zoom; })); } return; diff --git a/PEIS/View/Exam/TotalForm.cs b/PEIS/View/Exam/TotalForm.cs index 9924384..6d02413 100644 --- a/PEIS/View/Exam/TotalForm.cs +++ b/PEIS/View/Exam/TotalForm.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Drawing; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using System.Windows.Forms; -using DevExpress.XtraEditors; +using DevExpress.XtraEditors; using DevExpress.XtraGrid.Views.Base; using DevExpress.XtraGrid.Views.Grid; using PEIS.Base; @@ -19,6 +9,14 @@ using PEIS.Model.Exam; using PEIS.Presenter; using PEIS.Utils; using PEIS.View.UControl; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; using static PEIS.Utils.ColorHelper; namespace PEIS.View.Exam @@ -954,8 +952,7 @@ namespace PEIS.View.Exam var img = ReportHelper.PdfToImg(item.ReportImg); if (img != null) { - var newImg = ReportHelper.RotateImage(img); - Invoke(new Action(() => { PictureBoxReportExt.Image = newImg; })); + Invoke(new Action(() => { PictureBoxReportExt.Image = img; PictureBoxReportExt.Dock = DockStyle.Fill; PictureBoxReportExt.SizeMode = PictureBoxSizeMode.Zoom; })); } return;