public int LockPicture { get; set; } @property (nonatomic, assign) NSInteger lockPicture; public int getLockPicture()public void setLockPicture(int picture)
public:property Int32 LockPicture{Int32 get()void set(Int32 value)}
LockPicture # get and set (AnnObject)
The id of the picture used when drawing the locked symbol for locked objects. The default value is 1.
All objects of this type inside the container will use this picture when drawing the object if the object is locked.
The container uses a picture of a "lock" that is created by default. You can change this default picture by using this property.
For more information, refer to Implementing Annotation Security.
using Leadtools.Annotations.Automation;using Leadtools.Annotations.Engine;using Leadtools.WinForms;using Leadtools.Annotations.WinForms;public void AnnObject_Lock(){double inch = 720.0;// Get the containerAnnContainer container = _automation.Container;// Add the lock picture to the container resources// Create a new instance of AnnResources if the container does not already have oneAnnResources resources = _automation.Manager.Resources;if (resources == null){resources = new AnnResources();}// Get the images collectionIList<AnnPicture> imagesResources = resources.Images;// Add our picture to itimagesResources.Add(new AnnPicture(@"ms-appx:///Assets/Lock.png"));int pictureIndex = imagesResources.Count - 1;// Add a blue on yellow rectangle from 3in 3in to 4in 4inAnnRectangleObject rectObj = new AnnRectangleObject();rectObj.Rect = LeadRectD.Create(3 * inch, 3 * inch, 1 * inch, 1 * inch);rectObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Blue"), LeadLengthD.Create(1));rectObj.Fill = AnnSolidColorBrush.Create("Yellow");// Set its lock picturerectObj.LockPicture = pictureIndex;// Add it to the containercontainer.Children.Add(rectObj);// Show the object lock state (default)Debug.WriteLine("1. Default lock state");ShowLockedState(rectObj);// Lock it with a passwordDebug.WriteLine("2. Locking now with a password");rectObj.Lock("secret");// Show the object lock state, it should say locked and the object should be painted with the lock pictureShowLockedState(rectObj);// Now try to unlock it with a wrong passwordDebug.WriteLine("3. Unlocking with a wrong password");rectObj.Unlock("wrong password");// Check, it should be lockedShowLockedState(rectObj);// Unlock it with the correct passwordDebug.WriteLine("4. Unlocking with a correct password");rectObj.Unlock("secret");// Check lock statusShowLockedState(rectObj);//Lock using a new passwordDebug.WriteLine("5. Locking with a new password");rectObj.Lock("NewPassword");ShowLockedState(rectObj);//Change the password used in the last lock operationDebug.WriteLine("6. After being locked, change to new password");rectObj.Password = "secret-again";ShowLockedState(rectObj);}private void ShowLockedState(AnnObject annObj){_automation.Invalidate(LeadRectD.Empty);// Show the object lock state (default)Debug.WriteLine($"\tLocked: {annObj.IsLocked} | Password: {annObj.Password}");}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
