Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MD5 hash of the clipboard (image on screen)
#2
All in single function.

Member function str.ScreenRectMD5
Code:
Copy      Help
function! RECT&r

;Calculates MD5 of pixels in specified rectangle on screen, and stores into this str variable as hex string.
;Returns 1 if successful, 0 if fails.

;EXAMPLE
;RECT r
;r.left=10; r.top=10; r.right=100; r.bottom=100
;str md5
;md5.ScreenRectMD5(r)
;out md5


;copy the rectangle from screen to memory dc
int wid(r.right-r.left) hei(r.bottom-r.top)
int dc=GetDC(0)
__MemBmp mb.Create(wid hei dc r.left r.top)
ReleaseDC 0 dc

;get pixel colors
_s.all(wid*hei*4 2)
BITMAPINFOHEADER h.biSize=sizeof(h)
h.biBitCount=32; h.biWidth=wid; h.biHeight=-hei; h.biPlanes=1
if(GetDIBits(mb.dc mb.bm 0 hei _s +&h DIB_RGB_COLORS)!=hei) ret

;md5
this.encrypt(10 _s)
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)