packages/Windows API Code Pack 1.1/source/Samples/DirectX/CS/UtilitiesLibrary/D3DUtilities/Texture/TextureLoader.cs
/// <summary>
/// Creates a ShaderResourceView from a bitmap in a Stream. 
/// </summary>
/// <param name="device">The Direct3D device that will own the ShaderResourceView</param>
/// <param name="stream">Any Windows Imaging Component decodable image</param>
/// <returns>A ShaderResourceView object with the loaded texture.</returns>
Creates a ShaderResourceView from a bitmap in a Stream.
Creates a ShaderResourceView from a bitmap in a Stream .
public static ShaderResourceView LoadTexture( D3DDevice device, Stream stream )
        {
            ImagingFactory factory = ImagingFactory.Create();
            BitmapDecoder bitmapDecoder =
                factory.CreateDecoderFromStream(
                    stream,
                    DecodeMetadataCacheOption.OnDemand );
            return LoadFromDecoder(device, factory, bitmapDecoder);
        }
public static ShaderResourceView LoadTexture ( D3DDevice device , Stream stream ) { ImagingFactory factory = ImagingFactory . Create ( ) ; BitmapDecoder bitmapDecoder = factory . CreateDecoderFromStream ( stream , DecodeMetadataCacheOption . OnDemand ) ; return LoadFromDecoder ( device , factory , bitmapDecoder ) ; }
Creates a ShaderResourceView from a bitmap in a Stream.
Creates a ShaderResourceView from a bitmap in a Stream .
A ShaderResourceView object with the loaded texture.
A ShaderResourceView object with the loaded texture .
device
D3DDevice
The Direct3D device that will own the ShaderResourceView
The Direct3D device that will own the ShaderResourceView
stream
Stream
Any Windows Imaging Component decodable image
Any Windows Imaging Component decodable image