Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.GetFrontBuffer

Generates a copy of the device's front buffer and places that copy in a system memory buffer provided by the application.

object.GetFrontBuffer( _ 
    DestSurface As Direct3DSurface8)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
DestSurface
A Direct3DSurface8 object that will receive a copy of the contents of the front buffer. The data is returned in successive rows with no intervening space, starting from the vertically highest row on the device's output to the lowest.

Error Codes

If the method fails, an error is raised and Err.Number can be set to one of the following values.

D3DERR_INVALIDCALL
D3DERR_DEVICELOST

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

For more information, see Lost Devices.

Remarks

The buffer returned in DestSurface will be filled with a representation of the front buffer, converted to the standard 32bpp format, D3DFMT_A8R8G8B8.

This method is the only way to capture an anti-aliased screen shot.