Device.Viewport Property (Microsoft.DirectX.Direct3D)

Retrieves or sets the viewport parameters for the current device.

Definition

Visual Basic Public Property Viewport As Viewport
C# public Viewport Viewport { get; set; }
C++ public:
property Viewport Viewport {
        Viewport get();
        void set(Viewport value);
}
JScript public function get Viewport() : Viewport
public function set Viewport(Viewport);

Property Value

Microsoft.DirectX.Direct3D.Viewport
A Viewport object that represents the returned viewport parameters or specifies the viewport parameters to set.

This property is read/write. 

Remarks

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

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

Exceptions

InvalidCallException

Occurs if Viewport is invalid, or if Viewport describes a region that cannot exist within the render target surface.