AnnSetMetafile Example for Visual Basic
Private Declare Function GetObjectType Lib "gdi32" (ByVal hgdiobj As Long) As Long
Private Const OBJ_ENHMETAFILE = 13
Private Const OBJ_METAFILE = 9
Private Sub Metafile_Click()
Dim hMeta As Long
Dim bEnh As Boolean
hMeta = RasterAnn.AnnGetPredefinedMetafile (ANN_METAFILE_IMPORTANT)
bEnh = LEAD1.AnnPredefinedMetafileEnhanced
RasterAnn.AnnSetPredefinedMetafile ANN_METAFILE_TOPSECRET, hMeta
RasterAnn.AnnSetMetafile hStamp, 0, ANN_METAFILE_TOPSECRET, False
MsgBox "stamp set to TopSecret"
hMeta = RasterAnn.AnnGetMetafile (hStamp)
Select Case GetObjectType(hMeta)
Case OBJ_ENHMETAFILE
MsgBox "Type is EMF"
Case OBJ_METAFILE
MsgBox "Type is WMF"
End Select
End Sub