public AnnResources Resources {get; set;}
get_Resources();
set_Resources(value);
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.
[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); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2