IronDrawing提供的一个功能是克隆AnyBitmap的能力。 此功能使用户可以对CropRectangle功能来指定要从文件中复制的区域,从而允许在不修改原始文件的情况下保存文件指定部分的副本。
要克隆.Clone()方法,然后保存克隆的实例。 要实现.Clone(new CropRectangle(X, Y, Width, Height))方法。 所有CropRectangle属性均使用像素(px)测量。
using IronSoftware.Drawing;
// Clone an AnyBitmap
AnyBitmap clonedframe = AnyBitmap.FromFile(@"FILE_PATH").Clone();
clonedframe.SaveAs("frameClone.jpg");
// Clone frames of any image with a specified crop area
AnyBitmap clonedWithCrop = AnyBitmap.FromFile(@"FILE_PATH").Clone(new Rectangle(0, 0, 150, 150));
clonedWithCrop.SaveAs("cropCloned.jpg");
Imports IronSoftware.Drawing
' Clone an AnyBitmap
Dim clonedframe As AnyBitmap = AnyBitmap.FromFile("FILE_PATH").Clone()
clonedframe.SaveAs("frameClone.jpg")
' Clone frames of any image with a specified crop area
Dim clonedWithCrop As AnyBitmap = AnyBitmap.FromFile("FILE_PATH").Clone(New Rectangle(0, 0, 150, 150))
clonedWithCrop.SaveAs("cropCloned.jpg")Imports IronSoftware.Drawing
' Clone an AnyBitmap
Dim clonedframe As AnyBitmap = AnyBitmap.FromFile("FILE_PATH").Clone()
clonedframe.SaveAs("frameClone.jpg")
' Clone frames of any image with a specified crop area
Dim clonedWithCrop As AnyBitmap = AnyBitmap.FromFile("FILE_PATH").Clone(New Rectangle(0, 0, 150, 150))
clonedWithCrop.SaveAs("cropCloned.jpg")IronDrawing提供的一个功能是克隆AnyBitmap的能力。 此功能使用户可以对CropRectangle功能来指定要从文件中复制的区域,从而允许在不修改原始文件的情况下保存文件指定部分的副本。
要克隆.Clone()方法,然后保存克隆的实例。 要实现.Clone(new CropRectangle(X, Y, Width, Height))方法。 所有CropRectangle属性均使用像素(px)测量。
Nuget Downloads 21,321,696|版本:2026.11刚刚发布