|
-
Feb 6th, 2003, 10:25 PM
#1
Thread Starter
Hyperactive Member
which is faster
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
-
Feb 7th, 2003, 10:08 PM
#2
Thread Starter
Hyperactive Member
well i ended up useing getlockedpixel it seemed much more liekly to be the faster way sense i wasnt need a whole array of pixels
im still wandering what that ,0 is for thought??
thanks
-
Feb 10th, 2003, 10:20 AM
#3
Addicted Member
http://msdn.microsoft.com/library/de...urfacelock.asp
Handle to a system event that should be triggered when the surface is ready to be locked.
This is from DX9, but should still be the same since it hasn't changed from DX7. It wasn't used in DX7.
-
Feb 10th, 2003, 12:07 PM
#4
Good Ol' Platypus
Actually, it would be about the same. GetLockedPixel locks the surface, gets the pixel, and then unlocks it. GetLockedArray locks it, then you can get any number of pixels without a penalty, and then UnLock unlocks the surface. So, basically, it would be the same.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|