public event EventHandler<AnnDrawDesignerEventArgs> Draw
Public Event Draw As EventHandler(Of AnnDrawDesignerEventArgs)
-(void) automation:(LTAnnAutomation*) automation
drawWithArgs:(LTAnnDrawDesignerEventArgs*) e;
public void addDrawDesignerdListener(AnnDrawDesignerListener listener)
public void removeDrawDesignerListener(AnnDrawDesignerListener listener)
public:
event EventHandler<AnnDrawDesignerEventArgs^>^ Draw
The event handler receives an argument of type AnnDrawDesignerEventArgs containing data related to this event. The following AnnDrawDesignerEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel | A value indicating whether the draw operation should be canceled. |
When an object is being drawn, the automation object will hook the object draw designer's AnnDrawDesigner.Draw to this event. Therefore, instead of hooking and unhooking to the various designers draw events, you can simply subscribe to this event once.
This example will show how to stop drawing new line objects.
Start with the AnnAutomationManager example, remove all the code inside the example function (search for the // TODO: add example code here comment) and insert the following code:
Click the example button then try to draw a line object.
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Engine;
using Leadtools.Codecs;
using Leadtools.Controls;
using Leadtools.Annotations.Rendering;
using Leadtools.Annotations.WinForms;
public void AnnAutomation_Draw()
{
// Hook to the automation's Draw event
_automation.Draw += _automation_Draw;
}
void _automation_Draw(object sender, AnnDrawDesignerEventArgs e)
{
// Check if we are drawing a line and we just started, if so, cancel it
if (_automation.Manager.CurrentObjectId == AnnObject.LineObjectId &&
e.OperationStatus == AnnDesignerOperationStatus.Start)
{
Debug.WriteLine("Canceling line...");
e.Cancel = true;
}
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
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.