Code:
; Glaze Function
Glaze proc uses edi esi hDC:DWORD,imageX:DWORD,imageY:DWORD
LOCAL rect:RECT
LOCAL red:DWORD
LOCAL green:DWORD
LOCAL blue:DWORD
LOCAL red2:DWORD
LOCAL green2:DWORD
LOCAL blue2:DWORD
LOCAL red3:DWORD
LOCAL green3:DWORD
LOCAL blue3:DWORD
mov edi,imageX
dec edi
mov esi,imageY
dec esi
.REPEAT
.REPEAT
invoke GetPixel,hDC,edi,esi
; This gets only the Alpha value back in EAX discarding the rest
;and eax,0FF000000h
;shr eax,24
mov edx,eax
; RED
and eax,00FF0000h
shr eax,16
mov red,eax
mov eax,edx
; BLUE
and eax,00FF0000h
mov blue,eax
mov eax,edx
; GREEN
and eax,0000FF00h
mov green,eax
dec edi
dec esi
invoke GetPixel,hDC,edi,esi
mov edx,eax
; RED
and eax,00FF0000h
shr eax,16
mov red2,eax
mov eax,edx
; BLUE
and eax,00FF0000h
mov blue2,eax
mov eax,edx
; GREEN
and eax,0000FF00h
mov green2,eax
mov edx,red
sub edx,red2
mov red3,edx
mov edx,green
sub edx,green2
mov green3,edx
mov edx,blue
sub edx,blue2
mov blue3,edx
add red3,128
add green3,128
add blue3,128
mov ecx,red3
add ecx,green3
add ecx,blue3
mov al,cl
shl eax,8
mov al,cl
shl eax,8
mov al,cl
invoke SetPixelV,hDC,edi,esi,eax
inc edi
dec esi
.UNTIL SIGN?
mov esi,imageY
dec esi
dec edi
.UNTIL SIGN?
ret
Glaze endp
If you compile it into a DLL you can use it in VB..