Snipper - Window Snipping Tool

Post your working scripts, libraries and tools.
neogna2
Posts: 598
Joined: 15 Sep 2016, 15:44

Re: Snipper - Window Snipping Tool

09 Jan 2024, 17:12

FanaticGuru wrote:
09 Jan 2024, 16:09
Kind of sad there is not a rock solid Gdip v2 out there. I have searched and every one I have found has numerous conversion bugs. It is one reason I created the class of select Gdip functions used in Snipper.
Maybe the most recently updated version of v2 gdip_all.ahk is this one (updated 5 months ago)
https://github.com/buliasz/AHKv2-Gdip
https://github.com/buliasz/AHKv2-Gdip/blob/master/CHANGE.log
https://github.com/buliasz/AHKv2-Gdip/commits/master/Gdip_All.ahk
Do you know of some bugs also in that version?
User avatar
FanaticGuru
Posts: 1907
Joined: 30 Sep 2013, 22:25

Re: Snipper - Window Snipping Tool

09 Jan 2024, 19:37

neogna2 wrote:
09 Jan 2024, 17:12
FanaticGuru wrote:
09 Jan 2024, 16:09
Kind of sad there is not a rock solid Gdip v2 out there. I have searched and every one I have found has numerous conversion bugs. It is one reason I created the class of select Gdip functions used in Snipper.
Maybe the most recently updated version of v2 gdip_all.ahk is this one (updated 5 months ago)
https://github.com/buliasz/AHKv2-Gdip
https://github.com/buliasz/AHKv2-Gdip/blob/master/CHANGE.log
https://github.com/buliasz/AHKv2-Gdip/commits/master/Gdip_All.ahk
Do you know of some bugs also in that version?

I looked at buliasz Gdip when I started Snipper, it had many errors but that was before the 2023 updates. When I looked at it there was only the 2021 update.
  • 2023-07-01 v1.57-60 - bug fixes
  • 2023-04-19 v1.56 - compatible with AHK v2.0.2, Gdip_DrawLines fixed, gdip_toolbox improved, separated changelog
  • 2021-12-19 v1.55 - compatibility with AHK v1 dropped, fixed compatibility with v2.0beta3 by buliasz

It looks better now and it is probably the most error free. But it still has errors and limitations though. An example of a limitation, Gdip_SaveBitmapToFile is missing the toBase64 parameter and code. It does have the Quality NumGet and NumPut arranged correctly but with different types than I came up with. I know my types work. Not sure about theirs, probably works either way. It has VarRef errors which is common in all the libraries because of changes from v2 beta to v2 release.

Marius Șucan has a good version too but again with errors. They have pulled code from many places and integrated it together, so tends to have the most capabilities. They do not appear to be updating.

My code is a mesh of code mostly from buliasz and Marius Șucan with some fixes and converted to a class. I did pull other sources on some functions like from ImagePut by iseahound. My code is also just the bare minimum functions need for Snipper and is nowhere near a complete library.

All and all, buliasz that you mentioned above is the best source for a Gdip v2 library if you had to pick just one source. It also has had the most recent activity.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
pgeugene
Posts: 35
Joined: 27 Jun 2019, 04:36

Re: Snipper - Window Snipping Tool

06 Feb 2024, 05:34

I just included OCR extention into my Snipper main script but get below error
Attachments
snipperocrext.png
snipperocrext.png (14.08 KiB) Viewed 651 times
User avatar
FanaticGuru
Posts: 1907
Joined: 30 Sep 2013, 22:25

Re: Snipper - Window Snipping Tool

06 Feb 2024, 14:42

pgeugene wrote:
06 Feb 2024, 05:34
I just included OCR extention into my Snipper main script but get below error
Any of the extension need to be included in a very specific way as described in the post with the extensions.

Each of these files can be added to Snipper by including them in the same directory as the Snipper script and then the appropriate #include line needs to be added or uncommented in the #INCLUDE EXTENSION section of the Snipper script.
#Include Snipper - Extension - Acrobat.ahk
#Include Snipper - Extension - Word.ahk
#Include Snipper - Extension - Outlook.ahk
#include Snipper - Extension - OCR.ahk

You save the extension code in a separate file and then #include that extension file in a specific place in the main script.

You need to carefully read the initial post and the extension post to include extensions correctly.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
pgeugene
Posts: 35
Joined: 27 Jun 2019, 04:36

Re: Snipper - Window Snipping Tool

07 Feb 2024, 04:55

FG,
Thank you for your fast reply
It is working now
There were 2 mistakes causing my problem
1) I was using Snipper Lite version
2) I have included the extention-ocr script into Auto-Execute portion of Snipper Lite script
User avatar
MrDodel
Posts: 96
Joined: 28 Apr 2021, 09:03
Location: Event Horizon

Re: Snipper - Window Snipping Tool

28 Feb 2024, 16:13

I found this ages ago, sorry I can't remember where, add below the CLASSES & FUNCTIONS - GUI section, to enable dark mode.

Code: Select all

; Applying dark theme for Pop-up Menu & Tray Menu.
Class DarkMode
{
    Static __New(Mode := 1) => (
        DllCall(DllCall("GetProcAddress", "ptr", DllCall("GetModuleHandle", "str", "uxtheme", "ptr"), "ptr", 135, "ptr"), "int", mode),
        DllCall(DllCall("GetProcAddress", "ptr", DllCall("GetModuleHandle", "str", "uxtheme", "ptr"), "ptr", 136, "ptr"))
    )
}
Image

Caveat: OS Dependent.
So much universe, and so little time. GNU Sir Terry.

Return to “Scripts and Functions (v2)”

Who is online

Users browsing this forum: No registered users and 14 guests