TextureLoader.FromVolumeFile(Device,String,Int32,Int32,Int32,Int32,Usage,Format,Pool,Filter,Filter,Int32,PaletteEntry) Method (Microsoft.DirectX.Direct3D)

Creates a volume texture from a file.

Definition

Visual Basic Public Shared Function FromVolumeFile( _
    ByVal device As Device, _
    ByVal srcFile As String, _
    ByVal width As Integer, _
    ByVal height As Integer, _
    ByVal depth As Integer, _
    ByVal mipLevels As Integer, _
    ByVal usage As Usage, _
    ByVal format As Format, _
    ByVal pool As Pool, _
    ByVal filter As Filter, _
    ByVal mipFilter As Filter, _
    ByVal colorKey As Integer, _
    ByRef palette As PaletteEntry _
) As VolumeTexture
C# public static VolumeTexture FromVolumeFile(
    Device device,
    string srcFile,
    int width,
    int height,
    int depth,
    int mipLevels,
    Usage usage,
    Format format,
    Pool pool,
    Filter filter,
    Filter mipFilter,
    int colorKey,
    out PaletteEntry palette
);
C++ public:
static VolumeTextureFromVolumeFile(
    Devicedevice,
    StringLeave SitesrcFile,
    int width,
    int height,
    int depth,
    int mipLevels,
    Usage usage,
    Format format,
    Pool pool,
    Filter filter,
    Filter mipFilter,
    int colorKey,
    [Out] PaletteEntrypalette
);
JScript public static function FromVolumeFile(
    device : Device,
    srcFile : String,
    width : int,
    height : int,
    depth : int,
    mipLevels : int,
    usage : Usage,
    format : Format,
    pool : Pool,
    filter : Filter,
    mipFilter : Filter,
    colorKey : int,
    palette : PaletteEntry
) : VolumeTexture;

Parameters

device Microsoft.DirectX.Direct3D.Device
A Device object that represents the device to associate with the volume texture.
srcFile System.String
String that specifies the file name.
width System.Int32
Width in pixels. If this value is 0, the dimensions are taken from the file. The maximum dimension that a driver supports (for width, height, and depth) can be found in the Caps.MaxVolumeExtent property.
height System.Int32
Height in pixels. If this value is 0, the dimensions are taken from the file. The maximum dimension that a driver supports (for width, height, and depth) can be found in the Caps.MaxVolumeExtent property.
depth System.Int32
Depth in pixels. If this value is 0, the dimensions are taken from the file. The maximum dimension that a driver supports (for width, height, and depth) can be found in the Caps.MaxVolumeExtent property.
mipLevels System.Int32
Number of mip levels requested. If this value is 0, a complete mipmap chain is created.
usage Microsoft.DirectX.Direct3D.Usage
Zero or Usage.RenderTarget, or Usage.Dynamic. Setting this flag to Usage.RenderTarget indicates that the surface will used as a render target. The resource can then be passed to the param_Surface_renderTarget parameter of the Device.SetRenderTarget method. If Usage.RenderTarget is specified, the application should determine whether the device supports this operation by calling Manager.CheckDeviceFormat. The Usage.Dynamic value indicates that the surface should be handled dynamically.
format Microsoft.DirectX.Direct3D.Format
Member of the Format enumerated type that describes the requested pixel format for the cube texture. The returned cube texture might have a different format from that specified by param_Format_format. Applications should check the format of the returned cube texture. If param_Format_format is Unknown, the format is taken from the file.
pool Microsoft.DirectX.Direct3D.Pool
Member of the Pool enumerated type that describes the memory class into which the cube texture should be placed.
filter Microsoft.DirectX.Direct3D.Filter
One or more Filter flags that control how the image is filtered.
mipFilter Microsoft.DirectX.Direct3D.Filter
One or more Filter flags that control how the mipmaps are filtered. In addition, use bits 27-31 to specify the number of mip levels to be skipped (from the top of the mipmap chain) when a .dds texture is loaded into memory; this allows you to skip up to 32 levels.
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.
palette Microsoft.DirectX.Direct3D.PaletteEntry[]
Array of PaletteEntry structures that represent a 256-color palette to fill in.

Return Value

Microsoft.DirectX.Direct3D.VolumeTexture
Address of a pointer to a VolumeTexture object that represents the created texture object.

Remarks

This method supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga.

Each level of a mipmapped texture is automatically filled with the loaded volume texture. When loading images into mipmapped textures, some devices are unable to switch to a 1x1 image. If this happens, the method fails, and the images must be loaded manually.

Exceptions

InvalidCallException

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

InvalidDataException

The data is invalid.

NotAvailableException

This device does not support the queried technique.

OutOfVideoMemoryException

Microsoft Direct3D does not have enough display memory to perform the operation.

OutOfMemoryExceptionLeave Site

Direct3D could not allocate sufficient memory to complete the call.

See Also