RegionReplacementOptions

RegionReplacementOptions class

Represents color and area parameters for image region replacement. See ImageAreaRedaction.

public class RegionReplacementOptions

Constructors

Name Description
RegionReplacementOptions(Color, Size) Initializes a new instance of RegionReplacementOptions class.
RegionReplacementOptions(Color, Font, string) Initializes a new instance of RegionReplacementOptions class which size matches given text.

Properties

Name Description
FillColor { get; set; } Gets or sets the color to fill the redacted area.
Size { get; set; } Gets or sets the rectangle with and height.

Remarks

Learn more

Examples

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

    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