Retrieves the metafile handle associated with a stamp object (including the Rubber Stamp tools), encrypt object, hotspot object, or freehand hotspot object.
#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnGetMetafile(hObject, phMetafile)
Handle to the annotation object.
Pointer to a variable to be updated with the handle to a metafile.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
If this function is successful, the address pointed to by phMetafile
will be updated with the metafile handle.
The Stamp object (which includes the Rubber Stamp tools) can display text, a bitmap or a metafile. Only one of these three can be displayed at any timesetting the object to one of these destroys any settings for the other two.
Initially, the Stamp object displays text. The difference between the Stamp and the Rubber Stamp is that initially whereas the Stamp does not display an image, the Rubber Stamp tools are set to display different metafiles (one for each rubber stamp selection).
Initially, the Hotspot, Freehand Hotspot, and Encrypt objects are also set to display predefined metafiles.
Call the L_AnnGetMetafile function to retrieve a metafile for an object. Call the L_AnnSetMetafile function to change the metafile for an object. Any new objects will still get the default metafile.
Win32, x64.
This example enumerates through all of the annotations in a container and retrieves the metafiles for the stamp, hotspot, and freehand hotspot objects.
L_INT EXT_CALLBACK annMetaCallback(HANNOBJECT hObject, L_VOID* pUserData)
{
UNREFERENCED_PARAMETER(pUserData);
L_UINT Type;
L_HMETAFILE Metafile;
L_INT nRet = SUCCESS;
L_TCHAR* pszType = TEXT("");
L_BOOL bRetrieve = L_FALSE;
L_TCHAR szMsg[200];
nRet = L_AnnGetType(hObject, &Type);
if (nRet != SUCCESS)
return nRet;
switch (Type)
{
case ANNOBJECT_STAMP:
pszType = TEXT("ANNOBJECT_STAMP");
bRetrieve = L_TRUE;
break;
case ANNOBJECT_HOTSPOT:
pszType = TEXT("ANNOBJECT_HOTSPOT");
bRetrieve = L_TRUE;
break;
case ANNOBJECT_FREEHANDHOTSPOT:
pszType = TEXT("ANNOBJECT_FREEHANDHOTSPOT");
bRetrieve = L_TRUE;
break;
}
if (!bRetrieve)
{
_tprintf(_T("%s"), TEXT("Not a stamp, hotspot or freehand hotspot object."));
return FAILURE;
}
nRet = L_AnnGetMetafile(hObject, &Metafile);
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("%s Error Getting Metafile"), pszType);
_tprintf(_T("%s"), szMsg);
return nRet;
}
if (Metafile != NULL)
wsprintf(szMsg, TEXT("%s Metafile retrieved"), pszType);
else
wsprintf(szMsg, TEXT("%s Metafile is NULL"), pszType);
_tprintf(_T("%s"), szMsg);
return nRet;
}
extern "C" L_INT AnnGetMetafileExample(HANNOBJECT hContainer)
{
return L_AnnEnumerate(hContainer, annMetaCallback, NULL, ANNFLAG_RECURSE | ANNFLAG_NOTCONTAINER, NULL);
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document