AnnFreehandHotspotObject Class (original) (raw)
Summary
Defines an annotation freehand hot spot object.
Syntax
C#
Objective-C
C++/CLI
Java
Python
@interface LTAnnFreehandHotspotObject : LTAnnPolylineObject<NSCoding, NSCopying>
public class AnnFreehandHotspotObject extends AnnPolylineObject
class AnnFreehandHotspotObject(AnnPolylineObject):
Example
This example creates a freehand hotspot object and adds it to the automation container.
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Engine;
using Leadtools.Codecs;
using Leadtools.Annotations;
using Leadtools.Annotations.WinForms;
public void AnnCore_AnnFreehandHotspotObject()
{
// assumes _automation is valid
// Create a new instance of AnnResources if the container does not already have one
AnnResources resources = _automation.Manager.Resources;
if (resources == null)
{
resources = new AnnResources();
}
// Get the images collection
IList<AnnPicture> imagesResources = resources.Images;
// Add our picture to it
imagesResources.Add(new AnnPicture(@"ms-appx:///Assets/Hotspot.png"));
int pictureIndex = imagesResources.Count - 1;
double inch = 720.0;
// Add a freehand hotspot object
AnnFreehandHotspotObject hotspotObj = new AnnFreehandHotspotObject();
// Set the points for the freehand hotspot
hotspotObj.Points.Add(LeadPointD.Create(1 * inch, 1 * inch));
hotspotObj.Points.Add(LeadPointD.Create(2 * inch, 2 * inch));
hotspotObj.Points.Add(LeadPointD.Create(1 * inch, 5 * inch));
hotspotObj.Points.Add(LeadPointD.Create(5 * inch, 5 * inch));
hotspotObj.Points.Add(LeadPointD.Create(4 * inch, 2 * inch));
hotspotObj.Points.Add(LeadPointD.Create(5 * inch, 1 * inch));
// Set the picture
hotspotObj.DefaultPicture = pictureIndex;
// Set the hyperlink
hotspotObj.Hyperlink = "https://www.leadtools.com";
// Add the object to the automation container
_automation.Container.Children.Add(hotspotObj);
}