Export (0) Print
Expand All

Texture2D Class

Represents a 2D grid of texels.

Namespace:  Microsoft.Xna.Framework.Graphics
Assembly:  Microsoft.Xna.Framework.Graphics (in Microsoft.Xna.Framework.Graphics.dll)

public class Texture2D : Texture

The Texture2D type exposes the following members.

  NameDescription
Public methodTexture2D(GraphicsDevice, Int32, Int32)Creates a new instance of this object.
Public methodTexture2D(GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat)Creates a new instance of this object.
Top

  NameDescription
Public propertyBoundsGets the size of this resource.
Public propertyFormatGets the format of the texture data. (Inherited from Texture.)
Public propertyHeightGets the height of this texture resource, in pixels.
Public propertyIsDisposedGets a value that indicates whether the object is disposed. (Inherited from GraphicsResource.)
Public propertyLevelCountGets the number of texture levels in a multilevel texture. (Inherited from Texture.)
Public propertyWidthGets the width of this texture resource, in pixels.
Top

  NameDescription
Public methodDispose()Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.)
Protected methodDispose(Boolean)Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.)
Protected methodFinalizeAllows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object. (Inherited from GraphicsResource.)
Public methodSetData<T>(T[])Sets 2D texture data.
Public methodSetData<T>(T[], Int32, Int32)Sets 2D texture data, specifying a start index, and number of elements.
Public methodSetData<T>(Int32, Nullable<Rectangle>, T[], Int32, Int32)Sets 2D texture data, specifying a mipmap level, source rectangle, start index, and number of elements.
Top

A texel represents the smallest unit of a texture that can be read from or written to by the GPU. A texel is composed of 1 to 4 components. Specifically, a texel may be any one of the available texture formats represented in the SurfaceFormat enumeration.

A Texture2D resource contains a 2D grid of texels. Each texel is addressable by a u, v vector. Since it is a texture resource, it may contain mipmap levels.

Silverlight

Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2015 Microsoft