Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.24
LEADTOOLS Raster imaging C++ Class library help

LAnnotation::GetScalarX

Show in webframe

#include "ltwrappr.h"

virtual L_DOUBLE LAnnotation::GetScalarX()

Gets the horizontal scaling factor that is applied to the annotation object.

Returns

The horizontal scaling factor.

Comments

Typically, the scaling factors are applied to a root container so that the annotations will match the displayed image.

Offset values, which are set by the LAnnotation::SetOffsetX and LAnnotation::SetOffsetY functions, are applied after the scalar properties. For more information, refer to Low-Level Coordinate System for Annotations.

Required DLLs and Libraries

LTANN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64.

See Also

Functions:

Class Members

Topics:

Annotation Functions: Getting and Setting Geometric Properties

 

Low-Level Coordinate System for Annotations

 

Fixed Annotations

 

Minimizing Flicker With Double Buffering

 

Displaying and Manipulating Annotation Objects

Example

L_INT LAnnotation_GetScalarXExample(LAnnotation& LeadAnn,LBitmapBase& LeadBitmap)
{
   L_INT nRet;
   L_INT nXPercent, nYPercent; // X and Y scale percentage 
   L_DOUBLE dXScalar, dYScalar; // X and Y floating point scalars 
   L_TCHAR  szMessage[80]; // Message buffer 
   RECT rClientArea ;
   
   // Get the floating point scalars 
   dXScalar = LeadAnn.GetScalarX();
   dYScalar = LeadAnn.GetScalarY();
   
   // Convert the scalars to percentages 
   nXPercent = (L_INT)(dXScalar * 100);
   nYPercent = (L_INT)(dYScalar * 100);
   // Display the percentages in a message
   wsprintf (szMessage, TEXT("%d percent X and %d percent Y"), nXPercent, nYPercent);
   MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);
   //...
   //...
   GetClientRect(LeadAnn.GetWnd(),&rClientArea);
   nRet = LeadAnn.SetScalarX((L_DOUBLE) rClientArea.right / LeadBitmap.GetWidth());
   if(nRet != SUCCESS)
      return nRet;
   nRet = LeadAnn.SetScalarY((L_DOUBLE) rClientArea.bottom / LeadBitmap.GetHeight());
   if(nRet != SUCCESS)
      return nRet;
//...
   return SUCCESS;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.