Lock surface method

aps

Newcomer
Joined
Nov 3, 2003
Messages
3
Hello,

I am a newbie to directx in midst of an impossible project schedule, have been trying to find out what the array returned by lock surface is in directx 9 managed, but am not able to find out. Could some one help me out please.
 
If you use DirectDraw you lock surface with this
Dim dati As Integer(,)

Dim i As Integer
Dim j As Integer

dati = CType(superficie.Lock(LockFlags.Wait), Integer(,))

superficie.Unlock(dati)
where superficie is the surface and dati is an array(,) of integer
the dimensions of the array are the same of the surface. Every value is the color (use Color Class to convert).

With direct3D


Dim pitch As Integer
Dim dest As Byte() = CType(tex1.LockRectangle(GetType(Byte), 0, 0, pitch, dimeTot), Byte())


tex1.UnlockRectangle(0)

dimeTot is height x width x byte of color
with this you can lock surface and texture. Any modifies between lock and unlock 'll be save in the image
 
Directx lock method

Thanks, is the color array returned in 8 bits and the format ARGB

Aps
 
Back
Top