AnnEncryptApply method (Annotation Control)

C++ Builder example

Delphi example

 

Builder Syntax

int AnnEncryptApply(HANNOBJECT hObject, unsigned uEncryptFlags)

Delphi Syntax

AnnEncryptApply (hObject: HANNOBJECT; uEncryptFlags: L_UINT ): L_INT

Overview

Refer to Implementing Annotations.

Remarks

Applies an encryptor annotation object to the underlying bitmap.

An encrypt object can have two states: it can be an encryptor or it can be a decryptor.

Use this method to apply encryptor(s), decryptor(s), or both. Applying an encryptor means that the part of the bitmap that is under the encryptor is scrambled according to the encryptor properties.

Once applied, the portion of the bitmap under the encrypt object becomes scrambled or unscrambled, and the encrypt object changes state (encryptors become decryptors, and decryptors become encryptors). Using different keys before calling this method gives different scrambling patterns. The decryptor state differs from the encryptor state in that a decryptor cannot be moved, and cannot be changed to an encryptor. The scrambling can be removed by calling AnnEncryptApply on the decryptor with the appropriate arguments. If successful, the decryptor again changes state to become an encryptor. An encryptor can be moved, and can be changed to a decryptor.

The encrypt object is useful for encrypting portions of a bitmap. After encrypting, the scrambled bitmap cannot easily be unscrambled without the associated annotation file. The scrambling can be removed by using the associated annotation file, or by using automation mode to manually change the encrypt state from encryptor to a decryptor, position the object correctly, and setting the key appropriately.

You must set the AnnFlags property before calling this method, to indicate the objects to which to apply the encryption objects. Possible values for the AnnFlags property are:

0

ANNFLAG_SELECTED

ANNFLAG_NOTTHIS

ANNFLAG_RECURSE

ANNFLAG_NOTCONTAINER

ANNFLAG_NOINVALIDATE

See Also

Elements:

AnnEncryptOptions property, AnnGetEncryptOptions method, AnnSetEncryptOptions method, Encryptor property (TAnnEncryptOptions), Flags property (TAnnEncryptOptions), Key property (TAnnEncryptOptions), NeverEncrypted property (TAnnEncryptOptions), SaveDecryptorKey property (TAnnEncryptOptions), SaveEncryptorKey property (TAnnEncryptOptions), ClearDecryptorKey property (TAnnEncryptOptions), ClearEncryptorKey property (TAnnEncryptOptions), EncryptBitmap property (TAnnEncryptOptions)

Topics:

Annotations: Object Manipulation