VolumeLoader.FromStream(Volume,Box,Stream,Int32,Box,Filter,Int32,ImageInformation) Method (Microsoft.DirectX.Direct3D)

Creates a volume from a file in memory.

Definition

Visual Basic Public Shared Sub FromStream( _
    ByVal destVolume As Volume, _
    ByVal destBox As Box, _
    ByVal stream As StreamLeave Site, _
    ByVal readBytes As Integer, _
    ByVal srcBox As Box, _
    ByVal filter As Filter, _
    ByVal colorKey As Integer, _
    ByRef srcInformation As ImageInformation _
)
C# public static void FromStream(
    Volume destVolume,
    Box destBox,
    StreamLeave Site stream,
    int readBytes,
    Box srcBox,
    Filter filter,
    int colorKey,
    ref ImageInformation srcInformation
);
C++ public:
static void FromStream(
    VolumedestVolume,
    Box destBox,
    StreamLeave Sitestream,
    int readBytes,
    Box srcBox,
    Filter filter,
    int colorKey,
    ImageInformationsrcInformation
);
JScript public static function FromStream(
    destVolume : Volume,
    destBox : Box,
    stream : StreamLeave Site,
    readBytes : int,
    srcBox : Box,
    filter : Filter,
    colorKey : int,
    srcInformation : ImageInformation
);

Parameters

destVolume Microsoft.DirectX.Direct3D.Volume
A Volume object that specifies the destination volume.
destBox Microsoft.DirectX.Direct3D.Box
A Box structure that specifies the destination box. Omit this parameter to specify the entire volume.
stream System.IO.Stream
A StreamLeave Site that contains the source volume texture in memory.
readBytes System.Int32
Size of the file in memory, in bytes.
srcBox Microsoft.DirectX.Direct3D.Box
A Box structure that specifies the source box. Omit this parameter to specify the entire volume.
filter Microsoft.DirectX.Direct3D.Filter
One or more Filter flags that control how the image is filtered.
colorKey System.Int32
An Int32Leave Site value to replace with transparent black, or 0 to disable the color key. This is always a 32-bit ARGB color that is independent of the source image format. Alpha is significant, and usually should be set to FF for opaque color keys. For example, for opaque black, the value is equal to 0xFF000000.
srcInformation Microsoft.DirectX.Direct3D.ImageInformation
An ImageInformation structure to fill with a description of the data in the source image file, or 0.

Remarks

This method supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. It handles conversion to and from compressed texture formats.

Writing to a non-level-zero surface of the volume texture does not cause the dirty rectangle to be updated. If FromFile is called and the texture is not already dirty (which is unlikely under normal usage scenarios), the application must explicitly call VolumeTexture.AddDirtyBox on the volume texture.

Exceptions

InvalidCallException

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

InvalidDataException

The data is invalid.

See Also