←Select platform

AnnRedactionObject Class

Summary

Defines an annotation redaction object.

Syntax

C#
VB
C++
[SerializableAttribute()] 
public class AnnRedactionObject : AnnRectangleObject 
  
<SerializableAttribute()> 
Public Class AnnRedactionObject  
   Inherits Leadtools.Annotations.AnnRectangleObject 
   Implements System.ICloneable, System.IDisposable, System.Runtime.Serialization.ISerializable  
[SerializableAttribute()] 
public ref class AnnRedactionObject : public Leadtools.Annotations.AnnRectangleObject, System.ICloneable, System.IDisposable, System.Runtime.Serialization.ISerializable   

Remarks

The redaction annotation object is a rectangle with default properties that are appropriate for blacking out an area. The Realize(rasterimageviewer) method lets you block the area on the image with the current object brush value. The Restore(rasterimageviewer) method lets you restore the area back. For more information about the redaction annotation object refer to AnnRedactionObject (Deprecated). For more information about the automated redaction annotation object, refer to Annotation Objects - Automated Features (Deprecated).

If you are interested in locking an object, refer to Implementing Annotation Security. (Deprecated)

Example

This example creates a new redaction object, and then addes it to the container.

C#
VB
using Leadtools; 
using Leadtools.Annotations; 
using Leadtools.Codecs; 
using Leadtools.WinForms; 
 
private void AnnRedactionObject_AnnRedactionObject(RasterImageViewer viewer, AnnContainer container) 
{ 
   AnnRedactionObject redaction = new AnnRedactionObject(); 
   redaction.Bounds = new AnnRectangle(100, 100, 300, 300, AnnUnit.Pixel); 
   container.Objects.Add(redaction); 
 
   viewer.Invalidate(redaction.InvalidRectangle); 
   MessageBox.Show(String.Format("Added. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Objects.Count)); 
 
   // realize the redaction object 
   redaction.Realize(viewer); 
 
   viewer.Invalidate(redaction.InvalidRectangle); 
   MessageBox.Show(String.Format("Realized. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Objects.Count)); 
 
   // remove the redaction object from the container 
   container.Objects.Remove(redaction); 
   viewer.Invalidate(); 
   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Objects.Count)); 
 
   // add the redaction object back 
   container.Objects.Add(redaction); 
   viewer.Invalidate(redaction.InvalidRectangle); 
   MessageBox.Show(String.Format("Added back. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Objects.Count)); 
 
   // restore the redaction object 
   redaction.Restore(viewer); 
   viewer.Invalidate(redaction.InvalidRectangle); 
   MessageBox.Show(String.Format("Restored. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Objects.Count)); 
 
   // remove the redaction again from the container 
   container.Objects.Remove(redaction); 
   viewer.Invalidate(); 
   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Objects.Count)); 
} 
Imports Leadtools 
Imports Leadtools.Annotations 
Imports Leadtools.Codecs 
Imports Leadtools.WinForms 
 
Private Sub AnnRedactionObject_AnnRedactionObject(ByVal viewer As RasterImageViewer, ByVal container As AnnContainer) 
   Dim redaction As AnnRedactionObject = New AnnRedactionObject() 
   redaction.Bounds = New AnnRectangle(100, 100, 300, 300, AnnUnit.Pixel) 
   container.Objects.Add(redaction) 
 
   viewer.Invalidate(redaction.InvalidRectangle) 
   MessageBox.Show(String.Format("Added. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Objects.Count)) 
 
   ' realize the redaction object 
   redaction.Realize(viewer) 
 
   viewer.Invalidate(redaction.InvalidRectangle) 
   MessageBox.Show(String.Format("Realized. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Objects.Count)) 
 
   ' remove the redaction object from the container 
   container.Objects.Remove(redaction) 
   viewer.Invalidate() 
   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Objects.Count)) 
 
   ' add the redaction object back 
   container.Objects.Add(redaction) 
   viewer.Invalidate(redaction.InvalidRectangle) 
   MessageBox.Show(String.Format("Added back. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Objects.Count)) 
 
   ' restore the redaction object 
   redaction.Restore(viewer) 
   viewer.Invalidate(redaction.InvalidRectangle) 
   MessageBox.Show(String.Format("Restored. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Objects.Count)) 
 
   ' remove the redaction again from the container 
   container.Objects.Remove(redaction) 
   viewer.Invalidate() 
   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Objects.Count)) 
End Sub 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations Assembly