Platform SDK: DirectX

DirectDrawSurface7.Blt

The DirectDrawSurface7.Blt method performs a bit block transfer (blit). This method does not support z-buffering or alpha blending (see alpha channel) during blit operations.

object.Blt( _ 
    destRect As RECT, _ 
    ddS As DirectDrawSurface7, _
    srcRect As RECT, _ 
    flags As CONST_DDBLTFLAGS) As Long

Parameters

object
Object expression that resolves to a DirectDrawSurface7 object.
destRect
RECT type that defines the upper-left and lower-right points of the rectangle to blit to on the destination surface. If this parameter is an empty RECT type, the entire destination surface is used.
ddS
DirectDrawSurface7 object for the DirectDrawSurface object that is the source of the blit.
srcRect
RECT type that defines the upper-left and lower-right points of the rectangle to blit from on the source surface. If this parameter is an empty RECT, the entire source surface is used.
flags
Combination of constants from the CONST_DDBLTFLAGS enumeration that determines the valid members of the associated DDBLTFX type, which specify color key information, or request special behavior from the method.

Error Codes

If the method fails, it can return one of the following:

DDERR_GENERIC
DDERR_INVALIDCLIPLIST
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_INVALIDRECT
DDERR_NOALPHAHW
DDERR_NOBLTHW
DDERR_NOCLIPLIST
DDERR_NODDROPSHW
DDERR_NOMIRRORHW
DDERR_NORASTEROPHW
DDERR_NOROTATIONHW
DDERR_NOSTRETCHHW
DDERR_NOZBUFFERHW
DDERR_SURFACEBUSY
DDERR_SURFACELOST
DDERR_UNSUPPORTED
DDERR_WASSTILLDRAWING

Remarks

This method is capable of synchronous or asynchronous blits (the latter is the default behavior), either display memory to display memory, display memory to system memory, system memory to display memory, or system memory to system memory. The blits can be performed by using source color keys and destination color keys. Arbitrary stretching or shrinking is performed if the source and destination rectangles are not the same size.

Typically, DirectDrawSurface7.Blt returns immediately with an error if the blitter is busy and the blit could not be set up. Specify the DDBLT_WAIT flag to request a synchronous blit. When you include the DDBLT_WAIT flag, the method waits until the blit can be set up or another error occurs before it returns.

Note that dstRect and srcRect parameters are defined so that the right and bottom members are exclusive—therefore, right minus left equals the width of the rectangle, not one less than the width.

Because this method often generates an error, instead of setting an error in the error object, the method returns the error code.