다음을 통해 공유


TextureLoader.FromStream Method (Device, Stream, Int32, Int32, Int32, Int32, Usage, Format, Pool, Filter, Filter, Int32, array<PaletteEntry[]%)

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

Creates a texture with the specified properties, including the color palette, from a file in memory.

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

Syntax

'Declaration
Public Shared Function FromStream ( _
    device As Device, _
    stream As Stream, _
    readBytes As Integer, _
    width As Integer, _
    height As Integer, _
    mipLevels As Integer, _
    usage As Usage, _
    format As Format, _
    pool As Pool, _
    filter As Filter, _
    mipFilter As Filter, _
    colorKey As Integer, _
    <OutAttribute> ByRef palette As PaletteEntry() _
) As Texture
'Usage
Dim device As Device
Dim stream As Stream
Dim readBytes As Integer
Dim width As Integer
Dim height As Integer
Dim mipLevels As Integer
Dim usage As Usage
Dim format As Format
Dim pool As Pool
Dim filter As Filter
Dim mipFilter As Filter
Dim colorKey As Integer
Dim palette As PaletteEntry()
Dim returnValue As Texture

returnValue = TextureLoader.FromStream(device, _
    stream, readBytes, width, height, _
    mipLevels, usage, format, pool, filter, _
    mipFilter, colorKey, palette)
public static Texture FromStream(
    Device device,
    Stream stream,
    int readBytes,
    int width,
    int height,
    int mipLevels,
    Usage usage,
    Format format,
    Pool pool,
    Filter filter,
    Filter mipFilter,
    int colorKey,
    out PaletteEntry[] palette
)
public:
static Texture^ FromStream(
    Device^ device, 
    Stream^ stream, 
    int readBytes, 
    int width, 
    int height, 
    int mipLevels, 
    Usage usage, 
    Format format, 
    Pool pool, 
    Filter filter, 
    Filter mipFilter, 
    int colorKey, 
    [OutAttribute] array<PaletteEntry>^% palette
)
static member FromStream : 
        device:Device * 
        stream:Stream * 
        readBytes:int * 
        width:int * 
        height:int * 
        mipLevels:int * 
        usage:Usage * 
        format:Format * 
        pool:Pool * 
        filter:Filter * 
        mipFilter:Filter * 
        colorKey:int * 
        palette:PaletteEntry[] byref -> Texture 

Parameters

  • readBytes
    Type: System.Int32
    The size, in bytes, of the file in memory.
  • width
    Type: System.Int32
    The width in pixels. If this value is 0 (zero), the dimensions are taken from the file.
  • height
    Type: System.Int32
    The height in pixels. If this value is 0 (zero), the dimensions are taken from the file.
  • mipLevels
    Type: System.Int32
    The number of mip levels requested. If this value is 0 (zero), a complete mipmap chain is created.
  • colorKey
    Type: System.Int32
    A value to replace with transparent black, or 0 (zero) to disable the color key. colorKey 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.

Return Value

Type: Microsoft.WindowsMobile.DirectX.Direct3D.Texture
The created texture object.

Exceptions

Exception Condition
InvalidCallException

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

OutOfMemoryException

Direct3D could not allocate sufficient memory to complete the call.

Remarks

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

.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

FromStream Overload

Microsoft.WindowsMobile.DirectX.Direct3D Namespace