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

RealizeAllRedactions Method

Example 





Realizes all the AnnRedactionObject objects in this AnnAutomation.
Syntax
public virtual void RealizeAllRedactions()
'Declaration
 
Public Overridable Sub RealizeAllRedactions() 
'Usage
 
Dim instance As AnnAutomation
 
instance.RealizeAllRedactions()
public virtual void RealizeAllRedactions()
 function Leadtools.Annotations.AnnAutomation.RealizeAllRedactions()
public:
virtual void RealizeAllRedactions(); 
Remarks

Use the CanRealizeAllRedactions property to determine whether you can currently call this method.

This method will call the AnnRedactionObject.Realize(RasterImageViewer) method for all AnnRedactionObject objects that have the AnnRedactionObject.IsRealized value set to false.

Example
 
Public Sub AnnAutomation_RealizeAllRedactions(ByVal automation As AnnAutomation)
   ' remove all objects from this automation
   automation.SelectAll()
   automation.Delete()
   ' see if we can realize or restore all the redaction objects (this should show a message informing you there are no redaction objects in this automation)
   RealizeRestoreAllRedactions(automation)

   ' first add a couple of new redaction object to the automation
   Dim redaction As AnnRedactionObject = New AnnRedactionObject()
   redaction.Bounds = New AnnRectangle(100, 100, 100, 100, AnnUnit.Pixel)
   automation.Container.Objects.Add(redaction)
   automation.Viewer.Invalidate(redaction.InvalidRectangle)

   redaction = New AnnRedactionObject()
   redaction.Bounds = New AnnRectangle(300, 300, 100, 100, AnnUnit.Pixel)
   automation.Container.Objects.Add(redaction)
   automation.Viewer.Invalidate(redaction.InvalidRectangle)

   ' see if we can realize/restore the objects (should realize the redactions)
   RealizeRestoreAllRedactions(automation)

   ' see if we can realize/restore the objects (should restore the redactions)
   RealizeRestoreAllRedactions(automation)
End Sub

Private Sub RealizeRestoreAllRedactions(ByVal automation As AnnAutomation)
   If automation.CanRealizeAllRedactions Then
      ' realize
      automation.RealizeAllRedactions()
      MessageBox.Show("Redaction objects have been realized")
   ElseIf automation.CanRestoreAllRedactions Then
      ' restore
      automation.RestoreAllRedactions()
      MessageBox.Show("Redaction objects have been restored")
   Else
      MessageBox.Show("Cannot realize or restore because no redaction object is currently in this automation")
   End If
End Sub
public void AnnAutomation_RealizeAllRedactions(AnnAutomation automation)
{
   // remove all objects from this automation
   automation.SelectAll();
   automation.Delete();
   // see if we can realize or restore all the redaction objects (this should show a message informing you there are no redaction objects in this automation)
   RealizeRestoreAllRedactions(automation);

   // first add a couple of new redaction object to the automation
   AnnRedactionObject redaction = new AnnRedactionObject();
   redaction.Bounds = new AnnRectangle(100, 100, 100, 100, AnnUnit.Pixel);
   automation.Container.Objects.Add(redaction);
   automation.Viewer.Invalidate(redaction.InvalidRectangle);

   redaction = new AnnRedactionObject();
   redaction.Bounds = new AnnRectangle(300, 300, 100, 100, AnnUnit.Pixel);
   automation.Container.Objects.Add(redaction);
   automation.Viewer.Invalidate(redaction.InvalidRectangle);

   // see if we can realize/restore the objects (should realize the redactions)
   RealizeRestoreAllRedactions(automation);

   // see if we can realize/restore the objects (should restore the redactions)
   RealizeRestoreAllRedactions(automation);
}

private void RealizeRestoreAllRedactions(AnnAutomation automation)
{
   if(automation.CanRealizeAllRedactions)
   {
      // realize
      automation.RealizeAllRedactions();
      MessageBox.Show("Redaction objects have been realized");
   }
   else if(automation.CanRestoreAllRedactions)
   {
      // restore
      automation.RestoreAllRedactions();
      MessageBox.Show("Redaction objects have been restored");
   }
   else
      MessageBox.Show("Cannot realize or restore because no redaction object is currently in this automation");
}
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

AnnAutomation Class
AnnAutomation Members

 

 


Products | Support | Contact Us | Copyright Notices

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