Device.Present(Rectangle,Rectangle,Control) Method (Microsoft.DirectX.Direct3D)

Presents the display with the contents of the next buffer in the sequence of back buffers owned by the device.

Definition

Visual Basic Public Sub Present( _
    ByVal sourceRectangle As RectangleLeave Site, _
    ByVal destRectangle As RectangleLeave Site, _
    ByVal overrideWindow As ControlLeave Site _
)
C# public void Present(
    RectangleLeave Site sourceRectangle,
    RectangleLeave Site destRectangle,
    ControlLeave Site overrideWindow
);
C++ public:
void Present(
    RectangleLeave Site sourceRectangle,
    RectangleLeave Site destRectangle,
    ControlLeave SiteoverrideWindow
);
JScript public function Present(
    sourceRectangle : RectangleLeave Site,
    destRectangle : RectangleLeave Site,
    overrideWindow : ControlLeave Site
);

Parameters

sourceRectangle System.Drawing.Rectangle
A RectangleLeave Site that contains the source rectangle. If the rectangle exceeds the source surface, it is clipped to the source surface. This parameter can be used only if the swap chain was created with SwapEffect.Copy.
destRectangle System.Drawing.Rectangle
A RectangleLeave Site that contains the destination rectangle. This parameter can be used only if the swap chain was created with SwapEffect.Copy.
overrideWindow System.Windows.Forms.Control
Pointer to a destination window whose client area is taken as the target for this presentation. If this parameter is omitted, PresentParameters.DeviceWindow is taken.

Remarks

If necessary, a stretch operation is applied to transfer the pixels within the source rectangle to the destination rectangle in the client area of the target window.

This method fails, throwing an InvalidCallException exception, if it is called between BeginScene and EndScene pairs, unless the render target is not the current render target (for example, the back buffer that results from the creation of an additional swap chain).

Exceptions

DriverInternalErrorException

Internal driver error. Applications should generally shut down when receiving this error.

DeviceLostException

The device is lost but cannot be reset at this time. Therefore, rendering is not possible.

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.

See Also