Browse Source

尝试修改测量过程中颗粒分类后颜色不准的问题(未能重现bug,先按照 Alpha通道取消处理 )

cxs 3 months ago
parent
commit
c74cd0f988
1 changed files with 2 additions and 1 deletions
  1. 2 1
      OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSField.cs

+ 2 - 1
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSField.cs

@@ -5,6 +5,7 @@ using OTSModelSharp.ServiceCenter;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Drawing;
 using System.Drawing;
+using System.Drawing.Imaging;
 using System.Linq;
 using System.Linq;
 using System.Xml;
 using System.Xml;
 
 
@@ -192,7 +193,7 @@ namespace OTSDataType
         {
         {
             CImageHandler imghandler = new CImageHandler();
             CImageHandler imghandler = new CImageHandler();
             List<COTSParticleClr> Parts = GetListAnalysisParticles();
             List<COTSParticleClr> Parts = GetListAnalysisParticles();
-            Bitmap img = new Bitmap(this.ImgWidth, this.ImgHeight);
+            Bitmap img = new Bitmap(this.ImgWidth, this.ImgHeight, PixelFormat.Format24bppRgb);
             var imgparam = m_sample.GetMsrParams().GetImageProcessParam();
             var imgparam = m_sample.GetMsrParams().GetImageProcessParam();
             var pixelsize = m_sample.CalculatePixelSize();
             var pixelsize = m_sample.CalculatePixelSize();
             imghandler.GetImageWithSTDColoredParts(Parts, imgparam, pixelsize, ref img);
             imghandler.GetImageWithSTDColoredParts(Parts, imgparam, pixelsize, ref img);