Defines an annotation redaction object.
Object Model
Syntax
XAML Object Element Usage | |
---|
<AnnRedactionObject .../> |
XAML Object Element Usage | |
---|
<AnnRedactionObject .../> |
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 BitmapSourceViewer, ByVal container As AnnContainer)
Dim redaction As AnnRedactionObject = New AnnRedactionObject()
redaction.Left = 100
redaction.Top = 100
redaction.Width = 300
redaction.Height = 300
container.Children.Add(redaction)
MessageBox.Show(String.Format("Added. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))
redaction.Realize(viewer)
MessageBox.Show(String.Format("Realized. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))
container.Children.Remove(redaction)
MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Children.Count))
container.Children.Add(redaction)
MessageBox.Show(String.Format("Added back. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))
redaction.Restore(viewer)
MessageBox.Show(String.Format("Restored. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Children.Count))
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(BitmapSourceViewer viewer, AnnContainer container) { AnnRedactionObject redaction = new AnnRedactionObject(); redaction.Left = 100; redaction.Top = 100; redaction.Width = 300; redaction.Height = 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)); } |
Remarks
Inheritance Hierarchy
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family
See Also