Freigeben über


Viewport Structure

Defines the window dimensions of a render target surface onto which a 3-D volume projects.

Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in microsoft.windowsmobile.directx.dll)

Syntax

'Declaration
Public Structure Viewport
'Usage
Dim instance As Viewport
public struct Viewport
public value class Viewport
public final class Viewport extends ValueType
JScript suports the use of structures, but not the declaration of new ones.

Remarks

A view port is a rectangle that defines how a 3-D scene is rendered into a 2-D window. A view port also defines an area on a device into which objects are rendered.

A view port structure is a rendering surface such as a 3-D renderer that writes per-pixel scene data (such as color) to a render target.

The X, Y, Width, and Height members describe the position and dimensions of the Viewport on the render-target surface. Usually, applications render to the entire target surface; when rendering on a 640x480 surface, these members should be 0, 0, 640, and 480, respectively. The MinZ and MaxZ properties typically are set to 0.0 and 1.0, but can be set to other values to achieve specific effects. For example, setting them both to 0.0 can force the system to render objects to the foreground of a scene, while setting both to 1.0 can force the objects into the background.

When the Viewport parameters for a device change because of the Viewport property value of a Device, the driver builds a new transformation matrix.

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.

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Version Information

.NET Compact Framework

Supported in: 2.0

See Also

Reference

Viewport Members
Microsoft.WindowsMobile.DirectX.Direct3D Namespace

Other Resources

Mobile Direct3D Programming