Class ContentAwareFillWatermarkOptions

Class ContentAwareFillWatermarkOptions

Namespace: Aspose.Imaging.Watermark.Options
Assembly: Aspose.Imaging.dll (25.2.0)

The common Content Aware Fill Algorithm options.

public class ContentAwareFillWatermarkOptions : WatermarkOptions

Inheritance

objectWatermarkOptionsContentAwareFillWatermarkOptions

Inherited Members

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

The example shows how to remove any object from the image using Graphics Path with Content Aware fill algorithm.```csharp [C#]

                                                                                                                       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

### <a id="Aspose_Imaging_Watermark_Options_ContentAwareFillWatermarkOptions__ctor_Aspose_Imaging_Point___"></a> ContentAwareFillWatermarkOptions\(Point\[\]\)

Initializes a new instance of the Aspose.Imaging.Watermark.Options.ContentAwareFillWatermarkOptions class.

```csharp
public ContentAwareFillWatermarkOptions(Point[] mask)

Parameters

mask Point[]

The mask for the unknown area.

ContentAwareFillWatermarkOptions(GraphicsPath)

Initializes a new instance of the Aspose.Imaging.Watermark.Options.ContentAwareFillWatermarkOptions class.

public ContentAwareFillWatermarkOptions(GraphicsPath mask)

Parameters

mask GraphicsPath

The mask for the unknown area.

Properties

InterestArea

Gets or sets the area to take patches.

public Rectangle InterestArea { get; set; }

Property Value

Rectangle

MaxPaintingAttempts

Gets or sets the maximum number of painting attempts. The algorithm will chose the best variant.

public int MaxPaintingAttempts { get; set; }

Property Value

int

Examples

The example shows how to remove any object from the image using Graphics Path with Content Aware fill algorithm.```csharp [C#]

                                                                                                                       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);
                                                                                                                       }

### <a id="Aspose_Imaging_Watermark_Options_ContentAwareFillWatermarkOptions_PatchSize"></a> PatchSize

Gets or sets the patch size (should be odd).

```csharp
public byte PatchSize { get; set; }

Property Value

byte