Screen clipping

Post your working scripts, libraries and tools
mankvl
Posts: 8
Joined: 23 Sep 2016, 03:58

Re: Screen clipping

06 Sep 2017, 03:55

I'am having problems with

Code: [Select all] [Download] GeSHi © Codebox Plus

SCW_LBUTTONDOWN()
function, I added all SCW functions to my lib folder (file named SCW.ahk) when I run my main script it's included automatically as I understand. But it always runs that function after every hotkey. Maybe i need to have this function in the main script? or change smth to stop always being used?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



the log always shows

Code: [Select all] [Download] GeSHi © Codebox Plus

227: if (x > XClose &&  y < YClose)  
228: Gui,%A_Gui%: Destroy
229: Return,1 (2.06)
218: MouseGetPos,,,WinUMID
219: WinGetTitle,Title,ahk_id %WinUMID%
220: if Title = ScreenClippingWindow
231: } (2.81)


and this par never stops or returns

Code: [Select all] [Download] GeSHi © Codebox Plus

218: MouseGetPos,,,WinUMID
219: WinGetTitle,Title,ahk_id %WinUMID%
220: if Title = ScreenClippingWindow
need4speed
Posts: 38
Joined: 22 Apr 2016, 06:50

Re: Screen clipping

19 Oct 2017, 04:31

How to set transparency of the screenshots?
In order to compare screenshots I overlay them and set the topmost semi-transparent.
Unfortunatelly this code works only with standard Windows but not with screenshots created by the ScreenClipping script:
Could anyone adjust the code?
Or even better, if more ppl are longing for transparent screenshots,
maybe someone could incorporate transparency natively in the main script?!? Cheers.
User avatar
king-of-hearts
Posts: 27
Joined: 01 Oct 2017, 06:29

Re: Screen clipping

21 Oct 2017, 08:12

I was searching this for days!! Thank you guys! So Awesome!

Im using Joe Glines version btw
https://autohotkey.com/boards/viewtopic.php?f=6&t=38707 - MS Access Manager - SQL Query: Incredible tool for MS Access/SQL Queries on the fly!!
User avatar
Delta Pythagorean
Posts: 332
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Equestria

Re: Screen clipping

23 Oct 2017, 07:50

I would upload my version of a screen clipping script but I'm afraid I'm at work :lol:
need4speed
Posts: 38
Joined: 22 Apr 2016, 06:50

Re: Screen clipping

25 Oct 2017, 16:04

Hey Delta, what is your version about and is it any better than Joes?
FanaticGuru
Posts: 803
Joined: 30 Sep 2013, 22:25

Re: Screen clipping

25 Oct 2017, 17:00

Below is my version. I had more plans for it that I never implemented once I got it to the point that I started using it. For one I wanted to be able to minimize and restore clips but never got around to doing.

The main differences are:
  • dynamically created help menu
  • settings Gui
  • ability to create a PDF from clipping if you have Acrobat installed
  • right click menu for clippings (the ton of different hotkey combinations got too much to remember)
  • ability to save clippings and PDFs to a folder automatically
  • cleaned up a lot of the code and made it more modular
  • other stuff I probably forgot

I use this quite a bit.
The ability to just create a clip to 'memorize' something on the screen is handy.
Clipping and pasting images then in other programs like Outlook and Word.
Clipping to a PDF that is then easy to print with comments.

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus


FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
User avatar
Delta Pythagorean
Posts: 332
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Equestria

Re: Screen clipping

27 Oct 2017, 07:24

This is my version of screen clipping:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



The script should explain most of it...
need4speed
Posts: 38
Joined: 22 Apr 2016, 06:50

Re: Screen clipping

28 Oct 2017, 16:19

thanks for posting, i prefer though the OP script.
unfortunately changing the screenshot transparency does not work, why?

Code: [Select all] [Download] GeSHi © Codebox Plus

^!RButton::
WinGet, currentTransparency, Transparent, A
if (currentTransparency = 150)
{
WinSet, Transparent, OFF, A
}
else
{
WinSet, Transparent, 150, A
}
return
User avatar
Delta Pythagorean
Posts: 332
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Equestria

Re: Screen clipping

29 Oct 2017, 15:16

need4speed wrote:thanks for posting, i prefer though the OP script.
unfortunately changing the screenshot transparency does not work, why?


Changing the transparency of the window, doesn't change the transparency of the screenshot. That, you'd have to use GDip to change it.
euras
Posts: 265
Joined: 05 Nov 2015, 12:56

Re: Screen clipping

03 Nov 2017, 02:50

Joe Glines wrote:@tervon - Thanks for those ideas! I added them to mine (not that clicking in upper right is a pain, but definitely nice to have the other options)

I also added the saving option/function you had (although I might monkey with the date_format of the file)
Cool adds! Thanks!
:dance:


Hi Joe,
I'm trying to adapt your code to my own, but I get a problem. I changed hotkey in your code to Mbutton::SCW_ScreenClip2Win(clip:=1,email:=0) and try to automate those click and drags in another code like:

Code: [Select all] [Download] GeSHi © Codebox Plus

MouseClickDrag, Middle, 267, 115, 392, 250, 15

but it doesn't work. If I do it manually, then your code works and clips the screen. If I try to automate that clipping, nothing happens.. Where is the problem?
User avatar
Joe Glines
Posts: 483
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: Screen clipping

