LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.31
AnnRedactionObject Class
See Also  Members  
Leadtools.Windows.Annotations Namespace : AnnRedactionObject Class



The AnnRedactionObject Class supports WPF/Silverlight.

The AnnRedactionObject Class is available in LEADTOOLS Document and Medical Imaging toolkits.

Defines an annotation redaction object. Supported in Silverlight, Windows Phone 7

Object Model

AnnRedactionObject Class

Syntax

Visual Basic (Declaration) 
Public Class AnnRedactionObject 
   Inherits AnnRectangleObject
   Implements IAnnHeaderIAnnObjectIAnnRectangle 
Visual Basic (Usage)Copy Code
Dim instance As AnnRedactionObject
C# 
public class AnnRedactionObject : AnnRectangleObject, IAnnHeaderIAnnObjectIAnnRectangle  
C++/CLI 
public ref class AnnRedactionObject : public AnnRectangleObject, IAnnHeaderIAnnObjectIAnnRectangle  

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 ImageViewer, ByVal container As AnnContainer)
   Dim redaction As AnnRedactionObject = New AnnRedactionObject()
   redaction.Rect = New Rect(100, 100, 300, 300)
   container.Children.Add(redaction)
   MessageBox.Show(String.Format("Added. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))

   ' realize the redaction object
   redaction.Realize(viewer)

   MessageBox.Show(String.Format("Realized. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))

   ' remove the redaction object from the container
   container.Children.Remove(redaction)

   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Children.Count))

   ' add the redaction object back
   container.Children.Add(redaction)

   MessageBox.Show(String.Format("Added back. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))

   ' restore the redaction object
   redaction.Restore(viewer)

   MessageBox.Show(String.Format("Restored. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))

   ' remove the redaction again from the container
   container.Children.Remove(redaction)

   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Children.Count))
End Sub
C#Copy Code
private void AnnRedactionObject_AnnRedactionObject(ImageViewer viewer, AnnContainer container)
{
   AnnRedactionObject redaction = new AnnRedactionObject();
   redaction.Rect = new Rect(100, 100, 300, 300);
   container.Children.Add(redaction);
   MessageBox.Show(String.Format("Added. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count));

   // realize the redaction object
   redaction.Realize(viewer);

   MessageBox.Show(String.Format("Realized. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count));

   // remove the redaction object from the container
   container.Children.Remove(redaction);

   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Children.Count));

   // add the redaction object back
   container.Children.Add(redaction);

   MessageBox.Show(String.Format("Added back. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count));

   // restore the redaction object
   redaction.Restore(viewer);

   MessageBox.Show(String.Format("Restored. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count));

   // remove the redaction again from the container
   container.Children.Remove(redaction);

   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Children.Count));
}
SilverlightCSharpCopy Code
private void AnnRedactionObject_AnnRedactionObject(ImageViewer viewer, AnnContainer container)
{
   AnnRedactionObject redaction = new AnnRedactionObject();
   redaction.Rect = new Rect(100, 100, 300, 300);
   container.Children.Add(redaction);
   MessageBox.Show(String.Format("Added. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count));

   // realize the redaction object
   redaction.Realize(viewer);

   MessageBox.Show(String.Format("Realized. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count));

   // remove the redaction object from the container
   container.Children.Remove(redaction);

   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Children.Count));

   // add the redaction object back
   container.Children.Add(redaction);

   MessageBox.Show(String.Format("Added back. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count));

   // restore the redaction object
   redaction.Restore(viewer);

   MessageBox.Show(String.Format("Restored. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count));

   // remove the redaction again from the container
   container.Children.Remove(redaction);

   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Children.Count));
}
SilverlightVBCopy Code
Private Sub AnnRedactionObject_AnnRedactionObject(ByVal viewer As ImageViewer, ByVal container As AnnContainer)
   Dim redaction As AnnRedactionObject = New AnnRedactionObject()
   redaction.Rect = New Rect(100, 100, 300, 300)
   container.Children.Add(redaction)
   MessageBox.Show(String.Format("Added. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))

   ' realize the redaction object
   redaction.Realize(viewer)

   MessageBox.Show(String.Format("Realized. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))

   ' remove the redaction object from the container
   container.Children.Remove(redaction)

   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Children.Count))

   ' add the redaction object back
   container.Children.Add(redaction)

   MessageBox.Show(String.Format("Added back. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))

   ' restore the redaction object
   redaction.Restore(viewer)

   MessageBox.Show(String.Format("Restored. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))

   ' remove the redaction again from the container
   container.Children.Remove(redaction)

   MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Children.Count))
End Sub

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 WPF. For more information about the automated redaction annotation object, refer to WPF Annotation Objects - Automated Features.

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

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         Leadtools.Windows.Annotations.AnnObject
            Leadtools.Windows.Annotations.AnnRectangleObject
               Leadtools.Windows.Annotations.AnnRedactionObject

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also

AnnRedactionObject requires a Document/Medical product license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features and Unlocking Special LEAD Features.