This commit is contained in:
2026-02-02 21:56:45 +08:00
commit 320550399d
24 changed files with 4551 additions and 0 deletions

23
MainForm/NewPictureBox.cs Normal file
View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading.Tasks;
namespace ImageCompressor
{
internal class NewPictureBox:PictureBox
{
/// <summary>
/// 以不抗锯齿方式绘制原图像素
/// </summary>
/// <param name="pe"></param>
protected override void OnPaint(PaintEventArgs pe)
{
pe.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
pe.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
pe.Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
base.OnPaint(pe);
}
}
}