LEADTOOLS Annotations (Leadtools.Annotations assembly)
LEAD Technologies, Inc

AnnRedactionObject Class

Example 





Members 
Defines an annotation redaction object.
Object Model
AnnRedactionObject ClassAnnRectangle StructureAnnRectangle StructureAnnBrush ClassAnnContainer ClassAnnFont ClassAnnGroupObject ClassAnnFont ClassAnnPoint StructureAnnPoint StructureAnnPen ClassAnnPoint StructureAnnPoint StructureAnnUnitConverter Class
Syntax
'Declaration
 
<SerializableAttribute()>
Public Class AnnRedactionObject 
   Inherits AnnRectangleObject
   Implements System.ICloneableSystem.IDisposableSystem.Runtime.Serialization.ISerializable 
'Usage
 
Dim instance As AnnRedactionObject
function Leadtools.Annotations.AnnRedactionObject()
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. 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.

Example
 
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
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));
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnRedactionObject Members
Leadtools.Annotations Namespace

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.