AnnSetMetafile example for Delphi

Procedure TForm1.TestMetaFile(hStamp: HANNOBJECT);
var
hMeta: HMETAFILE;
bEnhanced: Boolean;
begin
LEADAnn1.AnnGetPredefinedMetafile(ANNMETAFILE_IMPORTANT, bEnhanced, hMeta);
LEADAnn1.AnnSetPredefinedMetafile(ANNMETAFILE_TOPSECRET, hMeta);
LEADAnn1.AnnSetMetafile(hStamp, 0, ANNMETAFILE_TOPSECRET, False);
ShowMessage('Stamp set to TopSecret');

LEADAnn1.AnnGetMetafile(hStamp, hMeta);
Case (GetObjectType(hMeta)) of
OBJ_ENHMETAFILE:
ShowMessage('Type is EMF');

OBJ_METAFILE:
ShowMessage('Type is WMF');
end;
end;