Leadtools.Annotations Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
AnnRedactionObject Class
See Also  Members   Example 
Leadtools.Annotations Namespace : AnnRedactionObject Class




Defines an annotation redaction object.

Object Model














Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class AnnRedactionObject 
   Inherits AnnRectangleObject
Visual Basic (Usage)Copy Code
Dim instance As AnnRedactionObject
C# 
[SerializableAttribute()]
public class AnnRedactionObject : AnnRectangleObject 
Managed Extensions for C++ 
[SerializableAttribute()]
public __gc class AnnRedactionObject : public AnnRectangleObject 
C++/CLI 
[SerializableAttribute()]
public ref class AnnRedactionObject : public AnnRectangleObject 

Example

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

Visual BasicCopy Code
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
C#Copy Code
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)); 
}

Remarks

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

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

Inheritance Hierarchy

System.Object
   Leadtools.Annotations.AnnDrawable
      Leadtools.Annotations.AnnObject
         Leadtools.Annotations.AnnRectangleObject
            Leadtools.Annotations.AnnRedactionObject

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Annotations requires a Document or Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features