Device.CreateRenderTarget(Int32,Int32,Format,MultiSampleType,Int32,Boolean) Method (Microsoft.DirectX.Direct3D)

Creates a render target surface.


Visual BasicPublic Function CreateRenderTarget( _
    ByVal width As Integer, _
    ByVal height As Integer, _
    ByVal format As Format, _
    ByVal multiSample As MultiSampleType, _
    ByVal multiSampleQuality As Integer, _
    ByVal lockable As Boolean _
) As Surface
C#public Surface CreateRenderTarget(
    int width,
    int height,
    Format format,
    MultiSampleType multiSample,
    int multiSampleQuality,
    bool lockable
    int width,
    int height,
    Format format,
    MultiSampleType multiSample,
    int multiSampleQuality,
    bool lockable
JScriptpublic function CreateRenderTarget(
    width : int,
    height : int,
    format : Format,
    multiSample : MultiSampleType,
    multiSampleQuality : int,
    lockable : boolean
) : Surface;


width System.Int32
Width of the render-target surface in pixels.
height System.Int32
Height of the render-target surface in pixels.
format Microsoft.DirectX.Direct3D.Format
Member of the Format enumerated type that describes the format of the render target.
multiSample Microsoft.DirectX.Direct3D.MultiSampleType
Member of the MultiSampleType enumerated type that describes the multisampling buffer type. This parameter specifies the antialiasing type for the render target. When this surface is passed to Device.SetRenderTarget, its multisample type must be the same as that of the depth stencil property Device.DepthStencilSurface.
multiSampleQuality System.Int32
Quality level. The valid range is between 0 and one less than the level returned by the param_Int32R_qualityLevels parameter of the Manager.CheckDeviceMultiSampleType. Passing a larger value causes an InvalidCallException. The param_Int32_multiSampleQuality values of paired render targets, depth stencil surfaces, and the multisample type must all match.
lockable System.Boolean
Set to true if render targets are lockable; otherwise, false. Note that lockable render targets reduce performance on some graphics hardware.

Return Value


Render-target surfaces are placed in the Pool memory class.

The creation of lockable, multisampled render targets is not supported.

NotAvailableException The device does not support the queried multisample type.
InvalidCallException The method call is invalid. For example, a parameter might contain an invalid value.
OutOfVideoMemoryException Microsoft Direct3D does not have enough display memory to perform the operation.
OutOfMemoryExceptionLeave Site Direct3D could not allocate sufficient memory to complete the call.