Reading all or some on screen pixels
Posted: Tue Sep 17, 2013 4:53 am
I'm trying to read pixels using GetDIBits() and BltBit() at a reasonably fast speed(faster than getpixel()) but I can't seem to get it working.
I'm having issues getting the area I want to search into memory to read through. Can anyone offer some insight? Here's my last failed attempt...
I'm having issues getting the area I want to search into memory to read through. Can anyone offer some insight? Here's my last failed attempt...
Code: Select all
dc = GetDC_(0)
ndc = CreateCompatibleDC_(dc)
*buffer = AllocateMemory(400*400)
bmi.BITMAPINFO
bmi\bmiHeader\biSize = SizeOf(BITMAPINFOHEADER)
bmi\bmiHeader\biWidth = 400
bmi\bmiHeader\biHeight = 400
bmi\bmiHeader\biPlanes = 1
bmi\bmiHeader\biBitCount = 32
bmi\bmiHeader\biCompression = #BI_RGB
Debug GetDIBits_(dc, ndc, 0, 400, *buffer, bmi, #DIB_RGB_COLORS)
For x = 0 To 30
Debug PeekL(*buffer + x)
Next x