RenderTarget2D Class (Microsoft.Xna.Framework.Graphics)


Namespace: Microsoft.Xna.Framework.Graphics
Assembly: MonoGame.Framework (MonoGame.Framework.dll 3.8.0.1082)
  • C#
  • VB
  • F#
public class RenderTarget2D : Texture2D, IRenderTarget

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.

The RenderTarget2D type exposes the following members.

  Platforms Name Description
Bounds Gets the dimensions of the texture (Inherited from Texture2D.)
DepthStencilFormat  
Format  (Inherited from Texture.)
GraphicsDevice  (Inherited from GraphicsResource.)
Height Gets the height of the texture in pixels. (Inherited from Texture2D.)
IsContentLost  
IsDisposed  (Inherited from GraphicsResource.)
LevelCount  (Inherited from Texture.)
Mipmap  (Inherited from Texture2D.)
MultiSampleCount  
Name  (Inherited from GraphicsResource.)
RenderTargetUsage  (Implements RenderTargetUsage().)
SampleDescription  (Inherited from Texture2D.)
Shared  (Inherited from Texture2D.)
Tag  (Inherited from GraphicsResource.)
Width Gets the width of the texture in pixels. (Inherited from Texture2D.)
Top
  Platforms Name Description
CreateSampleDescription  (Overrides Texture2D.CreateSampleDescription().)
CreateShaderResourceView  (Overrides Texture.CreateShaderResourceView().)
Dispose(bool) The method that derived classes should override to implement disposing of managed and native resources. (Overrides Texture2D.Dispose().)
Dispose()  (Inherited from GraphicsResource.)
Finalize  (Inherited from GraphicsResource.)
FromFile Creates a Texture2D from a file, supported formats bmp, gif, jpg, png, tif and dds (only for simple textures). May work with other formats, but will not work with tga files. This internally calls FromStream(GraphicsDevice, Stream). (Inherited from Texture2D.)
FromStream Creates a Texture2D from a stream, supported formats bmp, gif, jpg, png, tif and dds (only for simple textures). May work with other formats, but will not work with tga files. (Inherited from Texture2D.)
GetData<T>(T[], int, int) Retrieves the contents of the texture Throws ArgumentException if data is null, data.length is too short or if arraySlice is greater than 0 and the GraphicsDevice doesn't support texture arrays (Inherited from Texture2D.)
GetData<T>(int, Nullable<Rectangle>, T[], int, int) Retrieves the contents of the texture Throws ArgumentException if data is null, data.length is too short or if arraySlice is greater than 0 and the GraphicsDevice doesn't support texture arrays (Inherited from Texture2D.)
GetData<T>(int, int, Nullable<Rectangle>, T[], int, int) Retrieves the contents of the texture Throws ArgumentException if data is null, data.length is too short or if arraySlice is greater than 0 and the GraphicsDevice doesn't support texture arrays (Inherited from Texture2D.)
GetData<T>(T[]) Retrieves the contents of the texture Throws ArgumentException if data is null, data.length is too short or if arraySlice is greater than 0 and the GraphicsDevice doesn't support texture arrays (Inherited from Texture2D.)
GetSharedHandle Gets the handle to a shared resource. (Inherited from Texture.)
GetTexture2DDescription  (Overrides Texture2D.GetTexture2DDescription().)
GraphicsDeviceResetting Called before the device is reset. Allows graphics resources to invalidate their state so they can be recreated after the device reset. Warning: This may be called after a call to Dispose() up until the resource is garbage collected. (Overrides Texture.GraphicsDeviceResetting().)
QuerySelectedFormat  
Reload  (Inherited from Texture2D.)
SaveAsJpeg Converts the texture to a JPG image (Inherited from Texture2D.)
SaveAsPng Converts the texture to a PNG image (Inherited from Texture2D.)
SetData<T>(T[]) Changes the texture's pixels (Inherited from Texture2D.)
SetData<T>(T[], int, int) Changes the texture's pixels (Inherited from Texture2D.)
SetData<T>(int, Nullable<Rectangle>, T[], int, int) Changes the pixels of the texture (Inherited from Texture2D.)
SetData<T>(int, int, Nullable<Rectangle>, T[], int, int) Changes the pixels of the texture Throws ArgumentNullException if data is null Throws ArgumentException if arraySlice is greater than 0, and the GraphicsDevice does not support texture arrays (Inherited from Texture2D.)
ToString  (Inherited from GraphicsResource.)
Top
  Platforms Name Description
ContentLost  
Disposing  (Inherited from GraphicsResource.)
Top
Supported in:

    
 Windows DirectX Desktop
    
 Linux Desktop
    
 Windows OpenGL Desktop
    
 Web