(Leadtools.Annotations.Core)

Resources Property (AnnContainer)

Show in webframe
Example 





Gets or sets the annotations resources used by this container.
Syntax
public AnnResources Resources {get; set;}
Public Property Resources As AnnResources
public AnnResources Resources {get; set;}
@property (nonatomic) LTAnnResources* resources;
public AnnResources getResources()
public void setResources(AnnResources resources)
            
 
get_Resources();
set_Resources(value);
Object.defineProperty('Resources');

Property Value

The 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
Copy Code  
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;

public void AnnContainer_Resources()
{
   // Assume Assets\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
   AnnResources resources = _automation.Container.Resources;
   if (resources == null)
   {
      resources = new AnnResources();
      _automation.Container.Resources = resources;
   }
   // Get the images collection
   IList<AnnPicture> imagesResources = resources.Images;
   // Add our picture to it
   imagesResources.Add(new AnnPicture(@"ms-appx:///Assets/Point.png"));
   int pictureIndex = imagesResources.Count - 1;

   // Get the container and set the resources into it
   AnnContainer container = _automation.Container;
   container.Resources = resources;

   double inch = 720.0;

   // Add a point object at 1in,1in
   AnnPointObject pointObj = new AnnPointObject();
   pointObj.Points[0] = LeadPointD.Create(1 * inch, 1 * inch);
   // Set the picture
   pointObj.DefaultPicture = pictureIndex;

   // Add it to the container
   container.Children.Add(pointObj);

   // Select it
   _automation.SelectObject(pointObj);
}
using Leadtools.Converters;
using Leadtools.Annotations.Automation;
using Leadtools.Controls;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;

[TestMethod]
public void AnnContainer_Resources()
{
   // Assume Assets\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
   AnnResources resources = _automation.Container.Resources;
   if (resources == null)
   {
      resources = new AnnResources();
      _automation.Container.Resources = resources;
   }
   // Get the images collection
   IList<AnnPicture> imagesResources = resources.Images;
   // Add our picture to it
   imagesResources.Add(new AnnPicture(@"ms-appx:///Assets/Point.png"));
   int pictureIndex = imagesResources.Count - 1;

   // Get the container and set the resources into it
   AnnContainer container = _automation.Container;
   container.Resources = resources;

   double inch = 720.0;

   // Add a point object at 1in,1in
   AnnPointObject pointObj = new AnnPointObject();
   pointObj.Points[0] = LeadPointDHelper.Create(1 * inch, 1 * inch);
   // Set the picture
   pointObj.DefaultPicture = pictureIndex;

   // Add it to the container
   container.Children.Add(pointObj);

   // Select it
   _automation.SelectObject(pointObj);
}
Requirements

Target Platforms

See Also

Reference

AnnContainer Class
AnnContainer Members

 

 


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