AnnGetSecondaryMetaFile example for Visual Basic
Private Sub ExampleAnnGetSecondryMetafile(hObject As Long)
Dim hMetafile1 As Long
Dim hMetafile2 As Long
Dim ObjectType As AnnObjectType
Dim bEncryptorOriginal As Boolean
RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType
If ObjectType <> ANN_OBJECT_ENCRYPT Then
MsgBox "This Object is not an encryptor."
End If
hMetafile1 = RasterAnn.AnnGetMetafile(hObject)
hMetafile2 = RasterAnn.AnnGetSecondaryMetafile(hObject)
RasterAnn.AnnEncryptOptions.Flags = ANN_ENCRYPT_ALL
RasterAnn.AnnGetEncryptOptions(hObject)
bEncryptorOriginal = RasterAnn.AnnEncryptOptions.EnableEncryptor
'Set state to Decryptor and set Decryptor metafile
RasterAnn.AnnEncryptOptions.Flags = ANN_ENCRYPT_TYPE
RasterAnn.Flags = 0
RasterAnn.AnnEncryptOptions.EnableEncryptor = True
RasterAnn.AnnSetEncryptOptions (hObject)
RasterAnn.AnnSetMetafile hObject, hMetafile2, ANN_METAFILE_USER, False
'Set state to Decryptor and set Decryptor metafile
RasterAnn.Flags = 0
RasterAnn.AnnEncryptOptions.EnableEncryptor = True
RasterAnn.AnnSetEncryptOptions (hObject)
RasterAnn.AnnSetMetafile hObject, hMetafile2, ANN_METAFILE_USER, False
RasterAnn.AnnEncryptOptions.EnableEncryptor = bEncryptorOriginal
RasterAnn.Flags = 0
RasterAnn.AnnSetEncryptOptions (hObject)
End Sub