Class LoadOptions
Tên không gian: Aspose.Imaging Tổng hợp: Aspose.Imaging.dll (25.4.0)
Nó đại diện cho các tùy chọn tải.
[JsonObject(MemberSerialization.OptIn)]
public class LoadOptions
Inheritance
Derived
CdrLoadOptions , CmxLoadOptions , DngLoadOptions , EpsLoadOptions , Jpeg2000LoadOptions , OdLoadOptions , PngLoadOptions , SvgLoadOptions
Thành viên thừa kế
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
LoadOptions()
[JsonConstructor]
public LoadOptions()
Properties
BufferSizeHint
Nhận hoặc đặt dấu kích thước buffer mà được xác định kích thước tối đa cho phép cho tất cả các buffer nội bộ.
public int BufferSizeHint { get; set; }
Giá trị bất động sản
Examples
Ví dụ sau đây cho thấy làm thế nào để thiết lập giới hạn bộ nhớ khi tải một hình ảnh CMX. Giới hạn Bộ nhớ là kích thước tối đa được phép (trong megabytes) cho tất cả các buffer nội bộ.
string dir = "c:\\aspose.imaging\\issues\\net\\3419\\";
// Setting a memory limit of 10 megabytes for a target loaded image.
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "example.cmx", new Aspose.Imaging.LoadOptions() { BufferSizeHint = 10 }))
{
image.Save(dir + "output.png",
new Aspose.Imaging.ImageOptions.PngOptions()
{
VectorRasterizationOptions =
new Aspose.Imaging.ImageOptions.CmxRasterizationOptions
{
TextRenderingHint = Aspose.Imaging.TextRenderingHint.SingleBitPerPixel,
SmoothingMode = Aspose.Imaging.SmoothingMode.AntiAlias,
Positioning = Aspose.Imaging.ImageOptions.PositioningTypes.DefinedByDocument
}
});
}
Ví dụ sau đây cho thấy làm thế nào để thiết lập giới hạn bộ nhớ khi tải một hình ảnh JPEG. Giới hạn Bộ nhớ là kích thước tối đa được phép (trong megabytes) cho tất cả các buffer nội bộ.
string dir = "c:\\aspose.imaging\\issues\\net\\3404\\";
// Setting a memory limit of 50 megabytes for target loaded image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "inputFile.jpg", new Aspose.Imaging.LoadOptions() { BufferSizeHint = 50 }))
{
image.Save(dir + "outputFile_Baseline.jpg",
new Aspose.Imaging.ImageOptions.JpegOptions
{
CompressionType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionMode.Baseline,
Quality = 100
});
image.Save(dir + "outputFile_Progressive.jpg",
new Aspose.Imaging.ImageOptions.JpegOptions
{
CompressionType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionMode.Progressive
});
image.Save(dir + "outputFile_Lossless.jpg",
new Aspose.Imaging.ImageOptions.JpegOptions
{
ColorType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionColorMode.YCbCr,
CompressionType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionMode.Lossless,
BitsPerChannel = 4
});
image.Save(dir + "outputFile_JpegLs.jpg",
new Aspose.Imaging.ImageOptions.JpegOptions
{
ColorType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionColorMode.YCbCr,
CompressionType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionMode.JpegLs,
JpegLsInterleaveMode = Aspose.Imaging.FileFormats.Jpeg.JpegLsInterleaveMode.None,
JpegLsAllowedLossyError = 3,
JpegLsPreset = null
});
}
ConcurrentImageProcessing
Nhận hoặc đặt một giá trị chỉ ra liệu [công việc hình ảnh cạnh tranh].
public bool ConcurrentImageProcessing { get; set; }
Giá trị bất động sản
DataBackgroundColor
Nhận hoặc cài đặt Aspose.Imaging.Image background Wl17.Color.
public Color DataBackgroundColor { get; set; }
Giá trị bất động sản
Remarks
Thông thường, màu nền được thiết lập bất cứ khi nào giá trị pixel không thể được khôi phục do tham nhũng dữ liệu.
DataRecoveryMode
Nhận hoặc thiết lập chế độ phục hồi dữ liệu.
public DataRecoveryMode DataRecoveryMode { get; set; }
Giá trị bất động sản
ProgressEventHandler
Nhận hoặc đặt sự tiến bộ sự kiện thủ công.
[JsonProperty]
public ProgressEventHandler ProgressEventHandler { get; set; }
Giá trị bất động sản
Examples
Ví dụ sau đây cho thấy cách in thông tin về các sự kiện tiến bộ cho các hoạt động tải / xuất khẩu.
public void Test3460()
{
string dir = "c:\\aspose.imaging\\net\\issues\\3460";
string fileName = System.IO.Path.Combine(dir, "big.png");
// Example of use of separate operation progress event handlers for load/export operations
using (var image = Aspose.Imaging.Image.Load(fileName, new Aspose.Imaging.LoadOptions { ProgressEventHandler = ProgressCallback }))
{
image.Save(fileName + ".psd",
new Aspose.Imaging.ImageOptions.PsdOptions() { ProgressEventHandler = ExportProgressCallback });
}
}
private void ProgressCallback(Aspose.Imaging.ProgressManagement.ProgressEventHandlerInfo info)
{
System.Console.WriteLine("{0} : {1}/{2}", info.EventType, info.Value, info.MaxValue);
}
private void ExportProgressCallback(Aspose.Imaging.ProgressManagement.ProgressEventHandlerInfo info)
{
System.Console.WriteLine("Export event {0} : {1}/{2}", info.EventType, info.Value, info.MaxValue);
}
// The STDOUT log may look like this:
//Initialization : 1/4
//PreProcessing : 2/4
//Processing : 3/4
//Finalization : 4/4
//Export event Initialization : 1/4
//Export event PreProcessing : 2/4
//Export event Processing : 3/4
//Export event RelativeProgress : 1/1
//RelativeProgress : 1/1
//Export event Finalization : 4/4
UseIccProfileConversion
Nhận hoặc đặt một giá trị cho thấy liệu chuyển đổi hồ sơ ICC có nên được áp dụng hay không.
[Obsolete("ICC profile conversion will be used by default and this property will be removed.")]
public bool UseIccProfileConversion { get; set; }
Giá trị bất động sản
Methods
AddCustomFontSource(CustomFontSource, đối tượng params[])
Thêm nguồn font tùy chỉnh để cung cấp các font cụ thể cho hình ảnh.
public void AddCustomFontSource(CustomFontSource source, params object[] args)
Parameters
source
CustomFontSource
Tính năng cung cấp nguồn phông chữ tùy chỉnh.
args
object
[ ]
Các Arguments .