Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- CoordMode,mouse,screen
- #Include,<hellbents_gdip>
- SetBatchLines,-1
- #MaxHotkeysPerInterval,10000000000
- popUp:=Layered_Window_SetUp(4,0,0,A_ScreenWidth,A_ScreenHeight,1,"Alwaysontop")
- map:=Gdip_CreateBitmapFromFile("ninja.png")
- gdip_GetImageDimensions(map, w, h)
- ;~ Gdip_DrawImage(popup.g, map,0,0,w,h)
- ArrayxMinMax:=[]
- a:={min:-1,max:-1}
- loop % h {
- y:=A_Index - 1
- t:=0
- ArrayxMinMax.insert(a.clone())
- loop % w {
- x:=A_Index - 1
- if(Gdip_GetPixel(map, x, y)<>0){
- ArrayxMinMax[y].min:=x
- break
- }
- }
- loop % w {
- x:=W - A_Index
- if(Gdip_GetPixel(map, x, y)<>0){
- ArrayxMinMax[y].mAX:=x
- break
- }
- }
- }
- map2:=Gdip_CreateBitmap(W, H)
- g2:=Gdip_GraphicsFromImage(map2)
- for i,y in ArrayxMinMax {
- fill_boxx(g2,"0000ff",y.min,i,y.max - y.min + 1, 1)
- }
- Gdip_DrawImage(popup.g, map2,0,0,w,h)
- ;~ Gdip_GraphicsClear(popUp.g)
- UpdateLayeredWindow(popUp.hwnd, popUp.hdc, popUp.x, popUp.y, popUp.w, popUp.h)
- ;~ SoundBeep
- ;~ SetTimer,checkrgb,10
- return
- checkrgb:
- MouseGetPos,x,y
- ToolTip,% x " " y "`n" Gdip_GetPixel(map, x, y)
- return
- x::
- Layered_Window_ShutDown(popUp)
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement