#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnGetMetafile(hObject, phMetafile)
Retrieves the metafile handle associated with a stamp object (including the Rubber Stamp tools), encrypt object, hotspot object, or freehand hotspot object.
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.
Required DLLs and Libraries
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;
HMETAFILE Metafile;
L_INT nRet;
L_TCHAR* pszType;
L_BOOL bRetrieve;
L_TCHAR szMsg[200];
L_AnnGetType(hObject, &Type);
pszType = TEXT("");
bRetrieve = FALSE;
switch(Type)
{
case ANNOBJECT_STAMP:
pszType = TEXT("ANNOBJECT_STAMP");
bRetrieve = TRUE;
break;
case ANNOBJECT_HOTSPOT:
pszType = TEXT("ANNOBJECT_HOTSPOT");
bRetrieve = TRUE;
break;
case ANNOBJECT_FREEHANDHOTSPOT:
pszType = TEXT("ANNOBJECT_FREEHANDHOTSPOT");
bRetrieve = TRUE;
break;
}
if (bRetrieve)
{
nRet = L_AnnGetMetafile(hObject, &Metafile);
if (nRet == SUCCESS)
{
if (Metafile != NULL)
wsprintf(szMsg, TEXT("%s Metafile retrieved"), pszType);
else
wsprintf(szMsg, TEXT("%s Metafile is NULL"), pszType);
}
else
{
wsprintf(szMsg, TEXT("%s Error Getting Metafile"), pszType);
}
}
else
wsprintf(szMsg, TEXT("Not a stamp and not a freehand object"));
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
return SUCCESS;
}
L_INT AnnGetMetafileExample(HANNOBJECT hContainer)
{
L_INT nRet;
nRet = L_AnnEnumerate(hContainer, annMetaCallback, NULL, ANNFLAG_RECURSE|ANNFLAG_NOTCONTAINER, NULL);
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}
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