Share via


Viewport.Width Property

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

Gets or sets the width dimension of the viewport on the render-target surface, in pixels.

Namespace:  Microsoft.Xna.Framework.Graphics
Assembly:  Microsoft.Xna.Framework.Graphics (in Microsoft.Xna.Framework.Graphics.dll)

Syntax

'Declaration
Public Property Width As Integer
public int Width { get; set; }

Property Value

Type: System.Int32
The width, in pixels, of the viewport to set or get.

Remarks

Unless rendering is being done only to a subset of the surface, this member should be set to the width dimension of the render-target surface.

Version Information

Silverlight

Supported in: 5

Platforms

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