CWebView::GetZoomLevel Method  
 
BOOL GetZoomLevel(
  INT *lpnPercent  
);

The GetZoomLevel method returns the current zoom level as a percentage.

Parameters

lpnPercent
A pointer to an integer which will contain the current zoom level as a percentage value when the method returns. This parameter cannot be NULL.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The GetZoomLevel method returns the current zoom level of the browser window as an integer percentage value. A zoom level of 100 indicates that the page is being displayed at its normal size without any scaling applied. Values greater than 100 mean that the content is being magnified, and values less than 100 mean that the content is being reduced.

The zoom level is constrained by the limits defined for the control. By default, the minimum zoom level is 25 (25%) and the maximum zoom level is 400 (400%). Attempts to set values outside of this range using SetZoomLevel will be clamped to the supported range.

This method can be used to determine the current scaling when an application wants to preserve a user's preferred zoom level across sessions, or to query whether the content is being displayed at the default size. If the method fails, the contents of the lpnPercent parameter are undefined and should not be used.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: cshtmv12.lib

See Also