Advertisement
pastamaker

silhouette v1.1

Jun 24th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5. CoordMode,mouse,screen
  6.  #Include,<hellbents_gdip>
  7.  SetBatchLines,-1
  8.  #MaxHotkeysPerInterval,10000000000
  9.  popUp:=Layered_Window_SetUp(4,0,0,A_ScreenWidth,A_ScreenHeight,1,"Alwaysontop")
  10.  
  11.  
  12. map:=Gdip_CreateBitmapFromFile("ninja.png")
  13. gdip_GetImageDimensions(map,  w,  h)
  14. ;~ Gdip_DrawImage(popup.g, map,0,0,w,h)
  15. ArrayxMinMax:=[]
  16. a:={min:-1,max:-1}
  17. loop % h {
  18.     y:=A_Index - 1
  19.     t:=0
  20.     ArrayxMinMax.insert(a.clone())
  21.     loop % w {
  22.         x:=A_Index - 1
  23.         if(Gdip_GetPixel(map, x, y)<>0){
  24.             ArrayxMinMax[y].min:=x
  25.             break
  26.         }
  27.     }
  28.     loop % w {
  29.         x:=W - A_Index
  30.         if(Gdip_GetPixel(map, x, y)<>0){
  31.             ArrayxMinMax[y].mAX:=x
  32.             break
  33.         }
  34.     }
  35. }
  36. map2:=Gdip_CreateBitmap(W, H)
  37. g2:=Gdip_GraphicsFromImage(map2)
  38. for i,y in ArrayxMinMax {
  39.     fill_boxx(g2,"0000ff",y.min,i,y.max - y.min + 1, 1)
  40. }
  41. Gdip_DrawImage(popup.g, map2,0,0,w,h)
  42.  ;~ Gdip_GraphicsClear(popUp.g)
  43.  
  44.  
  45.  
  46.  UpdateLayeredWindow(popUp.hwnd, popUp.hdc, popUp.x, popUp.y, popUp.w, popUp.h)
  47. ;~ SoundBeep
  48.  ;~ SetTimer,checkrgb,10
  49.  
  50.  
  51.  return
  52.  checkrgb:
  53. MouseGetPos,x,y
  54.  
  55. ToolTip,%  x " " y "`n" Gdip_GetPixel(map, x, y)
  56.  
  57.  return
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  x::
  64.  Layered_Window_ShutDown(popUp)
  65.  ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement