Texture2D.FromStream Method (GraphicsDevice, Stream)

Loads texture data from a stream.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Syntax

public static Texture2D FromStream (
         GraphicsDevice graphicsDevice,
         Stream stream
)

Parameters

  • graphicsDevice
    Type: GraphicsDevice
    A graphics device.
  • stream
    Type: Stream
    Data stream from one of the following file types: .gif, .jpg or .png.

Return Value

A 2D texture whose format is SurfaceFormat.Color and contains non-premultiplied alpha data.

See Also

Reference

Texture2D Class
Texture2D Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP