Boa tarde, estou com um problema em um script que estou tentando fazer....
Preciso que o auto hotkey tire print da tela, e salve a coordenada desejada, para mais para frente comparar a imagem e selecionar a opção correta.
Já fiz o script todo, falta somente a parte de tirar print da tela e salvar somente parte da print (como se fosse um recorte de imagem automatico)
Alguem tem alguma idéia do que posso usar???
Tirar print e salvar coordenada
Moderator: Gio
Re: Tirar print e salvar coordenada
queria algo como se fosse isso
printscreen, 563, 347 , 830, 479 , C:\Users\gg\Desktop\teste.png
printscreen, 563, 347 , 830, 479 , C:\Users\gg\Desktop\teste.png
Re: Tirar print e salvar coordenada
exemplo com 'irfanview'
exemplo-2
Code: Select all
;-https://www.irfanview.com/
#warn
#NoEnv
#Singleinstance,force
setworkingdir,%a_scriptdir%
;Coordmode,mouse,window
;--------------------------------------
!0:: ; press ALT+0 = whole desktop
!3:: ; press ALT+3 = active window
;---------------------------------------
Modus:= SubStr(A_ThisHotkey,2,1)
Destination=%a_desktop%\TEST_IRFAN
IfNotExist, %Destination%
FileCreateDir, %Destination%
F1=%destination%\%A_now%_teste.png
x:=563, y:=347 , w:=830, h:=479
PR=%A_ProgramFiles%\IrfanView\i_view64.exe
AA=/capture=%modus% /crop=(%x%,%y%,%w%,%h%) /convert=%F1%
runwait,%PR% %AA%
run,%F1%
return
esc::exitapp
;=============================================
Code: Select all
;- modified = 20210119
;- created = 20210118
;- https://www.irfanview.com/
;- this script save screen as picture jpg/png... ( crop )
#warn
#NoEnv
#Singleinstance,force
setworkingdir,%a_scriptdir%
;Coordmode,pixel,client
Coordmode,mouse,window
;----------------------------------------------------------
;- check if active window is really active if use modus 3
;--------------------------------------
!0:: ; press ALT+0 = whole window
!3:: ; press ALT+3 = active window
;-*~$printscreen:: ;- example when define modus 0 or 3
;---------------------------------------
Modus:= SubStr(A_ThisHotkey,2,1)
;--- calculate x y w h as procent ----------
wa:=A_screenwidth,ha:=A_screenHeight,xx:=100
if (modus=0) ;- whole screen
x:=(wa*40)//xx,y:=(ha*0)//xx,w:=(wa-x),h:=(ha*50)//xx
if (modus=3) ;- Active Window
{
WinGetPos,x1,y1,w1,h1,A
x:=((w1*40)//xx),y:=((h1*0)//xx),w:=w1-x,h:=(h1*50)//xx
;msgbox,X1=%x1% y1=%y1% w1=%w1% H1=%h1%`nX=%x% y=%y% w=%w% H=%h%
;return
}
Destination=%a_desktop%\TEST_IRFAN
IfNotExist, %Destination%
FileCreateDir, %Destination%
F1=%destination%\%A_now%_teste.jpg
PR=%A_ProgramFiles%\IrfanView\i_view64.exe
AA=/capture=%modus% /crop=(%x%,%y%,%w%,%h%) /convert=%F1%
runwait,%PR% %AA%
run,%F1%
return
esc::exitapp
;=============================================