Texture2D Constructor (GraphicsDevice, Int32, Int32)

Creates a new instance of this object.

Syntax

'Declaration
Public Sub New ( _
         graphicsDevice As GraphicsDevice, _
         width As Integer, _
         height As Integer _
)
public Texture2D (
         GraphicsDevice graphicsDevice,
         int width,
         int height
)
public:
Texture2D(
         GraphicsDevice graphicsDevice,
         int width,
         int height
)

Parameters

Exceptions

Exception type Condition
NotSupportedException One or more of the following is true:
  • The profile does not support the requested format.
  • The profile supports a maximum texture size of 2048.
  • The profile supports a maximum texture aspect ratio of 2048.
  • The profile requires mipmapped texture size to be a power of two. To use a non power of two size, remove the mipmaps.
  • The profile requires DXT compressed texture size to be a power of two. To use a non power of two size, disable DXT compression.

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