AnnStickyNoteObject Class (original) (raw)
Summary
Defines an annotation sticky note object.
Syntax
C#
Objective-C
C++/CLI
Java
Python
@interface LTAnnStickyNoteObject : LTAnnObject
public class AnnStickyNoteObject extends AnnObject
public:
ref class AnnStickyNoteObject : [AnnObject](annobject.html)
class AnnStickyNoteObject(AnnObject):
Example
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Engine;
using Leadtools.Codecs;
using Leadtools.Annotations;
using Leadtools.Annotations.WinForms;
public void AnnCore_AnnStickyNoteObject()
{
// 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/StickyNote.png"));
int pictureIndex = imagesResources.Count - 1;
double inch = 720.0;
// Add a Sticky Note object
AnnStickyNoteObject stickyNoteObj = new AnnStickyNoteObject();
// Set the points for the Sticky Note
stickyNoteObj.Points.Add(LeadPointD.Create(1 * inch, 1 * inch));
stickyNoteObj.Points.Add(LeadPointD.Create(2 * inch, 1 * inch));
stickyNoteObj.Points.Add(LeadPointD.Create(2 * inch, 2 * inch));
stickyNoteObj.Points.Add(LeadPointD.Create(1 * inch, 2 * inch));
// Set the picture
stickyNoteObj.DefaultPicture = pictureIndex;
// Set the MetaData
stickyNoteObj.Metadata[AnnObject.ContentMetadataKey] = "This is content";
stickyNoteObj.Metadata[AnnObject.AuthorMetadataKey] = Environment.UserName;
stickyNoteObj.Metadata[AnnObject.CreatedMetadataKey] = DateTime.Now.ToString();
// Add the object to the automation container
_automation.Container.Children.Add(stickyNoteObj);
}