Enum ResizeType
ชื่อพื้นที่: Aspose.Imaging การประกอบ: Aspose.Imaging.dll (25.4.0)
รายละเอียดประเภทการรีไซเคิล
public enum ResizeType
Fields
AdaptiveResample = 8
ตัวอย่างใช้แอลกอริทึมอะแดปเตอร์ตามฟังก์ชั่นสมเหตุสมผลที่มีน้ําหนักและผสมและแอลกอริทึม interpolation lanczos3
Bell = 16
วิธีการ Interpolation Bell
BilinearResample = 9
Resample ใช้ interpolation bilinear ภาพก่อนกรองจะได้รับอนุญาตให้ลบเสียงก่อน resample เมื่อจําเป็น
CatmullRom = 11
วิธีการ Interpolation Cubic Catmull-Rom
CenterToCenter = 5
ศูนย์ของภาพใหม่จะตรงกับศูนย์ของภาพต้นฉบับ พืชจะเกิดขึ้นหากจําเป็น
CubicBSpline = 13
วิธีการ interpolation CubicBSpline
CubicConvolution = 12
วิธีการ Interpolation ของ Convolution Cubic
HighQualityResample = 10
ตัวอย่างที่มีคุณภาพสูง
LanczosResample = 6
ตัวอย่างใช้แอลกอริทึม lanczos กับ a = 3
LeftBottomToLeftBottom = 4
จุดด้านล่างซ้ายของภาพใหม่จะตรงกับจุดด้านล่างซ้ายของภาพเดิม พืชจะเกิดขึ้นหากจําเป็น
LeftTopToLeftTop = 1
จุดด้านบนด้านซ้ายของภาพใหม่จะตรงกับจุดด้านบนด้านซ้ายของภาพเดิม พืชจะเกิดขึ้นหากจําเป็น
Mitchell = 14
วิธีการ Interpolation Kubic Mitchell
NearestNeighbourResample = 7
Resample ใช้อัลกอริทึมใกล้เคียงที่สุด
None = 0
พิกเซลจะไม่ถูกเก็บไว้ในระหว่างการดําเนินการรีไซเคิล
RightBottomToRightBottom = 3
จุดด้านล่างที่ถูกต้องของภาพใหม่จะตรงกับจุดด้านล่างที่ถูกต้องของภาพเดิม พืชจะเกิดขึ้นหากจําเป็น
RightTopToRightTop = 2
จุดด้านบนของภาพใหม่จะตรงกับจุดด้านบนที่ถูกต้องของภาพเดิม พืชจะเกิดขึ้นหากจําเป็น
SinC = 15
Sinc (Lanczos3) วิธีการ interpolation คูบ
Examples
การรีไซเคิลภาพโดยใช้ประเภทรีไซเคิลที่กําหนด
using (var image = Image.Load("Photo.jpg"))
{
image.Resize(640, 480, ResizeType.CatmullRom);
image.Save("ResizedPhoto.jpg");
image.Resize(1024, 768, ResizeType.CubicConvolution);
image.Save("ResizedPhoto2.jpg");
var resizeSettings = new ImageResizeSettings
{
Mode = ResizeType.CubicBSpline,
FilterType = ImageFilterType.SmallRectangular
};
image.Resize(800, 800, resizeSettings);
image.Save("ResizedPhoto3.jpg");
}
ตัวอย่างนี้โหลดภาพและรีไซเคิลโดยใช้วิธีการรีไซเคิลต่างๆ
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
// Scale up by 2 times using Nearest Neighbour resampling.
image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
image.Save(dir + "upsample.nearestneighbour.gif");
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
// Scale down by 2 times using Nearest Neighbour resampling.
image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
image.Save(dir + "downsample.nearestneighbour.gif");
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
// Scale up by 2 times using Bilinear resampling.
image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.BilinearResample);
image.Save(dir + "upsample.bilinear.gif");
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
// Scale down by 2 times using Bilinear resampling.
image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample);
image.Save(dir + "downsample.bilinear.gif");
}