取消温差图绘制中的抗锯齿效果,使用最近邻插值以获得边界清晰的图像
This commit is contained in:
@@ -1362,8 +1362,9 @@ namespace JoyD.Windows.CS
|
|||||||
// 在温差层图像上绘制/擦除
|
// 在温差层图像上绘制/擦除
|
||||||
using (Graphics g = Graphics.FromImage(_tempDiffOverlayImage))
|
using (Graphics g = Graphics.FromImage(_tempDiffOverlayImage))
|
||||||
{
|
{
|
||||||
g.SmoothingMode = SmoothingMode.AntiAlias;
|
// 取消抗锯齿,使用最近邻插值,获得边界清晰的图像
|
||||||
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
g.SmoothingMode = SmoothingMode.None;
|
||||||
|
g.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||||
|
|
||||||
if (_isEraseMode)
|
if (_isEraseMode)
|
||||||
{
|
{
|
||||||
@@ -1883,6 +1884,9 @@ namespace JoyD.Windows.CS
|
|||||||
{
|
{
|
||||||
// 计算缩放后的目标矩形
|
// 计算缩放后的目标矩形
|
||||||
Rectangle destRect = new Rectangle(0, 0, picBoxTemp.ClientSize.Width, picBoxTemp.ClientSize.Height);
|
Rectangle destRect = new Rectangle(0, 0, picBoxTemp.ClientSize.Width, picBoxTemp.ClientSize.Height);
|
||||||
|
// 设置绘制质量为无抗锯齿,确保边界清晰
|
||||||
|
e.Graphics.SmoothingMode = SmoothingMode.None;
|
||||||
|
e.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||||
// 绘制缩放后的温差层
|
// 绘制缩放后的温差层
|
||||||
e.Graphics.DrawImage(_tempDiffOverlayImage, destRect, 0, 0, _tempDiffOverlayImage.Width, _tempDiffOverlayImage.Height, GraphicsUnit.Pixel);
|
e.Graphics.DrawImage(_tempDiffOverlayImage, destRect, 0, 0, _tempDiffOverlayImage.Width, _tempDiffOverlayImage.Height, GraphicsUnit.Pixel);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user