Share via


Texture2D.FromStream Method (GraphicsDevice, Stream)

Loads texture data from a stream.

Syntax

'Declaration
Public Shared Function FromStream ( _
         graphicsDevice As GraphicsDevice, _
         stream As Stream _
) As Texture2D 
public static Texture2D FromStream (
         GraphicsDevice graphicsDevice,
         Stream stream
)
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

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

Requirements

Namespace: Microsoft.Xna.Framework.Graphics

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

See Also

Reference

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

Platforms

Windows Phone