Encrypt Annotation Object

The Encrypt annotation object (ANNOBJECT_ENCRYPT) is a rectangluar object that is used to encrypt rectangular portions of a bitmap.

It can also be used to encrypt the entire bitmap. In automated mode, the Encrypt object is created by clicking and dragging the mouse to create the rectangular encrypt object. In design mode, the Encrypt object is visible but partially transparent to show the part of the image that it covers. In run mode, the encrypt object is invisible.

You must call the L_AnnEncryptApply function to apply the Encrypt object. Once applied, the portion of the bitmap under the Encrypt object becomes scrambled, and the Encrypt object state changes to decryptor. Using different keys before calling this function 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 the L_AnnEncryptApply on the decrypt object with the appropriate arguments. If successful, the decryptor state changes to encryptor. An Encrypt object in the encryptor state can be moved, can have its key changed, and can be changed to a c object.

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 state from encryptor to a decryptor, position it correctly, and setting the key appropriately.

Overlapping regions can be encrypted. When encrypting overlapping regions, note the following points:

image\sqrblit.gif All annotation objects have an order in which they are drawn (the Z-order).

image\sqrblit.gif The encryptors are encrypted from the front of the Z-order to the back.

image\sqrblit.gif Those that are drawn first are encrypted first. Those that are drawn last ("on top" of other encryptors) are encrypted last.

image\sqrblit.gif The Z-order can be changed through automation by right-clicking and choosing "Send To Front" or "Send To Back".

image\sqrblit.gif The Decrypt objects are decrypted in reverse order of the Encrypt objects.

Use the L_ScrambleBitmap function to scramble all or a portion of a Bitmap. Scrambling a rectangular area means that the pixels in that area are shuffled around into a pseudo-random location within the area.

The L_ScrambleBitmap function can be used directly on a bitmap, and does not depend on annotations in any way.

Use the L_AnnGetEncryptOptions function to get the encrypt options of an Encrypt or a Decrypt object. These options are in an ANNENCRYPTOPTIONS structure.

Use the L_AnnSetEncryptOptions function to set the encrypt options of an Encrypt or a Decrypt object. These options are in an ANNENCRYPTOPTIONS structure.

Use the L_AnnGetSecondaryMetafile function to retrieve the current metafile for an Encrypt object in a ‘decryptor’ state.

Use the L_AnnGetMetafile function to retrieve the current metafile for an Encrypt object in an ‘encryptor’ state.

Use the L_AnnSetMetafile function to change the metafile for an Encrypt or Decrypt object.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

With low-level functions, you must define the size and position of the rectangle. Other applicable properties have the following defaults, which you can change:

Visible

Defaults to FALSE. It can be changed using the L_AnnSetVisible function.

Selected

Defaults to FALSE. It can be changed using the L_AnnSetSelected function.

Name

Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.

Metafile

Defaults to a black skeleton key. It can be changed using the L_AnnSetMetafile function.

Secondary Metafile

Defaults to a red skeleton key. It can be changed using the L_AnnSetMetafile function.

Hyperlink

Defaults to None. It can be changed using the L_AnnSetHyperlink function.

Tag (identifier)

Defaults to 0. It can be changed using the L_AnnSetTag function.

Window handle

Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.

User mode

Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

Related topics:

L_AnnGetEncryptOptions

L_AnnSetEncryptOptions

L_AnnEncryptApply

L_ScrambleBitmap

 

image\sqrblit.gif Implementing Annotations.

image\sqrblit.gif Types of Annotations.

image\sqrblit.gif Low-Level Coordinate System for Annotations.

image\sqrblit.gif Annotation Objects - Automated Features

image\sqrblit.gif Using Annotation Bitmap Objects