Occurs during drawing after the objects are drawn.
public event EventHandler<AnnPaintEventArgs> AfterDrawingObjects
Public Event AfterDrawingObjects As EventHandler(Of AnnPaintEventArgs)
public:
event EventHandler<AnnPaintEventArgs^>^ AfterDrawingObjects
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.
Property | Description |
---|---|
Graphics | Gets the graphics used to paint. |
You can prevent the AnnContainer from raising this event by calling DisableDrawObjectEvents. You can re-enable the raising of this event by calling EnableDrawObjectEvents.
This example will draw a hatch brush on top of every object in the container.
using Leadtools;
using Leadtools.Annotations;
using Leadtools.Codecs;
using Leadtools.WinForms;
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());
}
}
Imports Leadtools
Imports Leadtools.Annotations
Imports Leadtools.Codecs
Imports Leadtools.WinForms
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
Products |
Support |
Feedback: AfterDrawingObjects Event - Leadtools.Annotations |
Introduction |
Help Version 19.0.2017.6.20
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.