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
Syntax
Example
This example creates a new redaction object, and then addes it to the container.
Visual Basic | Copy 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));
} |
SilverlightCSharp | 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));
} |
SilverlightVB | Copy 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
Inheritance Hierarchy
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