AnnHotspotObject Object

Summary

Defines an annotation hot spot object.

Syntax
TypeScript
JavaScript
function lt.Annotations.Engine.AnnHotspotObject 
	extends lt.Annotations.Engine.AnnImageObject 
	implements IAnnObjectCloneable 
class lt.Annotations.Engine.AnnHotspotObject() 
	extends AnnImageObject 
	implements IAnnObjectCloneable 

Remarks

The AnnHotspotObject object is designed to work as a scaled picture drawn inside a rectangle. The AnnHotspotObject object will draw the picture if the owner container is in design mode. If the container is in run mode, the AnnHotspotObject object will not draw the picture.

With the automated functions, in design mode, the rectangle contains a scaled image. The user clicks / taps and drags to specify the rectangle in the current window. In run mode, the object is transparent, but the mouse pointer changes to a hand when it is over the object.

Programmatically, the boundaries and location of the hotspot object can be controlled using the following properties: Each object can be transformed with the following methods: The AnnHotspotObject class inherits a number of properties from the AnnObject class, providing support for font, stroke and fill characteristics. These properties are listed below: The name of the hotspot object can be controlled using Labels property, inherited from the AnnObject class. An object can be part of a group annotation object or part of a container object. It cannot be part of both a group and a container at the same time. The following properties can also be used to programmatically set characteristics of an AnnHotspotObject:

Example

This example creates a hotspot object and adds it to the automation container.

TypeScript
JavaScript
// assumes _automation is valid 
// Create a new instance of AnnResources if the automation manager does not already have one 
var resources = this._automation.get_manager().get_resources(); 
if (resources == null) { 
   resources = new lt.Annotations.Engine.AnnResources(); 
   this._automation.get_manager().set_resources(resources); 
} 
// Get the images collection 
var imagesResources = resources.get_images(); 
// Add our picture to it 
imagesResources.add(new lt.Annotations.Engine.AnnPicture("Resources/Objects/Hotspot.png")); 
var pictureIndex = imagesResources.length - 1; 
 
var inch = 720.0; 
// Add a hotspot object 
var hotspotObj = new lt.Annotations.Engine.AnnHotspotObject(); 
// Set the points for the hotspot 
hotspotObj.get_points().add(lt.LeadPointD.create(1 * inch, 1 * inch)); 
hotspotObj.get_points().add(lt.LeadPointD.create(2 * inch, 1 * inch)); 
hotspotObj.get_points().add(lt.LeadPointD.create(2 * inch, 2 * inch)); 
hotspotObj.get_points().add(lt.LeadPointD.create(1 * inch, 2 * inch)); 
// Set the picture 
hotspotObj.set_defaultPicture(pictureIndex); 
// Add the object to the automation container 
this._automation.get_container().get_children().add(hotspotObj); 
// Select the object 
this._automation.selectObject(hotspotObj); 
 
// Hook to rendering engine loadPicture event to render the container immediately after resources get loaded 
var automation = this._automation; 
automation.get_manager().renderingEngine.add_loadPicture(function(sender, e) { 
  automation.invalidate(lt.LeadRectD.empty); 
 }); 
// assumes _automation is valid 
// Create a new instance of AnnResources if the automation manager does not already have one 
let resources: lt.Annotations.Engine.AnnResources = this._automation.manager.resources; 
if (resources == null) { 
   resources = new lt.Annotations.Engine.AnnResources(); 
   this._automation.manager.resources = resources; 
} 
// Get the images collection 
const imagesResources: lt.Annotations.Engine.AnnPicture[] = resources.images; 
// Add our picture to it 
imagesResources.push(new lt.Annotations.Engine.AnnPicture("Resources/Objects/Hotspot.png")); 
const pictureIndex: number = imagesResources.length - 1; 
 
const inch: number = 720.0; 
// Add a hotspot object 
const hotspotObj: lt.Annotations.Engine.AnnHotspotObject = new lt.Annotations.Engine.AnnHotspotObject(); 
// Set the points for the hotspot 
hotspotObj.points.add(lt.LeadPointD.create(1 * inch, 1 * inch)); 
hotspotObj.points.add(lt.LeadPointD.create(2 * inch, 1 * inch)); 
hotspotObj.points.add(lt.LeadPointD.create(2 * inch, 2 * inch)); 
hotspotObj.points.add(lt.LeadPointD.create(1 * inch, 2 * inch)); 
// Set the picture 
hotspotObj.defaultPicture = pictureIndex; 
// Add the object to the automation container 
this._automation.container.children.add(hotspotObj); 
// Select the object 
this._automation.selectObject(hotspotObj); 
 
// Hook to rendering engine loadPicture event to render the container immediately after resources get loaded 
const automation: lt.Annotations.Automation.AnnAutomation = this._automation; 
automation.manager.renderingEngine.add_loadPicture((sender, e) => { 
   automation.invalidate(lt.LeadRectD.empty); 
}); 

Requirements

Target Platforms

Help Version 20.0.2019.3.11
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Engine Assembly