L_AnnGetTextScaleWithDpi

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnGetTextScaleWithDpi(hObject, pbTextScaleWithDpi)

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

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 CDLL Annotation Demo (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(HANNOBJECT hObject, HWND hWnd) 
{ 
   /* hObject must be of type ANNOBJECT_TEXT */ 
   L_INT nRet; 
   L_BOOL bTextScaleWithDpi = L_FALSE; 
 
   nRet = L_AnnGetTextScaleWithDpi(hObject, &bTextScaleWithDpi);  // Store old value 
   nRet = L_AnnSetTextScaleWithDpi(hObject, !bTextScaleWithDpi);  // Toggle the value and repaint 
   RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE); 
   MessageBox(NULL, TEXT("TextScaleWithDpi Value has been toggled."), TEXT("Info"), MB_OK); 
 
   nRet = L_AnnSetTextScaleWithDpi(hObject, bTextScaleWithDpi);  // Reset old value and repaint 
   RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE); 
   MessageBox(NULL, TEXT("TextScaleWithDpi Value has been restored."), TEXT("Info"), MB_OK); 
 
   return SUCCESS; 
} 
 
L_INT EXT_CALLBACK annTextDPIScaleCallback(HANNOBJECT hObject, L_VOID *pUserData) 
{ 
   L_UINT ObjectType; 
   L_INT ObjectCount; 
 
   ObjectCount = (L_INT)pUserData; 
 
   L_AnnGetType(hObject, &ObjectType); 
 
   if (ObjectType == ANNOBJECT_TEXT || ObjectType == ANNOBJECT_NOTE) 
   { 
      AnnGetTextScaleWithDpiExample(hObject, GetActiveWindow()); 
   } 
 
   return SUCCESS; 
} 
 
L_VOID AnnEnumerateObjects(HANNOBJECT hContainer) 
{ 
   L_AnnEnumerate(hContainer, annTextDPIScaleCallback, NULL, ANNFLAG_RECURSE, NULL); 
} 

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help