ImageAreaRedaction
Leave feedback
On this page
Represents a redaction that places colored rectangle in given area of an image document.
public class ImageAreaRedaction : Redaction
| Name | Description |
|---|---|
| ImageAreaRedaction(Point, RegionReplacementOptions) | Initializes a new instance of ImageAreaRedaction class for redacting specific area size. |
| Name | Description |
|---|---|
| override Description { get; } | Returns a string, describing the redaction and its parameters. |
| Options { get; } | Gets the RegionReplacementOptions options with color and area parameters. |
| TopLeft { get; } | Gets the top-left position of the area to remove |
| Name | Description |
|---|---|
| override ApplyTo(DocumentFormatInstance) | Applies the redaction to a given format instance. |
Learn more
- More details about applying redactions: Redaction basics
- More details about image redactions: Image redactions
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();
};
}
- class Redaction
- namespace GroupDocs.Redaction.Redactions
- assembly GroupDocs.Redaction
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.