Screen Clipper by LearningOne. Can we make standalone?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
iilabs
Posts: 296
Joined: 07 Jun 2020, 16:57

Re: Screen Clipper by LearningOne. Can we make standalone?

09 Nov 2020, 13:07

I have the code you shared with me a week ago. Sorry I am not sure how to to approach this. Would I use the GUI one for this? Can I paste the clipboard or %out% to GUI and resize as you suggest?

Code: Select all

F3::                                                 ;Hold F3 to make a selection, then release
{
MouseGetPos, x1, y1
SoundBeep, 1500, 20
KeyWait, %A_ThisHotkey%
SoundBeep, 1000, 20
MouseGetPos, x2, y2
width := x2 - x1, height := y2 - y1
If (width < 4 && height < 4)
 Return
pToken := Gdip_Startup(), snap := Gdip_BitmapFromScreen(x1 "|" y1 "|" width "|" height)
Gdip_SetBitmapToClipboard(snap), Gdip_SaveBitmapToFile(snap, out)
Gdip_DisposeImage(snap), Gdip_Shutdown(pToken)
;Run, %out%
}

Return
User avatar
mikeyww
Posts: 27162
Joined: 09 Sep 2014, 18:38

Re: Screen Clipper by LearningOne. Can we make standalone?

22 May 2021, 15:16

Example is below.

Code: Select all

#Include q:\vis2\lib\Gdip_All.ahk
out = %A_ScriptDir%\test.png

F3::
MouseGetPos, x1, y1
SoundBeep, 1500, 20
KeyWait, %A_ThisHotkey%
SoundBeep, 1000, 20
MouseGetPos, x2, y2
width := x2 - x1, height := y2 - y1
If (width < 4 && height < 4)
 Return
pToken := Gdip_Startup(), snap := Gdip_BitmapFromScreen(x1 "|" y1 "|" width "|" height)
Gdip_SetBitmapToClipboard(snap), Gdip_SaveBitmapToFile(snap, out)
Gdip_DisposeImage(snap), Gdip_Shutdown(pToken)
Gui, New
Gui, Add, Picture, w250 h-1, %out%
Gui, Show,, Screenshot
Return
This can also be done without using a file: https://www.autohotkey.com/boards/viewtopic.php?p=362354#p362354
User avatar
iilabs
Posts: 296
Joined: 07 Jun 2020, 16:57

Re: Screen Clipper by LearningOne. Can we make standalone?

23 May 2021, 20:11

Thank you Mikeyww,

Better late than never! Must be cleaning out your inbox.

Thanks for your dedicated help and support on the other script with the list box. Coming out great and very helpful!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: arrondark, Bing [Bot], koolestani, sn1perwild, TAC109 and 110 guests