03 Nov 2017, 05:47

Hi euras,
Sorry, I'm not understanding what you're doing. What I recommend is you first just change the hotkey and see if it still triggers the rectangle that captures the screen. (I tried "Mbutton::SCW_ScreenClip2Win(clip:=1,email:=0)" and it worked for me. I don't understand what you're doing with MouseClickDrag.
Regards,
Joe
euras
Posts: 265
Joined: 05 Nov 2015, 12:56

Re: Screen clipping

03 Nov 2017, 06:17

Joe Glines wrote:Hi euras,
Sorry, I'm not understanding what you're doing. What I recommend is you first just change the hotkey and see if it still triggers the rectangle that captures the screen. (I tried "Mbutton::SCW_ScreenClip2Win(clip:=1,email:=0)" and it worked for me. I don't understand what you're doing with MouseClickDrag.
Regards,
Joe

sorry, I maybe not explained it well. I start your code as a separate code but I have changed activating combination to Mbutton::SCW_ScreenClip2Win(clip:=1,email:=0). If I click & hold middle mouse button and move the mouse, then I select area which I want to clip and get that picture in my Clippboard. So far so good. But then I start another code which has the function MouseClickDrag so I set coordination's which area I want to select and get a picture of that area. But it looks like MouseClickDrag and the real mouse click and drag is not the same thing, because MouseClickDrag does not activate your code. So I get nothing here...
User avatar
Joe Glines
Posts: 483
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: Screen clipping

03 Nov 2017, 06:29

I don't use mouseclickdrag... I'd just research that command and see where people have reported a similar issue.

Did you test your mouseclickdrag w/o using my script? Are you sure you're calling it correctly? Try changing it to left click (and update my script to use left click).
euras
Posts: 265
Joined: 05 Nov 2015, 12:56

Re: Screen clipping

03 Nov 2017, 06:48

Joe Glines wrote:I don't use mouseclickdrag... I'd just research that command and see where people have reported a similar issue.

Did you test your mouseclickdrag w/o using my script? Are you sure you're calling it correctly? Try changing it to left click (and update my script to use left click).


I already did it with Left click, but it doesn't work.
Why I'm using MouseClickDrag? Let's say there is a code, which goes to some pages and clip some areas from those pages. Since I know which areas the code should clip, I can automate those mouse movements with MouseClickDrag instead of doing it self. But the problem is that MouseClickDrag command doesn't awake your code...
Maybe I don't know how to awake other command from other code? Right now I just activate both codes (your and mine) and add a line in my code MouseClickDrag, middle. Is it not enough? Should I connect those two codes somehow?
User avatar
Joe Glines
Posts: 483
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: Screen clipping

03 Nov 2017, 07:09

Well, depending how savvy you are, you could "butcher" my code (which is really someone else's) and bypass having the hotkey entirely. I know I saw other scripts that already were set up for this. It is probably a smarter approach than trying to get the two to work together. Basically in your first code you'd just pass the coordinates you want to grab to the screen-clipping code.
need4speed
Posts: 38
Joined: 22 Apr 2016, 06:50

Re: Screen clipping

10 Nov 2017, 05:14

Changing the transparency of the window, doesn't change the transparency of the screenshot. That, you'd have to use GDip to change it.
Isn't Gdip already incorporated in the script?

another thing. although border is turned off

Code: [Select all] [Download] GeSHi © Codebox Plus

^c::SCW_Win2Clipboard(0)  ; copy selected win to clipboard  Change to (1) if want border
^s:: SCW_Win2File(0) ;save selected clipping on desktop as timestamp named .png ; this was submited by tervon
sometimes the border is still visible when copied/saved.

anyone else having this issue? :wave:
and anyone willig to fix the bug? :roll:
User avatar
Joe Glines
Posts: 483
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: Screen clipping

10 Nov 2017, 05:54

In the initial script I created I worked through and found each particular function from GDIP that was used and pulled it into my script. (so the file size was smaller and I didn't have to tell people to include the library).

I think Delta Pythagorean point is that you'd have to make adjustments to the transparency by using GDIP (which means you might need to include the library and make some additional changes).

As for the border being visible- I used to notice that but I believe when you paste it, the border isn't there so I never cared to track it down.
need4speed
Posts: 38
Joined: 22 Apr 2016, 06:50

Re: Screen clipping

10 Nov 2017, 17:16

the border is visible sometimes, in this case after saving the file to the desktop then pasting it:
Image
FanaticGuru
Posts: 803
Joined: 30 Sep 2013, 22:25

Re: Screen clipping

10 Nov 2017, 18:54

need4speed wrote:the border is visible sometimes, in this case after saving the file to the desktop then pasting it:

You might try my version. It seems like I remember streamlining some stuff having to do with the border. Been months since I looked at the code through.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
User avatar
tank
Posts: 2184
Joined: 28 Sep 2013, 22:15
Facebook: charlie.simmons.7334
Google: ttnnkkrr
GitHub: ttnnkkrr
Location: Louisville KY
Contact:

Re: Screen clipping

15 Nov 2017, 10:16

Very cool, I take dozens of screen clips a day with snippet but will use this instead
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
https://www.facebook.com/ahkscript.org
If you have forum suggestions please submit a pull request

Return to “Scripts and Functions”

Who is online

Users browsing this forum: fenchai and 10 guests