CubeTexture.LockRectangle(Type,CubeMapFace,Int32,Rectangle,LockFlags,Int32,Int32[]) Method (Microsoft.DirectX.Direct3D)

Locks a rectangle on a cube texture resource.


Visual Basic Public Function LockRectangle( _
    ByVal typeLock As TypeLeave Site, _
    ByVal faceType As CubeMapFace, _
    ByVal level As Integer, _
    ByVal rect As RectangleLeave Site, _
    ByVal flags As LockFlags, _
    ByRef pitch As Integer, _
    ByVal ranks() As Integer _
) As ArrayLeave Site
C# public ArrayLeave Site LockRectangle(
    TypeLeave Site typeLock,
    CubeMapFace faceType,
    int level,
    RectangleLeave Site rect,
    LockFlags flags,
    out int pitch,
    int[] ranks
C++ public:
ArrayLeave SiteLockRectangle(
    TypeLeave SitetypeLock,
    CubeMapFace faceType,
    int level,
    RectangleLeave Site rect,
    LockFlags flags,
    [Out] intpitch,
    array<int>^ ranks
JScript public function LockRectangle(
    typeLock : TypeLeave Site,
    faceType : CubeMapFace,
    level : int,
    rect : RectangleLeave Site,
    flags : LockFlags,
    pitch : int,
    ranks : int[]
) : ArrayLeave Site;


typeLock System.Type
A TypeLeave Site object that indicates the type of array data to return. This can be a value type or any type that contains only value types.
faceType Microsoft.DirectX.Direct3D.CubeMapFace
Member of the CubeMapFace enumerated type that identifies a cube map face.
level System.Int32
Level of a cube texture.
rect System.Drawing.Rectangle
A RectangleLeave Site to lock. To expand the dirty region to cover the entire cube texture, omit this parameter.
flags Microsoft.DirectX.Direct3D.LockFlags
Zero or more LockFlags enumerated values that describe the type of lock to perform.
pitch System.Int32
Pitch of the returning data.
ranks System.Int32[]
Array of 1 to 3 Int32Leave Site values that indicate the dimensions of the returning ArrayLeave Site.

Return Value

An ArrayLeave Site that represents the locked rectangle.


For performance reasons, dirty regions are recorded only for level 0 of a texture. Dirty regions are automatically recorded when CubeTexture.LockRectangle is called without NoDirtyUpdate or ReadOnly. For more information, see Device.UpdateTexture.

Cube textures created with Default are not lockable. Cube textures created in video memory are lockable when created with Usage.Dynamic. For more information about usages, see Dynamic.

The only lockable format for a depth stencil texture is Format.D16Lockable.

See Also