Поделиться через


Content.ZoomFactor Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets the factor by which the current browser window resizes its contents.

Namespace:  System.Windows.Interop
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public ReadOnly Property ZoomFactor As Double
public double ZoomFactor { get; }

Property Value

Type: System.Double
The zoom setting for the current browser window.

Remarks

Some browsers enable users to zoom the displayed content to make it larger or smaller. You can access the zoom setting for the current browser window through the ZoomFactor property.

By default, Silverlight content automatically resizes in response to changes in the browser zoom setting. You can disable this feature by setting Settings.EnableAutoZoom to false or replace it by handling the Zoomed event. If you want to supplement the zooming feature instead of replacing it, handle the Zoomed event and set EnableAutoZoom to true.

NoteNote:

The browser zoom setting can affect any code that depends on precise sizing or placement of the plug-in within the host Web page. Different browsers respond to zoom settings in different ways. The operating system dots-per-inch (DPI) display setting can also affect the zoom setting. If your application uses custom-sizing logic, be sure to test it on different browsers and with high-DPI settings.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.