Class ContentAwareFillWatermarkOptions

Class ContentAwareFillWatermarkOptions

Nome do espaço: Aspose.Imaging.Watermark.Options Assembleia: Aspose.Imaging.dll (25.4.0)

O Conteúdo Comum Conheça as Opções de Algoritmo.

public class ContentAwareFillWatermarkOptions : WatermarkOptions

Inheritance

object WatermarkOptions ContentAwareFillWatermarkOptions

Membros herdados

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

O exemplo mostra como remover qualquer objeto da imagem usando o Graphics Path com o algoritmo de preenchimento Conteúdo Conhecido.

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[])

Inicia uma nova instância da classe Aspose.Imaging.Watermark.Options.ContentAwareFillWatermarkOptions.

public ContentAwareFillWatermarkOptions(Point[] mask)

Parameters

mask Point [ ]

A máscara para a área desconhecida.

ContentAwareFillWatermarkOptions(GraphicsPath)

Inicia uma nova instância da classe Aspose.Imaging.Watermark.Options.ContentAwareFillWatermarkOptions.

public ContentAwareFillWatermarkOptions(GraphicsPath mask)

Parameters

mask GraphicsPath

A máscara para a área desconhecida.

Properties

InterestArea

Recebe ou coloca a área para tomar patches.

public Rectangle InterestArea { get; set; }

Valor da propriedade

Rectangle

MaxPaintingAttempts

Obter ou definir o número máximo de tentativas de pintura.O algoritmo escolherá a melhor variante.

public int MaxPaintingAttempts { get; set; }

Valor da propriedade

int

Examples

O exemplo mostra como remover qualquer objeto da imagem usando o Graphics Path com o algoritmo de preenchimento Conteúdo Conhecido.

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

Obter ou definir o tamanho do patch (deve ser estranho).

public byte PatchSize { get; set; }

Valor da propriedade

byte

 Português