Class ContentAwareFillWatermarkOptions
Nom dels espais: Aspose.Imaging.Watermark.Options Assemblea: Aspose.Imaging.dll (25.4.0)
El contingut comú Aware complir les opcions d’algoritme.
public class ContentAwareFillWatermarkOptions : WatermarkOptions
Inheritance
object ← WatermarkOptions ← ContentAwareFillWatermarkOptions
Membres heretats
WatermarkOptions.Mask , WatermarkOptions.PrecalculationProgressEventHandler , WatermarkOptions.GraphicsPathMask , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
L’exemple mostra com eliminar qualsevol objecte de la imatge utilitzant Path de gràfics amb l’algoritme de recull de contingut conscient.
var imageFilePath = "ball.png";
using (var image = Image.Load(imageFilePath))
{
var pngImage = (PngImage)image;
var mask = new GraphicsPath();
var firstFigure = new Figure();
firstFigure.AddShape(new EllipseShape(new RectangleF(350, 170, 570 - 350, 400 - 170)));
mask.AddFigure(firstFigure);
var options = new ContentAwareFillWatermarkOptions(mask)
{
MaxPaintingAttempts = 4
};
var result = WatermarkRemover.PaintOver(pngImage, options);
result.Save(outputPath);
}
Constructors
ContentAwareFillWatermarkOptions(Point[])
Inicialitza una nova instància de la classe Aspose.Imaging.Watermark.Options.ContentAwareFillWtermarkOpcions.
public ContentAwareFillWatermarkOptions(Point[] mask)
Parameters
mask
Point
[]
La màscara per a la zona desconeguda.
ContentAwareFillWatermarkOptions(GraphicsPath)
Inicialitza una nova instància de la classe Aspose.Imaging.Watermark.Options.ContentAwareFillWtermarkOpcions.
public ContentAwareFillWatermarkOptions(GraphicsPath mask)
Parameters
mask
GraphicsPath
La màscara per a la zona desconeguda.
Properties
InterestArea
Obté o posa l’àrea per prendre patxes.
public Rectangle InterestArea { get; set; }
Valor de la propietat
MaxPaintingAttempts
Obté o fixa el nombre màxim d’intents de pintura.L’algoritme escollirà la millor variant.
public int MaxPaintingAttempts { get; set; }
Valor de la propietat
Examples
L’exemple mostra com eliminar qualsevol objecte de la imatge utilitzant Path de gràfics amb l’algoritme de recull de contingut conscient.
var imageFilePath = "ball.png";
using (var image = Image.Load(imageFilePath))
{
var pngImage = (PngImage)image;
var mask = new GraphicsPath();
var firstFigure = new Figure();
firstFigure.AddShape(new EllipseShape(new RectangleF(350, 170, 570 - 350, 400 - 170)));
mask.AddFigure(firstFigure);
var options = new ContentAwareFillWatermarkOptions(mask)
{
MaxPaintingAttempts = 4
};
var result = WatermarkRemover.PaintOver(pngImage, options);
result.Save(outputPath);
}
PatchSize
Obtenir o establir la mida de patx (ha de ser estrany).
public byte PatchSize { get; set; }