L_AnnGetTextScaleWithDpi

Summary

Gets a value indicating whether to consider the bitmap's DPI when calculating the text font size.

Syntax

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnGetTextScaleWithDpi(hObject, pbTextScaleWithDpi)

Parameters

HANNOBJECT hObject

Handle to an automation object.

L_BOOL *pbTextScaleWithDpi

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.

Returns

Value Meaning
SUCCESS  
< 1 An error occurred. Refer to Return Codes.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

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 Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.