Microsoft DirectX 9.0 SDK Update (October 2004)

Texture.FromStream Method

Language:

Note: This documentation is preliminary and is subject to change.

Creates a texture resource from a stream object.

Definition

Visual Basic .NET Public Shared Function FromStream( _
    ByVal device As Device, _
    ByVal data As Stream, _
    ByVal usage As Usage, _
    ByVal pool As Pool _
) As Texture
C# public static Texture FromStream(
    Device device,
    Stream data,
    Usage usage,
    Pool pool
);
Managed C++ public: static Texture* FromStream(
    Device *device,
    Stream *data,
    Usage usage,
    Pool pool
);
JScript .NET public static function FromStream(
    device : Device,
    data : Stream,
    usage : Usage,
    pool : Pool
) : Texture;

Parameters

device Microsoft.DirectX.Direct3D.Device. A Device object to associate with the Texture object.
data System.IO.Stream. A Stream Leave Site used to create the texture.
usage Microsoft.DirectX.Direct3D.Usage. Usage can be 0, which indicates no usage value. However, if usage is desired, use one or more Usage constants. It is good practice to match the usage parameter with the CreateFlags in the Device constructor.
pool Microsoft.DirectX.Direct3D.Pool. Member of the Pool enumerated type that describes the memory class into which the texture should be placed.

Return Value

Microsoft.DirectX.Direct3D.Texture . A Texture object.

Remarks

An application can discover support for automatic generation of mipmaps in a particular format by calling Manager.CheckDeviceFormat with Usage.AutoGenerateMipMap. If Manager.CheckDeviceFormat returns false, the Texture constructor succeeds, but returns a single-level texture.

Exceptions
InvalidCallException The method call is invalid. For example, a parameter might contain an invalid value.
OutOfVideoMemoryException Microsoft® Direct3D® does not have enough display memory to perform the operation.
OutOfMemoryException Leave Site Direct3D could not allocate sufficient memory to complete the call.

See Also


© 2004 Microsoft Corporation. All rights reserved. Terms of use.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center