Applies the encryptor AnnEncryptObject object currently being edited (selected).
public virtual void ApplyEncryptor() Public Overridable Sub ApplyEncryptor()
public:virtual void ApplyEncryptor();
Use the CanApplyEncryptor property to determine whether you can currently call this method.
This method will call the AnnEncryptObjectApply(RasterImageViewer) method.
using Leadtools;using Leadtools.Annotations;using Leadtools.WinForms;using Leadtools.Drawing;public void AnnAutomation_ApplyEncryptor(AnnAutomation automation){// first add a new encrypt object to the automationAnnEncryptObject encrypt = new AnnEncryptObject();encrypt.Bounds = new AnnRectangle(100, 100, 100, 100, AnnUnit.Pixel);encrypt.Key = 123;automation.Container.Objects.Add(encrypt);automation.Viewer.Invalidate(encrypt.InvalidRectangle);// make sure no objects are selected in the automationautomation.SelectNone();// see if we can apply the encryptor or decryptor (this should show a message informing you that no objects are currently selected (bring edited)EncryptDecrypt(automation);// select (edit) the object we have just addedautomation.StartEditing(encrypt, false);// see if we can apply the encryptor or decryptor (should apply the encryptor)EncryptDecrypt(automation);// see if we can apply the encryptor or decryptor (should apply the decryptor)EncryptDecrypt(automation);}private void EncryptDecrypt(AnnAutomation automation){// first, check if we can apply the encryptor or decryptorif (automation.CanApplyEncryptor){// apply the encryptorautomation.ApplyEncryptor();MessageBox.Show("Encryptor has been applied");}else if (automation.CanApplyDecryptor){// apply the decryptorautomation.ApplyDecryptor();MessageBox.Show("Decryptor has been applied");}elseMessageBox.Show("Cannot apply encryptor or decryptor because no encrypt object is currently being edited (selected)");}
Imports LeadtoolsImports Leadtools.AnnotationsImports Leadtools.WinFormsImports Leadtools.DrawingPublic Sub AnnAutomation_ApplyEncryptor(ByVal automation As AnnAutomation)' first add a new encrypt object to the automationDim encrypt As AnnEncryptObject = New AnnEncryptObject()encrypt.Bounds = New AnnRectangle(100, 100, 100, 100, AnnUnit.Pixel)encrypt.Key = 123automation.Container.Objects.Add(encrypt)automation.Viewer.Invalidate(encrypt.InvalidRectangle)' make sure no objects are selected in the automationautomation.SelectNone()' see if we can apply the encryptor or decryptor (this should show a message informing you that no objects are currently selected (bring edited)EncryptDecrypt(automation)' select (edit) the object we have just addedautomation.StartEditing(encrypt, False)' see if we can apply the encryptor or decryptor (should apply the encryptor)EncryptDecrypt(automation)' see if we can apply the encryptor or decryptor (should apply the decryptor)EncryptDecrypt(automation)End SubPrivate Sub EncryptDecrypt(ByVal automation As AnnAutomation)' first, check if we can apply the encryptor or decryptorIf automation.CanApplyEncryptor Then' apply the encryptorautomation.ApplyEncryptor()MessageBox.Show("Encryptor has been applied")ElseIf automation.CanApplyDecryptor Then' apply the decryptorautomation.ApplyDecryptor()MessageBox.Show("Decryptor has been applied")ElseMessageBox.Show("Cannot apply encryptor or decryptor because no encrypt object is currently being edited (selected)")End IfEnd Sub
|
Products |
Support |
Feedback: ApplyEncryptor Method - Leadtools.Annotations |
Introduction |
Help Version 19.0.2017.6.20
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.