Share via


TextureLoader.FromFile Method (Device, String)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Creates a texture from a file.

Namespace:  Microsoft.WindowsMobile.DirectX.Direct3D
Assembly:  Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)

Syntax

'Declaration
Public Shared Function FromFile ( _
    device As Device, _
    srcFile As String _
) As Texture
'Usage
Dim device As Device
Dim srcFile As String
Dim returnValue As Texture

returnValue = TextureLoader.FromFile(device, _
    srcFile)
public static Texture FromFile(
    Device device,
    string srcFile
)
public:
static Texture^ FromFile(
    Device^ device, 
    String^ srcFile
)
static member FromFile : 
        device:Device * 
        srcFile:string -> Texture 

Parameters

  • srcFile
    Type: System.String
    The name of the file from which to create the texture.

Return Value

Type: Microsoft.WindowsMobile.DirectX.Direct3D.Texture
A Texture that represents the created texture object.

Remarks

This method supports the following file formats: .bmp, .dds, .jpg, .png, and .gif.

To get the best performance with this method, consider the following:

  • Doing image scaling and format conversion at load time can be slow. Store images in the format and resolution in which they will be used. If the target hardware requires power-of-two dimensions, use power-of-two dimensions to create and store images.

  • For mipmap image creation at load time, filter by using the Box filter type. A box filter is much faster than some of the other filter types.

  • Consider using DirectDraw surface (DDS) files. Because DDS files can be used to represent any Microsoft DirectX texture format, they are easily read by this method. Also, they can store mipmaps, which means that any mipmap generation algorithm can be used to author the images.

.NET Framework Security

Platforms

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Compact Framework

Supported in: 3.5, 2.0

See Also

Reference

TextureLoader Class

TextureLoader Members

FromFile Overload

Microsoft.WindowsMobile.DirectX.Direct3D Namespace