LEADTOOLS JavaScript (Leadtools.Annotations.Core)

Resources Property (AnnContainer)

Show in webframe
Example 
Gets or sets the annotations resources used by this container.
Syntax
get_resources();
set_resources(value);
Object.defineProperty('resources');

Property Value

TypeDescription
AnnResourcesThe annotations resources used by this container. The default value is null.
Remarks

The annotations resources are images and rubber stamps used through the toolkit. Typically, you create one global AnnResources object and assign it to each container in your application.

Example

This example will show how to create and use a AnnResources object with AnnPointObject object.

example: function SiteLibrary_DefaultPage$example() {
   // Assume Resources/Point.png is the picture you want to use with Point objects

   // Create a new instance of AnnResources if the container does not already have one
   var resources = this._automation.get_container().get_resources();
   if (resources == null) {
      resources = new lt.Annotations.Core.AnnResources();
      this._automation.get_container().set_resources(resources);
   }
   // Get the images collection
   var imagesResources = resources.get_images();
   // Add our picture to it
   imagesResources.add(new lt.Annotations.Core.AnnPicture("Resources/Point.png"));
   var pictureIndex = imagesResources.length - 1;

   // Get the container and set the resources into it
   var container = this._automation.get_container();
   container.set_resources(resources);

   var inch = 720.0;

   // Add a point object at 1in,1in
   var pointObj = new lt.Annotations.Core.AnnPointObject();
   pointObj.get_points().set_item(0, lt.LeadPointD.create(1 * inch, 1 * inch));
   // Set the picture
   pointObj.set_defaultPicture(pictureIndex);

   // Add it to the container
   container.get_children().add(pointObj);

   // Select it
   this._automation.selectObject(pointObj);
},
See Also

Reference

AnnContainer Object
AnnContainer Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.