Class ContentAwareFillWatermarkOptions

Class ContentAwareFillWatermarkOptions

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

Thông thường Content Aware Fill Algorithm tùy chọn.

public class ContentAwareFillWatermarkOptions : WatermarkOptions

Inheritance

object WatermarkOptions ContentAwareFillWatermarkOptions

Thành viên thừa kế

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

Ví dụ này cho thấy cách loại bỏ bất kỳ đối tượng nào từ hình ảnh bằng cách sử dụng Graphics Path với Content Aware fill algorithm.

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

Bắt đầu một trường hợp mới của lớp Aspose.Imaging.Watermark.Options.ContentAwareFillWtermarkOption.

public ContentAwareFillWatermarkOptions(Point[] mask)

Parameters

mask Point [ ]

Mặt nạ cho vùng không rõ

ContentAwareFillWatermarkOptions(GraphicsPath)

Bắt đầu một trường hợp mới của lớp Aspose.Imaging.Watermark.Options.ContentAwareFillWtermarkOption.

public ContentAwareFillWatermarkOptions(GraphicsPath mask)

Parameters

mask GraphicsPath

Mặt nạ cho vùng không rõ

Properties

InterestArea

Nhận hoặc đặt khu vực để lấy patches.

public Rectangle InterestArea { get; set; }

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

Rectangle

MaxPaintingAttempts

Nhận hoặc đặt số lượng tối đa các nỗ lực vẽ.Các thuật toán sẽ chọn biến thể tốt nhất.

public int MaxPaintingAttempts { get; set; }

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

int

Examples

Ví dụ này cho thấy cách loại bỏ bất kỳ đối tượng nào từ hình ảnh bằng cách sử dụng Graphics Path với Content Aware fill algorithm.

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

Nhận hoặc đặt kích cỡ patch (sẽ là kỳ lạ).

public byte PatchSize { get; set; }

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

byte

 Tiếng Việt