Viewport Structure
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Defines the window dimensions of a render-target surface onto which a 3D volume projects.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in Microsoft.Xna.Framework.Graphics.dll)
Syntax
'Declaration
Public Structure Viewport
public struct Viewport
The Viewport type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Viewport(Rectangle) | Creates an instance of this object. | |
Viewport(Int32, Int32, Int32, Int32) | Initializes a new instance of the Viewport class. |
Top
Properties
Name | Description | |
---|---|---|
AspectRatio | Gets the aspect ratio used by the viewport | |
Bounds | Gets the size of this resource. | |
Height | Gets or sets the height dimension of the viewport on the render-target surface, in pixels. | |
MaxDepth | Gets or sets the maximum depth of the clip volume. | |
MinDepth | Gets or sets the minimum depth of the clip volume. | |
Width | Gets or sets the width dimension of the viewport on the render-target surface, in pixels. | |
X | Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface. | |
Y | Gets or sets the pixel coordinate of the upper-left corner of the viewport on the render-target surface. |
Top
Extension Methods
Name | Description | |
---|---|---|
Project | Projects a 3D vector from object space into screen space. (Defined by ViewportExtensions.) | |
Unproject | Converts a screen space point into a corresponding point in world space. (Defined by ViewportExtensions.) |
Top
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.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.