Init
This commit is contained in:
23
MainForm/NewPictureBox.cs
Normal file
23
MainForm/NewPictureBox.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user