Defines an annotation redaction object.
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 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))
redaction.Realize(viewer)
viewer.Invalidate(redaction.InvalidRectangle)
MessageBox.Show(String.Format("Realized. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Objects.Count))
container.Objects.Remove(redaction)
viewer.Invalidate()
MessageBox.Show(String.Format("Removed. Objects in container: {0}", container.Objects.Count))
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))
redaction.Restore(viewer)
viewer.Invalidate(redaction.InvalidRectangle)
MessageBox.Show(String.Format("Restored. IsRealized: {0}, Objects in container: {1}", redaction.IsRealized, container.Objects.Count))
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
Inheritance Hierarchy
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also