Class PngLoadOptions
Le nom : Aspose.Imaging.ImageLoadOptions Assemblée: Aspose.Imaging.dll (25.4.0)
Le opzioni di carico 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
I membri ereditari
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
Obtenez ou définissez une valeur indiquant si [modus strict].
[Obsolete("This redundant property should be replaced with an expression: \"LoadOptions.DataRecoveryMode == DataRecoveryMode.ConsistentRecover\".")]
public bool StrictMode { get; set; }
Valore di proprietà
Examples
L’exemple ci-dessous montre comment lire le fichier PNG dans un mode strict. le mode rigoureux permet de trouver des problèmes potentiels dans les images PONG, par exemple, les blocs de données non reconnus, la fin inattendue du dossier. De tels fichiers peuvent toujours être ouverts en mode par défaut (non stricte) par Aspose.Imaging et par les spectateurs courants aussi. Cependant, toute tentative de les ouvrir dans l’image strikte cause une exception correspondante.
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());
}