CWebView::SetZoomLevel Method  
 
BOOL SetZoomLevel(
  INT nPercent  
);

The SetZoomLevel method changes the current browser zoom level.

Parameters

nPercent
An integer which specifies the zoom level as a percentage. The minimum zoom level is 25 and the maximum is 400.

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 SetZoomLevel method changes the zoom level of the current browser window to the specified percentage. A zoom level of 100 represents the default size with no scaling applied. Larger values magnify the content, while smaller values reduce it.

The zoom percentage is constrained by the limits defined for the control. The minimum supported zoom level is 25 (25%) and the maximum is 400 (400%). If a value outside of this range is specified, it will be clamped to the nearest valid zoom level.

Changing the zoom level affects how the page content is displayed but does not alter the underlying document. This is equivalent to adjusting the zoom in a standard web browser. The new zoom level applies to the current browser instance and will remain in effect until it is changed again, or the instance is destroyed.

If the method fails, the zoom level remains unchanged. To query the current zoom level, call GetZoomLevel.

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