Freigeben über


GraphicsDevice.Viewport Property

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

Gets or sets a viewport identifying the portion of the render target to receive draw calls.

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

Syntax

'Declaration
Public MustOverride Property Viewport As Viewport
public abstract Viewport Viewport { get; set; }

Property Value

Type: Microsoft.Xna.Framework.Graphics.Viewport
The viewport to set or get.

Remarks

Viewport can be used to draw on part of the screen. It should be set before any geometry is drawn so the viewport parameters will take effect.

To draw multiple views within a scene, repeat setting Viewport and draw a geometry sequence for each view.

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.