diff --git a/src/PBAnaly/Module/BioanalysisMannage.cs b/src/PBAnaly/Module/BioanalysisMannage.cs index 34a82c6..8336cfa 100644 --- a/src/PBAnaly/Module/BioanalysisMannage.cs +++ b/src/PBAnaly/Module/BioanalysisMannage.cs @@ -1,4 +1,6 @@ -using Aspose.Pdf.AI; +using AntdUI; +using Aspose.Pdf.AI; +using Aspose.Pdf.Drawing; using PBAnaly.UI; using ScottPlot.Panels; using ScottPlot.Plottables; @@ -7,7 +9,9 @@ using SixLabors.ImageSharp.PixelFormats; using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.IO; +using System.Net; using System.Threading; using System.Windows.Forms; @@ -19,6 +23,7 @@ namespace PBAnaly.Module /// public class BioanalysisMannage { + #region 结构体 public struct AlgAttribute { public int brightness; @@ -38,6 +43,7 @@ namespace PBAnaly.Module public int colorIndex; } + #endregion #region 变量 private string path; private string mark_path; @@ -72,6 +78,16 @@ namespace PBAnaly.Module private System.Drawing.Point mouseDownPosition; private System.Drawing.Point pictureBoxStartPosition; + private const int CircleRadius = 5; + private bool lineOn =false; + private bool drawLine = false; + private System.Drawing.Point startPoint = new System.Drawing.Point(-10, 0); + private System.Drawing.Point endPoint = new System.Drawing.Point(-10, 0); + + + private bool isStartCircleDragged, isEndCircleDragged; + + #endregion #endregion @@ -349,10 +365,12 @@ namespace PBAnaly.Module imagePanel.image_pl.Paint += Image_pl_Paint; + imagePaletteForm.hpb_line.Click += Hpb_line_Click; } + private void ReadTif() { string[] tifFiles = Directory.GetFiles(path, "*.tif", SearchOption.TopDirectoryOnly); @@ -473,6 +491,7 @@ namespace PBAnaly.Module break; } + UpdateImages(); })); } @@ -498,9 +517,28 @@ namespace PBAnaly.Module break; } - + UpdateImages(); } } + + private void UpdateImages() + { + if (algAttribute.scientificON) + { + + imagePanel.lb_wh.Text = "Radiance (p/sec/cm²/sr)\n color scale\n min=" + util.GetscientificNotation(algAttribute.colorMinValue) + "\n max=" + util.GetscientificNotation(algAttribute.colorValue); + } + else + { + imagePanel.lb_wh.Text = "Radiance (p/sec/cm²/sr)\n color scale\n min=" + algAttribute.colorMinValue.ToString() + "\n max=" + algAttribute.colorValue.ToString(); + } + + } + + + + + #endregion @@ -571,21 +609,57 @@ namespace PBAnaly.Module #region imagepanel private void Image_pl_Paint(object sender, PaintEventArgs e) { - + Graphics g = e.Graphics; + + // 绘制直线 + if ((startPoint != System.Drawing.Point.Empty && endPoint != System.Drawing.Point.Empty)) + { + var srart = ImageProcess.ConvertRealToPictureBox(startPoint, imagePanel.image_pl); + var end = ImageProcess.ConvertRealToPictureBox(endPoint, imagePanel.image_pl); + g.DrawLine(Pens.Red, srart, end); + + // 绘制起点和终点的圆圈 + ImageProcess.DrawCircle(g, srart, CircleRadius, Pens.Blue, Brushes.LightBlue); + ImageProcess.DrawCircle(g, end, CircleRadius, Pens.Blue, Brushes.LightBlue); + } } private void Image_pl_MouseUp(object sender, MouseEventArgs e) { - if (isDragging && e.Button == MouseButtons.Left) + System.Drawing.Point readLoction = ImageProcess.GetRealImageCoordinates(imagePanel.image_pl, e.Location); + if (isDragging && e.Button == MouseButtons.Left) { imagePanel.pl_bg_panel.Cursor = Cursors.Default; + isDragging = false; } + else if ((drawLine && e.Button == MouseButtons.Left) || (isStartCircleDragged || isEndCircleDragged)) + { + drawLine = false; + lineOn = false; + isStartCircleDragged = false; + isEndCircleDragged = false; + imagePanel.image_pl.Invalidate(); + + // 计算距离 + double deltaX = endPoint.X - startPoint.X; + double deltaY = endPoint.Y - startPoint.Y; + var value = Math.Sqrt(deltaX * deltaX + deltaY * deltaY); + imagePaletteForm.flb_act_mm.Text = value.ToString() + " mm"; + imagePaletteForm.flb_act_mm.Refresh(); + } + } private void Image_pl_MouseMove(object sender, MouseEventArgs e) { - if (isDragging && e.Button == MouseButtons.Left) + System.Drawing.Point readLoction = ImageProcess.ConvertPictureBoxToReal(e.Location, imagePanel.image_pl); + if (lineOn && drawLine) + { + endPoint = readLoction; // 更新终点位置 + imagePanel.image_pl.Invalidate(); // 触发重绘 + } + else if (isDragging && e.Button == MouseButtons.Left) { int deltaX = e.X - mouseDownPosition.X; int deltaY = e.Y - mouseDownPosition.Y; @@ -605,6 +679,26 @@ namespace PBAnaly.Module imagePanel.pl_bg_panel.Top = imagePanel.pl_panel_image.ClientSize.Height - imagePanel.pl_bg_panel.Height; } } + else if (isStartCircleDragged) + { + startPoint = readLoction; + + imagePanel.image_pl.Invalidate(); + } + else if (isEndCircleDragged) + { + endPoint = readLoction; + imagePanel.image_pl.Invalidate(); + } + else if (ImageProcess.IsNearCorner(readLoction,startPoint,CircleRadius) || ImageProcess.IsNearCorner(readLoction, endPoint, CircleRadius)) + { + imagePanel.image_pl.Cursor = Cursors.Hand; + } + + else + { + imagePanel.image_pl.Cursor = Cursors.Default; + } } private void Image_pl_DoubleClick(object sender, System.EventArgs e) @@ -614,15 +708,54 @@ namespace PBAnaly.Module private void Image_pl_MouseDown(object sender, MouseEventArgs e) { - if (e.Button == MouseButtons.Left && imagePanel.IsImageLargerThanPanel()) + System.Drawing.Point readLoction = ImageProcess.ConvertPictureBoxToReal( e.Location, imagePanel.image_pl); + if (e.Button == MouseButtons.Left) { - isDragging = true; - mouseDownPosition = e.Location; - pictureBoxStartPosition = imagePanel.pl_bg_panel.Location; - imagePanel.pl_bg_panel.Cursor = Cursors.Hand; + if (lineOn) + { + drawLine = true; + startPoint = readLoction; + } + else if (imagePanel.IsImageLargerThanPanel()) + { + isDragging = true; + mouseDownPosition = e.Location; + pictureBoxStartPosition = imagePanel.pl_bg_panel.Location; + imagePanel.pl_bg_panel.Cursor = Cursors.Hand; + } + else if (ImageProcess.IsNearCorner(readLoction, startPoint, CircleRadius)) + { + + isStartCircleDragged = true; + + + } + else if (ImageProcess.IsNearCorner(readLoction, endPoint, CircleRadius)) + { + isEndCircleDragged = true; + + } } + else if (e.Button == MouseButtons.Right) + { + if (ImageProcess.IsPointOnLine(readLoction,startPoint,endPoint,CircleRadius)) + { + startPoint = new System.Drawing.Point(-10, 0); + endPoint = new System.Drawing.Point(-10, 0); + imagePanel.image_pl.Invalidate(); + imagePaletteForm.flb_act_mm.Text = ("0"); + imagePaletteForm.flb_act_mm.Refresh(); + } + } + } + #endregion + #region imagePaletteForm + private void Hpb_line_Click(object sender, EventArgs e) + { + lineOn = true; + } #endregion #endregion #region 对外接口 diff --git a/src/PBAnaly/Module/ImageProcess.cs b/src/PBAnaly/Module/ImageProcess.cs index e68bc0d..0796788 100644 --- a/src/PBAnaly/Module/ImageProcess.cs +++ b/src/PBAnaly/Module/ImageProcess.cs @@ -13,6 +13,7 @@ using OpenCvSharp; using SixLabors.ImageSharp.Advanced; using System.Runtime.InteropServices; using Sunny.UI.Win32; +using System.Net; namespace PBAnaly.Module @@ -158,6 +159,133 @@ namespace PBAnaly.Module picBoxBottomRight.X - picBoxTopLeft.X, picBoxBottomRight.Y - picBoxTopLeft.Y); } + + + private static System.Drawing.Rectangle GetImageRectangle(PictureBox pictureBox) + { + var container = pictureBox.ClientRectangle; + var image = pictureBox.Image; + if (image == null) + return System.Drawing.Rectangle.Empty; + + var imageSize = image.Size; + var fitSize = new System.Drawing.Rectangle(0, 0, container.Width, container.Height); + + switch (pictureBox.SizeMode) + { + case PictureBoxSizeMode.Normal: + case PictureBoxSizeMode.AutoSize: + fitSize.Size = imageSize; + break; + case PictureBoxSizeMode.StretchImage: + break; + case PictureBoxSizeMode.CenterImage: + fitSize.X = (container.Width - imageSize.Width) / 2; + fitSize.Y = (container.Height - imageSize.Height) / 2; + fitSize.Size = imageSize; + break; + case PictureBoxSizeMode.Zoom: + float r = Math.Min((float)container.Width / imageSize.Width, (float)container.Height / imageSize.Height); + fitSize.Width = (int)(imageSize.Width * r); + fitSize.Height = (int)(imageSize.Height * r); + fitSize.X = (container.Width - fitSize.Width) / 2; + fitSize.Y = (container.Height - fitSize.Height) / 2; + break; + } + return fitSize; + } + public static System.Drawing.Point ConvertRealToPictureBox(System.Drawing.Point realPoint, PictureBox pictureBox) + { + var rect = GetImageRectangle(pictureBox); + var scaleX = (float)rect.Width / pictureBox.Image.Width; + var scaleY = (float)rect.Height / pictureBox.Image.Height; + return new System.Drawing.Point((int)(realPoint.X * scaleX) + rect.Left, (int)(realPoint.Y * scaleY) + rect.Top); + } + + public static System.Drawing.Rectangle ConvertRealRectangleToPictureBox(System.Drawing.Rectangle realRect, PictureBox pictureBox) + { + var topLeft = ConvertRealToPictureBox(new System.Drawing.Point(realRect.Left, realRect.Top), pictureBox); + var bottomRight = ConvertRealToPictureBox(new System.Drawing.Point(realRect.Right, realRect.Bottom), pictureBox); + return new System.Drawing.Rectangle(topLeft.X, topLeft.Y, bottomRight.X - topLeft.X, bottomRight.Y - topLeft.Y); + } + + public static System.Drawing.Point ConvertPictureBoxToReal(System.Drawing.Point pictureBoxPoint, PictureBox pictureBox) + { + var rect = GetImageRectangle(pictureBox); + var scaleX = pictureBox.Image.Width / (float)rect.Width; + var scaleY = pictureBox.Image.Height / (float)rect.Height; + var x = (int)((pictureBoxPoint.X - rect.Left) * scaleX); + var y = (int)((pictureBoxPoint.Y - rect.Top) * scaleY); + return new System.Drawing.Point(x, y); + } + + public static System.Drawing.Rectangle ConvertPictureBoxRectangleToReal(System.Drawing.Rectangle pictureBoxRect, PictureBox pictureBox) + { + var topLeft = ConvertPictureBoxToReal(new System.Drawing.Point(pictureBoxRect.Left, pictureBoxRect.Top), pictureBox); + var bottomRight = ConvertPictureBoxToReal(new System.Drawing.Point(pictureBoxRect.Right, pictureBoxRect.Bottom), pictureBox); + return new System.Drawing.Rectangle(topLeft.X, topLeft.Y, bottomRight.X - topLeft.X, bottomRight.Y - topLeft.Y); + } + + + public static bool IsNearCorner(System.Drawing.Point point, System.Drawing.Point corner, int tolerance) + { + return Math.Abs(point.X - corner.X) <= tolerance && Math.Abs(point.Y - corner.Y) <= tolerance; + } + + public static void DrawCircle(Graphics g, System.Drawing.Point center, int radius, Pen pen, Brush brush) + { + System.Drawing.Rectangle rect = new System.Drawing.Rectangle(center.X - radius, center.Y - radius, radius * 2, radius * 2); + g.FillEllipse(brush, rect); + g.DrawEllipse(pen, rect); + } + + public static bool IsPointInCircle(System.Drawing.Point point, System.Drawing.Point circle,int CircleRadius) + { + double distance = Math.Sqrt(Math.Pow(point.X - circle.X, 2) + Math.Pow(point.Y - circle.Y, 2)); + return distance <= CircleRadius; + } + + public static bool IsPointOnLine(System.Drawing.Point point, System.Drawing.Point start, System.Drawing.Point end,int CircleRadius) + { + + // 使用线段的最小距离判断点是否在线段上 + double distance = DistanceToLine(point, start, end); + return distance <= CircleRadius; // 如果距离小于等于圆圈半径,认为在线段上 + } + + public static double DistanceToLine(System.Drawing.Point p, System.Drawing.Point p1, System.Drawing.Point p2) + { + double A = p.X - p1.X; + double B = p.Y - p1.Y; + double C = p2.X - p1.X; + double D = p2.Y - p1.Y; + + double dot = A * C + B * D; + double lenSq = C * C + D * D; + double param = (lenSq != 0) ? dot / lenSq : -1; + + double xx, yy; + + if (param < 0) + { + xx = p1.X; + yy = p1.Y; + } + else if (param > 1) + { + xx = p2.X; + yy = p2.Y; + } + else + { + xx = p1.X + param * C; + yy = p1.Y + param * D; + } + + double dx = p.X - xx; + double dy = p.Y - yy; + return Math.Sqrt(dx * dx + dy * dy); + } } diff --git a/src/PBAnaly/UI/BioanalyImagePanel.Designer.cs b/src/PBAnaly/UI/BioanalyImagePanel.Designer.cs index c4a479b..7e9f85e 100644 --- a/src/PBAnaly/UI/BioanalyImagePanel.Designer.cs +++ b/src/PBAnaly/UI/BioanalyImagePanel.Designer.cs @@ -46,7 +46,9 @@ this.image_pr = new AntdUI.Image3D(); this.pl_panel_image = new AntdUI.Panel(); this.pl_bg_panel = new AntdUI.Panel(); - this.image_pl = new AntdUI.Image3D(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.lb_wh = new AntdUI.Label(); + this.image_pl = new System.Windows.Forms.PictureBox(); this.panel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.panel2.SuspendLayout(); @@ -55,6 +57,8 @@ this.tableLayoutPanel2.SuspendLayout(); this.pl_panel_image.SuspendLayout(); this.pl_bg_panel.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.image_pl)).BeginInit(); this.SuspendLayout(); // // windowBar1 @@ -220,7 +224,7 @@ this.lb_size.BackColor = System.Drawing.SystemColors.ControlLight; this.lb_size.Dock = System.Windows.Forms.DockStyle.Fill; this.lb_size.Location = new System.Drawing.Point(0, 0); - this.lb_size.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0); + this.lb_size.Margin = new System.Windows.Forms.Padding(0); this.lb_size.Name = "lb_size"; this.lb_size.Size = new System.Drawing.Size(352, 13); this.lb_size.TabIndex = 0; @@ -232,8 +236,8 @@ this.tableLayoutPanel2.ColumnCount = 2; this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 66F)); - this.tableLayoutPanel2.Controls.Add(this.image_pr, 1, 0); this.tableLayoutPanel2.Controls.Add(this.pl_panel_image, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel3, 1, 0); this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 49); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; @@ -248,9 +252,9 @@ this.image_pr.Dock = System.Windows.Forms.DockStyle.Fill; this.image_pr.Duration = 0; this.image_pr.ImageFit = AntdUI.TFit.Fill; - this.image_pr.Location = new System.Drawing.Point(289, 3); + this.image_pr.Location = new System.Drawing.Point(3, 3); this.image_pr.Name = "image_pr"; - this.image_pr.Size = new System.Drawing.Size(60, 237); + this.image_pr.Size = new System.Drawing.Size(60, 175); this.image_pr.Speed = 1; this.image_pr.TabIndex = 1; this.image_pr.Text = "image3D1"; @@ -275,17 +279,42 @@ this.pl_bg_panel.TabIndex = 0; this.pl_bg_panel.Text = "panel4"; // + // tableLayoutPanel3 + // + this.tableLayoutPanel3.ColumnCount = 1; + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Controls.Add(this.lb_wh, 0, 1); + this.tableLayoutPanel3.Controls.Add(this.image_pr, 0, 0); + this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel3.Location = new System.Drawing.Point(286, 0); + this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + this.tableLayoutPanel3.RowCount = 2; + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 62F)); + this.tableLayoutPanel3.Size = new System.Drawing.Size(66, 243); + this.tableLayoutPanel3.TabIndex = 1; + // + // lb_wh + // + this.lb_wh.Dock = System.Windows.Forms.DockStyle.Fill; + this.lb_wh.Font = new System.Drawing.Font("隶书", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lb_wh.Location = new System.Drawing.Point(3, 184); + this.lb_wh.Name = "lb_wh"; + this.lb_wh.Size = new System.Drawing.Size(60, 56); + this.lb_wh.TabIndex = 3; + this.lb_wh.Text = "Color Scale\r\nMin = 1\r\nMax= 2"; + this.lb_wh.TextAlign = System.Drawing.ContentAlignment.TopCenter; + // // image_pl // this.image_pl.Dock = System.Windows.Forms.DockStyle.Fill; - this.image_pl.Duration = 0; - this.image_pl.ImageFit = AntdUI.TFit.Fill; this.image_pl.Location = new System.Drawing.Point(0, 0); this.image_pl.Name = "image_pl"; this.image_pl.Size = new System.Drawing.Size(223, 185); - this.image_pl.Speed = 1; + this.image_pl.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.image_pl.TabIndex = 0; - this.image_pl.Text = "image3D1"; + this.image_pl.TabStop = false; // // BioanalyImagePanel // @@ -309,6 +338,8 @@ this.tableLayoutPanel2.ResumeLayout(false); this.pl_panel_image.ResumeLayout(false); this.pl_bg_panel.ResumeLayout(false); + this.tableLayoutPanel3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.image_pl)).EndInit(); this.ResumeLayout(false); } @@ -332,7 +363,9 @@ public AntdUI.Avatar ava_zoom_out; public AntdUI.Avatar ava__zoom_in; public AntdUI.Panel pl_bg_panel; - public AntdUI.Image3D image_pl; public AntdUI.Panel pl_panel_image; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + public AntdUI.Label lb_wh; + public System.Windows.Forms.PictureBox image_pl; } } \ No newline at end of file diff --git a/src/PBAnaly/UI/BioanayImagePaletteForm.Designer.cs b/src/PBAnaly/UI/BioanayImagePaletteForm.Designer.cs index 505d75a..a5dcdc0 100644 --- a/src/PBAnaly/UI/BioanayImagePaletteForm.Designer.cs +++ b/src/PBAnaly/UI/BioanayImagePaletteForm.Designer.cs @@ -52,6 +52,9 @@ this.collapseItem2 = new AntdUI.CollapseItem(); this.cb_colortable = new System.Windows.Forms.ComboBox(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.nud_colorMax = new System.Windows.Forms.NumericUpDown(); + this.nud_colorMin = new System.Windows.Forms.NumericUpDown(); + this.nud_opacity = new System.Windows.Forms.NumericUpDown(); this.nud_brightness = new System.Windows.Forms.NumericUpDown(); this.dtb_colorMax = new ReaLTaiizor.Controls.DungeonTrackBar(); this.dtb_colorMin = new ReaLTaiizor.Controls.DungeonTrackBar(); @@ -63,9 +66,6 @@ this.collapseItem1 = new AntdUI.CollapseItem(); this.cll_panel = new AntdUI.Collapse(); this.collapseItem3 = new AntdUI.CollapseItem(); - this.nud_opacity = new System.Windows.Forms.NumericUpDown(); - this.nud_colorMin = new System.Windows.Forms.NumericUpDown(); - this.nud_colorMax = new System.Windows.Forms.NumericUpDown(); ((System.ComponentModel.ISupportInitialize)(this.hpb_line)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.hpb_wand)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.hpb_xianduan)).BeginInit(); @@ -75,15 +75,15 @@ this.panel2.SuspendLayout(); this.collapseItem2.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nud_colorMax)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nud_colorMin)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nud_opacity)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nud_brightness)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pb_bgimage)).BeginInit(); this.panel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.collapseItem1.SuspendLayout(); this.cll_panel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.nud_opacity)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nud_colorMin)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nud_colorMax)).BeginInit(); this.SuspendLayout(); // // fb_fixSetting @@ -464,6 +464,30 @@ this.tableLayoutPanel2.Size = new System.Drawing.Size(260, 272); this.tableLayoutPanel2.TabIndex = 0; // + // nud_colorMax + // + this.nud_colorMax.Dock = System.Windows.Forms.DockStyle.Fill; + this.nud_colorMax.Location = new System.Drawing.Point(213, 108); + this.nud_colorMax.Name = "nud_colorMax"; + this.nud_colorMax.Size = new System.Drawing.Size(44, 21); + this.nud_colorMax.TabIndex = 51; + // + // nud_colorMin + // + this.nud_colorMin.Dock = System.Windows.Forms.DockStyle.Fill; + this.nud_colorMin.Location = new System.Drawing.Point(213, 79); + this.nud_colorMin.Name = "nud_colorMin"; + this.nud_colorMin.Size = new System.Drawing.Size(44, 21); + this.nud_colorMin.TabIndex = 50; + // + // nud_opacity + // + this.nud_opacity.Dock = System.Windows.Forms.DockStyle.Fill; + this.nud_opacity.Location = new System.Drawing.Point(213, 32); + this.nud_opacity.Name = "nud_opacity"; + this.nud_opacity.Size = new System.Drawing.Size(44, 21); + this.nud_opacity.TabIndex = 45; + // // nud_brightness // this.nud_brightness.Dock = System.Windows.Forms.DockStyle.Fill; @@ -643,30 +667,6 @@ this.collapseItem3.TabIndex = 3; this.collapseItem3.Text = "collapseItem3"; // - // nud_opacity - // - this.nud_opacity.Dock = System.Windows.Forms.DockStyle.Fill; - this.nud_opacity.Location = new System.Drawing.Point(213, 32); - this.nud_opacity.Name = "nud_opacity"; - this.nud_opacity.Size = new System.Drawing.Size(44, 21); - this.nud_opacity.TabIndex = 45; - // - // nud_colorMin - // - this.nud_colorMin.Dock = System.Windows.Forms.DockStyle.Fill; - this.nud_colorMin.Location = new System.Drawing.Point(213, 79); - this.nud_colorMin.Name = "nud_colorMin"; - this.nud_colorMin.Size = new System.Drawing.Size(44, 21); - this.nud_colorMin.TabIndex = 50; - // - // nud_colorMax - // - this.nud_colorMax.Dock = System.Windows.Forms.DockStyle.Fill; - this.nud_colorMax.Location = new System.Drawing.Point(213, 108); - this.nud_colorMax.Name = "nud_colorMax"; - this.nud_colorMax.Size = new System.Drawing.Size(44, 21); - this.nud_colorMax.TabIndex = 51; - // // BioanayImagePaletteForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -686,15 +686,15 @@ this.panel2.ResumeLayout(false); this.collapseItem2.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.nud_colorMax)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nud_colorMin)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nud_opacity)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nud_brightness)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pb_bgimage)).EndInit(); this.panel1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.collapseItem1.ResumeLayout(false); this.cll_panel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.nud_opacity)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nud_colorMin)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nud_colorMax)).EndInit(); this.ResumeLayout(false); } @@ -708,13 +708,11 @@ private ReaLTaiizor.Controls.FoxTextBox ftb_w; private ReaLTaiizor.Controls.FoxLabel foxLabel8; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private ReaLTaiizor.Controls.FoxLabel flb_act_mm; private ReaLTaiizor.Controls.FoxLabel foxLabel9; private ReaLTaiizor.Controls.FoxLabel foxLabel6; private ReaLTaiizor.Controls.FoxLabel foxLabel2; private ReaLTaiizor.Controls.FoxLabel foxLabel3; private ReaLTaiizor.Controls.FoxLabel foxLabel1; - private ReaLTaiizor.Controls.HopePictureBox hpb_line; private System.Windows.Forms.PictureBox pb_bgimage; private ReaLTaiizor.Controls.FoxLabel foxLabel4; private ReaLTaiizor.Controls.HopePictureBox hpb_wand; @@ -739,5 +737,7 @@ public System.Windows.Forms.NumericUpDown nud_opacity; public System.Windows.Forms.NumericUpDown nud_brightness; public System.Windows.Forms.ComboBox cb_colortable; + public ReaLTaiizor.Controls.HopePictureBox hpb_line; + public ReaLTaiizor.Controls.FoxLabel flb_act_mm; } } \ No newline at end of file diff --git a/src/PBAnaly/UI/ImagePanel.Designer.cs b/src/PBAnaly/UI/ImagePanel.Designer.cs index efab9af..32e5f61 100644 --- a/src/PBAnaly/UI/ImagePanel.Designer.cs +++ b/src/PBAnaly/UI/ImagePanel.Designer.cs @@ -39,12 +39,12 @@ this.cb_scientific = new ReaLTaiizor.Controls.CheckBox(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); this.tlpanl_image_bar = new System.Windows.Forms.TableLayoutPanel(); - this.pb_coloarbar_image = new System.Windows.Forms.PictureBox(); this.pl_image = new ReaLTaiizor.Controls.Panel(); this.pl_bg_image = new ReaLTaiizor.Controls.Panel(); this.pb_image = new System.Windows.Forms.PictureBox(); this.lb_wh = new AntdUI.Label(); this.lb_modename = new AntdUI.Label(); + this.pb_coloarbar_image = new System.Windows.Forms.PictureBox(); this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); this.mlb_bottomLabel = new ReaLTaiizor.Controls.MoonLabel(); this.tableLayoutPanel1.SuspendLayout(); @@ -55,10 +55,10 @@ ((System.ComponentModel.ISupportInitialize)(this.hpb_zoom_out)).BeginInit(); this.tableLayoutPanel3.SuspendLayout(); this.tlpanl_image_bar.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pb_coloarbar_image)).BeginInit(); this.pl_image.SuspendLayout(); this.pl_bg_image.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pb_image)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pb_coloarbar_image)).BeginInit(); this.tableLayoutPanel4.SuspendLayout(); this.SuspendLayout(); // @@ -262,32 +262,21 @@ this.tableLayoutPanel3.SetColumnSpan(this.tlpanl_image_bar, 2); this.tlpanl_image_bar.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 83.56546F)); this.tlpanl_image_bar.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.43454F)); - this.tlpanl_image_bar.Controls.Add(this.pb_coloarbar_image, 1, 1); this.tlpanl_image_bar.Controls.Add(this.pl_image, 0, 0); this.tlpanl_image_bar.Controls.Add(this.lb_wh, 1, 2); this.tlpanl_image_bar.Controls.Add(this.lb_modename, 1, 0); + this.tlpanl_image_bar.Controls.Add(this.pb_coloarbar_image, 1, 1); this.tlpanl_image_bar.Dock = System.Windows.Forms.DockStyle.Fill; this.tlpanl_image_bar.Location = new System.Drawing.Point(0, 0); this.tlpanl_image_bar.Margin = new System.Windows.Forms.Padding(0); this.tlpanl_image_bar.Name = "tlpanl_image_bar"; this.tlpanl_image_bar.RowCount = 3; - this.tlpanl_image_bar.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.tlpanl_image_bar.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 54F)); this.tlpanl_image_bar.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpanl_image_bar.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 97F)); + this.tlpanl_image_bar.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 64F)); this.tlpanl_image_bar.Size = new System.Drawing.Size(359, 273); this.tlpanl_image_bar.TabIndex = 2; // - // pb_coloarbar_image - // - this.pb_coloarbar_image.Dock = System.Windows.Forms.DockStyle.Fill; - this.pb_coloarbar_image.Location = new System.Drawing.Point(300, 26); - this.pb_coloarbar_image.Margin = new System.Windows.Forms.Padding(0); - this.pb_coloarbar_image.Name = "pb_coloarbar_image"; - this.pb_coloarbar_image.Size = new System.Drawing.Size(59, 150); - this.pb_coloarbar_image.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pb_coloarbar_image.TabIndex = 1; - this.pb_coloarbar_image.TabStop = false; - // // pl_image // this.pl_image.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(51)))), ((int)(((byte)(63))))); @@ -330,11 +319,10 @@ // // lb_wh // - this.lb_wh.Dock = System.Windows.Forms.DockStyle.Fill; this.lb_wh.Font = new System.Drawing.Font("隶书", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.lb_wh.Location = new System.Drawing.Point(303, 179); + this.lb_wh.Location = new System.Drawing.Point(303, 212); this.lb_wh.Name = "lb_wh"; - this.lb_wh.Size = new System.Drawing.Size(53, 91); + this.lb_wh.Size = new System.Drawing.Size(53, 27); this.lb_wh.TabIndex = 2; this.lb_wh.Text = "Color Scale\r\nMin = 1\r\nMax= 2"; this.lb_wh.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -344,10 +332,20 @@ this.lb_modename.Dock = System.Windows.Forms.DockStyle.Fill; this.lb_modename.Location = new System.Drawing.Point(303, 3); this.lb_modename.Name = "lb_modename"; - this.lb_modename.Size = new System.Drawing.Size(53, 20); + this.lb_modename.Size = new System.Drawing.Size(53, 48); this.lb_modename.TabIndex = 3; this.lb_modename.Text = ""; // + // pb_coloarbar_image + // + this.pb_coloarbar_image.Location = new System.Drawing.Point(300, 54); + this.pb_coloarbar_image.Margin = new System.Windows.Forms.Padding(0); + this.pb_coloarbar_image.Name = "pb_coloarbar_image"; + this.pb_coloarbar_image.Size = new System.Drawing.Size(59, 73); + this.pb_coloarbar_image.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pb_coloarbar_image.TabIndex = 1; + this.pb_coloarbar_image.TabStop = false; + // // tableLayoutPanel4 // this.tableLayoutPanel4.ColumnCount = 2; @@ -403,10 +401,10 @@ ((System.ComponentModel.ISupportInitialize)(this.hpb_zoom_out)).EndInit(); this.tableLayoutPanel3.ResumeLayout(false); this.tlpanl_image_bar.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pb_coloarbar_image)).EndInit(); this.pl_image.ResumeLayout(false); this.pl_bg_image.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pb_image)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pb_coloarbar_image)).EndInit(); this.tableLayoutPanel4.ResumeLayout(false); this.tableLayoutPanel4.PerformLayout(); this.ResumeLayout(false); diff --git a/src/PBAnaly/UI/ImageToolPaletteForm.Designer.cs b/src/PBAnaly/UI/ImageToolPaletteForm.Designer.cs index 2ba5d23..2d17611 100644 --- a/src/PBAnaly/UI/ImageToolPaletteForm.Designer.cs +++ b/src/PBAnaly/UI/ImageToolPaletteForm.Designer.cs @@ -119,9 +119,9 @@ this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 3; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 181F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 193F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 8F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(329, 207); this.tableLayoutPanel1.TabIndex = 0; // @@ -131,7 +131,7 @@ this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(3, 3); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(323, 175); + this.panel1.Size = new System.Drawing.Size(323, 187); this.panel1.TabIndex = 0; this.panel1.Text = "panel1"; // @@ -172,10 +172,10 @@ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 19F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(323, 175); + this.tableLayoutPanel2.Size = new System.Drawing.Size(323, 187); this.tableLayoutPanel2.TabIndex = 0; // // foxLabel8 @@ -187,7 +187,7 @@ this.foxLabel8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(88)))), ((int)(((byte)(100))))); this.foxLabel8.Location = new System.Drawing.Point(3, 130); this.foxLabel8.Name = "foxLabel8"; - this.foxLabel8.Size = new System.Drawing.Size(267, 14); + this.foxLabel8.Size = new System.Drawing.Size(267, 13); this.foxLabel8.TabIndex = 34; this.foxLabel8.Text = "Color Rable"; // @@ -465,7 +465,7 @@ "RGB", "Pseudo", "Gray"}); - this.cb_colortable.Location = new System.Drawing.Point(3, 150); + this.cb_colortable.Location = new System.Drawing.Point(3, 149); this.cb_colortable.Name = "cb_colortable"; this.cb_colortable.Size = new System.Drawing.Size(84, 20); this.cb_colortable.TabIndex = 35; @@ -474,19 +474,20 @@ // pb_bgimage // this.pb_bgimage.Dock = System.Windows.Forms.DockStyle.Fill; - this.pb_bgimage.Location = new System.Drawing.Point(90, 147); + this.pb_bgimage.Location = new System.Drawing.Point(90, 146); this.pb_bgimage.Margin = new System.Windows.Forms.Padding(0); this.pb_bgimage.Name = "pb_bgimage"; - this.pb_bgimage.Size = new System.Drawing.Size(183, 20); + this.pb_bgimage.Size = new System.Drawing.Size(183, 25); this.pb_bgimage.TabIndex = 36; this.pb_bgimage.TabStop = false; // // collapseItem2 // this.collapseItem2.Controls.Add(this.tableLayoutPanel3); - this.collapseItem2.Location = new System.Drawing.Point(-331, -113); + this.collapseItem2.Expand = true; + this.collapseItem2.Location = new System.Drawing.Point(19, 338); this.collapseItem2.Name = "collapseItem2"; - this.collapseItem2.Size = new System.Drawing.Size(331, 113); + this.collapseItem2.Size = new System.Drawing.Size(329, 113); this.collapseItem2.TabIndex = 1; this.collapseItem2.Text = "ROI工具"; // @@ -510,7 +511,7 @@ this.tableLayoutPanel3.RowCount = 2; this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 34F)); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.Size = new System.Drawing.Size(331, 113); + this.tableLayoutPanel3.Size = new System.Drawing.Size(329, 113); this.tableLayoutPanel3.TabIndex = 0; // // hpb_wand @@ -564,7 +565,7 @@ this.hpb_rect.Dock = System.Windows.Forms.DockStyle.Fill; this.hpb_rect.Image = global::PBAnaly.Properties.Resources._10矩形; this.hpb_rect.Location = new System.Drawing.Point(2, 2); - this.hpb_rect.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.hpb_rect.Margin = new System.Windows.Forms.Padding(2); this.hpb_rect.Name = "hpb_rect"; this.hpb_rect.PixelOffsetType = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; this.hpb_rect.Size = new System.Drawing.Size(30, 30); @@ -588,7 +589,7 @@ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; this.panel2.Location = new System.Drawing.Point(3, 37); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(325, 73); + this.panel2.Size = new System.Drawing.Size(323, 73); this.panel2.TabIndex = 14; this.panel2.Text = "panel2"; // @@ -709,7 +710,7 @@ this.ControlBox = false; this.Controls.Add(this.cll_panel); this.FormStyle = MaterialSkin.Controls.MaterialForm.FormStyles.ActionBar_None; - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Margin = new System.Windows.Forms.Padding(2); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ImageToolPaletteForm"; @@ -759,7 +760,6 @@ private System.Windows.Forms.NumericUpDown nud_color_max; private System.Windows.Forms.NumericUpDown nud_brightness; private System.Windows.Forms.NumericUpDown nud_opacity; - private ReaLTaiizor.Controls.FoxLabel flb_act_mm; private ReaLTaiizor.Controls.FoxLabel foxLabel8; private System.Windows.Forms.ComboBox cb_colortable; private System.Windows.Forms.PictureBox pb_bgimage; @@ -776,5 +776,6 @@ private ReaLTaiizor.Controls.FoxLabel foxLabel5; private ReaLTaiizor.Controls.FoxTextBox ftb_w; private ReaLTaiizor.Controls.FoxButton fb_fixSetting; + public ReaLTaiizor.Controls.FoxLabel flb_act_mm; } } \ No newline at end of file