Microsoft DirectX 8.0 (Visual Basic)

D3DXSprite.DrawTransform

Provides a mechanism for drawing a sprite that is transformed by a specified matrix.

object.DrawTransform( _ 
    SrcTexture As Direct3DTexture8, _ 
    SrcRect As Any, _ 
    TransformMatrix As D3DMATRIX, _ 
    Color As Long)

Parts

object
Object expression that resolves to a D3DXSprite object.
SrcTexture
Direct3DTexture8 object, representing the source image used for the sprite.
SrcRect
A RECT type that indicates what portion of the source texture to use for the sprite. If this parameter is ByVal 0, then the entire source image is used for the sprite. However, you can specify a sub-rectangle of the source image instead. X and y mirroring can be specified easily by swapping the left and top and the right and bottom parameters of this RECT type.

Before transformation, the size of the sprite is defined by SrcRect with the top-left corner at the origin (0,0).

TransformMatrix
A D3DMATRIX type, specifying the transformation that is applied.
Color
Value representing the color. The color and alpha channels are modulated by this value.

Error Codes

If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.

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

Remarks

If D3DXSprite.Begin has not been called, this method internally calls Begin and D3DXSprite.End. When making successive calls to D3DXSprite.Draw and/or D3DXSprite.DrawTransform, be sure to call Begin to avoid the extra overhead of Draw and DrawTransform internally calling Begin and End each time.

See Also

D3DXSprite.Draw