ImageAreaRedaction Class
Represents a redaction that places colored rectangle in given area of an image document.
Inheritance Hierarchy
SystemObject
  GroupDocs.RedactionRedaction
    GroupDocs.Redaction.RedactionsImageAreaRedaction

Namespace: GroupDocs.Redaction.Redactions
Assembly: GroupDocs.Redaction (in GroupDocs.Redaction.dll) Version: 20.11
Syntax
public class ImageAreaRedaction : Redaction

The ImageAreaRedaction type exposes the following members.

Constructors
  NameDescription
Public methodImageAreaRedaction
Initializes a new instance of ImageAreaRedaction class for redacting specific area size.
Properties
  NameDescription
Public propertyDescription
Returns a string, describing the redaction and its parameters.
(Overrides RedactionDescription.)
Public propertyOptions
Gets the RegionReplacementOptions options with color and area parameters.
Public propertyTopLeft
Gets the top-left position of the area to remove
Methods
  NameDescription
Public methodApplyTo
Applies the redaction to a given format instance.
(Overrides RedactionApplyTo(DocumentFormatInstance).)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks
Learn more
Examples

The following example demonstrates replacing an area within the image with a solid color rectangle.

C#
using (Redactor redactor = new Redactor("D:\\test.jpg"))
{
   System.Drawing.Point samplePoint = new System.Drawing.Point(516, 311);
   System.Drawing.Size sampleSize = new System.Drawing.Size(170, 35);
   RedactorChangeLog result = redactor.Apply(new ImageAreaRedaction(samplePoint,
                 new RegionReplacementOptions(System.Drawing.Color.Blue, sampleSize)));
   if (result.Status != RedactionStatus.Failed)
   {
      redactor.Save();
   };
}
See Also