Class PngLoadOptions

Class PngLoadOptions

Tên không gian: Aspose.Imaging.ImageLoadOptions Tổng hợp: Aspose.Imaging.dll (25.4.0)

Các tùy chọn tải png.

[Obsolete("Should be replaced with base \"LoadOptions\" class because it contains ony one obsolete \"StrictMode\" property.")]
public class PngLoadOptions : LoadOptions

Inheritance

object LoadOptions PngLoadOptions

Thành viên thừa kế

LoadOptions.AddCustomFontSource(CustomFontSource, params object[]) , LoadOptions.DataRecoveryMode , LoadOptions.DataBackgroundColor , LoadOptions.UseIccProfileConversion , LoadOptions.BufferSizeHint , LoadOptions.ProgressEventHandler , LoadOptions.ConcurrentImageProcessing , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

PngLoadOptions()

public PngLoadOptions()

Properties

StrictMode

Nhận hoặc đặt một giá trị cho biết [một chế độ nghiêm ngặt].

[Obsolete("This redundant property should be replaced with an expression: \"LoadOptions.DataRecoveryMode == DataRecoveryMode.ConsistentRecover\".")]
public bool StrictMode { get; set; }

Giá trị bất động sản

bool

Examples

Ví dụ sau đây cho thấy làm thế nào để đọc tệp PNG trong chế độ nghiêm ngặt.Chuyển hình nghiêm khắc cho phép tìm thấy các vấn đề tiềm năng trong hình ảnh png, chẳng hạn như các khối dữ liệu không được công nhận, kết thúc không mong đợi của tập tin.Thông tin như vậy vẫn có thể được mở theo mặc định (không chặt chẽ) trạng thái bởi Aspose.Imaging và bởi người xem thông thường cũng.

string dir = "c:\\aspose.imaging\\issues\\net\\3635\\testdata\\3565";
                                                                                                                                                                                                                                                                                                                                                                                                        string inputFileName = System.IO.Path.Combine(dir, "FC5F1998104EB92469CB14070628073616BB28F9.png");
                                                                                                                                                                                                                                                                                                                                                                                                        string outputFileName = inputFileName + ".png";

                                                                                                                                                                                                                                                                                                                                                                                                        // Default mode (non-strict) - successul reading.
                                                                                                                                                                                                                                                                                                                                                                                                        using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFileName))
                                                                                                                                                                                                                                                                                                                                                                                                        {
                                                                                                                                                                                                                                                                                                                                                                                                            image.Save(outputFileName, new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                                                                                                                                                                                                                                                                                                                                        }

                                                                                                                                                                                                                                                                                                                                                                                                        // Strict mode - ImageLoadException : Unexpected end of file.
                                                                                                                                                                                                                                                                                                                                                                                                        using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFileName, new Aspose.Imaging.ImageLoadOptions.PngLoadOptions() { StrictMode = true }))
                                                                                                                                                                                                                                                                                                                                                                                                        {
                                                                                                                                                                                                                                                                                                                                                                                                            image.Save(outputFileName, new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                                                                                                                                                                                                                                                                                                                                        }
 Tiếng Việt