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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.