RenderTarget2D Class
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Contains a 2D texture that can be used as a render target.
Inheritance Hierarchy
System.Object
Microsoft.Xna.Framework.Graphics.GraphicsResource
Microsoft.Xna.Framework.Graphics.Texture
Microsoft.Xna.Framework.Graphics.Texture2D
Microsoft.Xna.Framework.Graphics.RenderTarget2D
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in Microsoft.Xna.Framework.Graphics.dll)
Syntax
'Declaration
Public Class RenderTarget2D _
Inherits Texture2D
public class RenderTarget2D : Texture2D
The RenderTarget2D type exposes the following members.
Constructors
Name | Description | |
---|---|---|
RenderTarget2D(GraphicsDevice, Int32, Int32) | Creates an instance of this object. | |
RenderTarget2D(GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat, DepthFormat) | Creates an instance of this object. | |
RenderTarget2D(GraphicsDevice, Int32, Int32, Boolean, SurfaceFormat, DepthFormat, Int32, RenderTargetUsage) | Creates an instance of this object. |
Top
Properties
Name | Description | |
---|---|---|
Bounds | Gets the size of this resource. (Inherited from Texture2D.) | |
DepthStencilFormat | Gets the data format for the depth stencil data. | |
Format | Gets the format of the texture data. (Inherited from Texture.) | |
Height | Gets the height of this texture resource, in pixels. (Inherited from Texture2D.) | |
IsDisposed | Gets a value that indicates whether the object is disposed. (Inherited from GraphicsResource.) | |
LevelCount | Gets the number of texture levels in a multilevel texture. (Inherited from Texture.) | |
MultiSampleCount | Determines if the index buffer data has been lost due to a lost device event. | |
RenderTargetUsage | Gets or sets the render target usage. | |
Width | Gets the width of this texture resource, in pixels. (Inherited from Texture2D.) |
Top
Methods
Name | Description | |
---|---|---|
Dispose() | Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.) | |
Dispose(Boolean) | Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.) | |
Finalize | Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object. (Inherited from GraphicsResource.) | |
SetData<T>(array<T[]) | Sets 2D texture data. (Inherited from Texture2D.) | |
SetData<T>(array<T[], Int32, Int32) | Sets 2D texture data, specifying a start index, and number of elements. (Inherited from Texture2D.) | |
SetData<T>(Int32, Nullable<Rectangle>, array<T[], Int32, Int32) | Sets 2D texture data, specifying a mipmap level, source rectangle, start index, and number of elements. (Inherited from Texture2D.) |
Top
Version Information
Silverlight
Supported in: 5
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.