Gets a value indicating whether to consider the bitmap's DPI when calculating the text font size.
#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnGetTextScaleWithDpi(hObject, pbTextScaleWithDpi)
Handle to an automation object.
Pointer to a variable to be updated with a flag that indicates whether to consider the bitmap's DPI when calculating the text font size. Possible values are:
Value | Meaning |
---|---|
TRUE | Consider the bitmap's DPI. |
FALSE | Ignore the bitmap's DPI. |
Value | Meaning |
---|---|
SUCCESS | |
< 1 | An error occurred. Refer to Return Codes. |
Win32, x64, Linux.
Sample for L_AnnGetTextScaleWithDpi, L_AnnSetTextScaleWithDpi.
To try this sample, paste the code into the \Examples\Annotation\C\Annotate\Annotate.cpp.
And replace the code for the About Box (IDM_ABOUT) as follows:
case IDM_ABOUT:
{
ABOUT_DIALOG(hwnd, "Annotation");
hwndChild = (HWND)SendMessage(hwndClient, WM_MDIGETACTIVE, 0, 0);
if (hwndChild)
{
LPCHILDDATA pData = (LPCHILDDATA)GETWNDDATA(hwndChild);
AnnEnumerateObjects(pData->hContainer);
}
break;
}
L_INT AnnGetTextScaleWithDpiExample(L_HWND hWnd, HANNOBJECT hObject)
{
/* hObject must be of type ANNOBJECT_TEXT */
L_INT nRet;
L_BOOL bTextScaleWithDpi = L_FALSE;
L_TCHAR szMsg[200];
nRet = L_AnnGetTextScaleWithDpi(hObject, &bTextScaleWithDpi); // Store old value
if (nRet != SUCCESS)
return nRet;
nRet = L_AnnSetTextScaleWithDpi(hObject, !bTextScaleWithDpi); // Toggle the value and repaint
if (nRet != SUCCESS)
return nRet;
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE);
wsprintf(szMsg, TEXT("Information: TextScaleWithDpi Value has been toggled."));
_tprintf(_T("%s"), szMsg);
nRet = L_AnnSetTextScaleWithDpi(hObject, bTextScaleWithDpi); // Reset old value and repaint
if (nRet != SUCCESS)
return nRet;
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE);
wsprintf(szMsg, TEXT("Information: TextScaleWithDpi Value has been restored."));
_tprintf(_T("%s"), szMsg);
return nRet;
}
L_INT EXT_CALLBACK annTextDPIScaleCallback(HANNOBJECT hObject, L_VOID* pUserData)
{
L_UINT ObjectType;
L_INT nRet;
nRet = L_AnnGetType(hObject, &ObjectType);
if (nRet != SUCCESS)
return nRet;
if (ObjectType == ANNOBJECT_TEXT || ObjectType == ANNOBJECT_NOTE)
nRet = AnnGetTextScaleWithDpiExample(GetActiveWindow(), hObject);
return nRet;
}
L_VOID AnnEnumerateObjects(HANNOBJECT hContainer)
{
L_AnnEnumerate(hContainer, annTextDPIScaleCallback, NULL, ANNFLAG_RECURSE, 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