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

AfterDrawingObjects Event

Example 





Occurs during drawing after the objects are drawn.
Syntax
public event EventHandler<AnnPaintEventArgs> AfterDrawingObjects
'Declaration
 
Public Event AfterDrawingObjects As EventHandler(Of AnnPaintEventArgs)
'Usage
 
Dim instance As AnnContainer
Dim handler As EventHandler(Of AnnPaintEventArgs)
 
AddHandler instance.AfterDrawingObjects, handler
public event EventHandler<AnnPaintEventArgs> AfterDrawingObjects
add_AfterDrawingObjects(function(sender, e))
remove_AfterDrawingObjects(function(sender, e))

public:
event EventHandler<AnnPaintEventArgs^>^ AfterDrawingObjects
Event Data

The event handler receives an argument of type AnnPaintEventArgs containing data related to this event. The following AnnPaintEventArgs properties provide information specific to this event.

PropertyDescription
Graphics Gets the graphics used to paint.
Remarks
You can prevent the AnnContainer from raising this event by calling DisableDrawObjectEvents. You can re-enable the raising of this event by calling EnableDrawObjectEvents.
Example
 
Public Sub AnnContainer_AfterDrawingObjects(ByVal container As AnnContainer)
   ' theContainer is set so that it can be accessed in the container_BeforeDrawingObjects event
   theContainer = container
   AddHandler container.AfterDrawingObjects, AddressOf container_AfterDrawingObjects
End Sub
Private Sub container_AfterDrawingObjects(ByVal sender As Object, ByVal e As AnnPaintEventArgs)
   Dim graphics As Graphics = e.Graphics

   ' set the current transform from the container
   graphics.MultiplyTransform(theContainer.Transform)

   Dim br As Brush = New HatchBrush(HatchStyle.DiagonalCross, Color.Black, Color.Transparent)
   Try
      ' enum the objects in the container
      For Each obj As AnnObject In theContainer.Objects
         graphics.FillRectangle(br, obj.BoundingRectangle.ConvertTo(theContainer.UnitConverter, AnnUnit.Pixel).ToRectangleF())
      Next obj
   Finally
      CType(br, IDisposable).Dispose()
   End Try
End Sub
public void AnnContainer_AfterDrawingObjects(AnnContainer container)
{
   // theContainer is set so that it can be accessed in the container_BeforeDrawingObjects event
   theContainer = container;
   container.AfterDrawingObjects += new EventHandler<AnnPaintEventArgs>(container_AfterDrawingObjects);
}
private void container_AfterDrawingObjects(object sender, AnnPaintEventArgs e)
{
   Graphics graphics = e.Graphics;

   // set the current transform from the container
   graphics.MultiplyTransform(theContainer.Transform);

   using(Brush br = new HatchBrush(HatchStyle.DiagonalCross, Color.Black, Color.Transparent))
   {
      // enum the objects in the container
      foreach(AnnObject obj in theContainer.Objects)
         graphics.FillRectangle(br, obj.BoundingRectangle.ConvertTo(theContainer.UnitConverter, AnnUnit.Pixel).ToRectangleF());
   }
}
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

AnnContainer Class
AnnContainer Members

 

 


Products | Support | Contact Us | Copyright Notices

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