Class WatermarkRemover

Class WatermarkRemover

Numele spaţiului: Aspose.Imaging.Watermark Asamblare: Aspose.Imaging.dll (25.4.0)

Clasa destinată manipulării marcajului de apă.

public static class WatermarkRemover

Inheritance

object WatermarkRemover

Membrii moștenitori

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

Exemplul arată cum să îndepărtați orice obiect din imagine folosind Graphics Path cu algoritmul Telea.

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 TeleaWatermarkOptions(mask);

                                                                                                                  var result = WatermarkRemover.PaintOver(pngImage, options);

                                                                                                                  result.Save(outputPath);
                                                                                                              }

Exemplul arată cum să îndepărtați orice obiect din imagine folosind Graphics Path cu Content Aware pentru a umple algoritmul.

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

Methods

PaintOver(RasterImage, Opțiuni de apă)

Îndepărtați marcajul de apă din imaginea rasterului.

public static RasterImage PaintOver(RasterImage source, WatermarkOptions options)

Parameters

source RasterImage

Sursă a imaginii raster.

options WatermarkOptions

Opţiunile de marcă a apei.

Returns

RasterImage

Imaginea rezultată.

 Română