im trying to get just 1 pixels color from a surface in DX7 should i use the
getlockedpixel
or getlockedarray
DX4VB says getlockedarray is faster but im guessing that this is because you normally want to look at more that one pixel so my guess is getlockedpixel
also
VB Code:
Sub ProcessMemory Dim Colour as Long Dim rArea as RECT Dim ddsd as DDSURFACEDESC2 rArea.Bottom=480:rArea.Right=640 MainSurf.Lock rArea,ddsd, DDLOCK_WAIT,0 'We now have access to the memory. From now until the Unlock you are treading 'on thin ice...... 'These are our two commands. Colour=Mainsurf.GetLockedPixel(100,120) Mainsurf.SetLockedPixel(100,120,Colour+10) MainSurf.Unlock rArea End Sub
the rectangle rArea in this procedure, when you use it in the mainsurf.lock statement is just locking the part of the surface that is in the rectangle right ?
last of all,
at the end of mainsurf.lock what is the ,0 for?
thanks for all your help





Reply With Quote