windows capture, image search and colors search

Post your working scripts, libraries and tools.
User avatar
thqby
Posts: 560
Joined: 16 Apr 2021, 11:18
Contact:

Re: windows capture, image search and colors search

10 May 2022, 04:43

thqby wrote:
09 Feb 2022, 06:18
The param variation of findPic and findAllPic is equal to the transparent_color << 32 | variation.
For example

Code: Select all

variation := 0xffffffff << 32 | 0 ; it will ignore the white in the image

variation := 0xff000000 << 32 | 0x050505 ; it will ignore the black in the image, and allowed number of shades of variation in either direction for the intensity of the red, green, and blue components of each pixel's color
@frifix
frifix
Posts: 3
Joined: 07 May 2022, 12:09

Re: windows capture, image search and colors search

10 May 2022, 05:19

@thqby
Thank you, now it works. I have misunderstood the variation parameter.
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: windows capture, image search and colors search

16 May 2022, 23:11

If I want to save the picture in JPG format, do I still need to use GDIP for conversion?
ddt442
Posts: 11
Joined: 04 Jan 2020, 15:02

Re: windows capture, image search and colors search

26 Sep 2022, 02:41

Is possible to have an example for finding multi colors's coordinate?
User avatar
thqby
Posts: 560
Joined: 16 Apr 2021, 11:18
Contact:

Re: windows capture, image search and colors search

26 Sep 2022, 19:00

@ddt442

It's already in the example.
super64
Posts: 1
Joined: 07 Oct 2023, 12:29

Re: windows capture, image search and colors search

07 Oct 2023, 12:38

Great features. Awesome and practical.
I have created a software that blurs a part of a window.

Can you please add the ability to apply a Gaussian blur to the WGC capture image to the dll?
I want to apply a blur of about 2px-10px.
Right now I use stretchblt scaling to blur.
Blurring a 1500x1500px image at 60fps is very CPU intensive.

I tried gdip but it did not improve.
Feather
Posts: 24
Joined: 14 Nov 2022, 02:14

Re: windows capture, image search and colors search

07 Oct 2023, 14:51

I tried capturing fullscreen with DXGI and found no performance advantage over gid. Am I missing some parameter?

7680*2160
dxcp 380ms:
bb := dxcp.captureAndSave()

gdi 220ms:
dc := DllCall("GetDC", "UInt", 0, "Cdecl UPtr")
...
DllCall("GDI32\BitBlt", "UInt", ...)
User avatar
thqby
Posts: 560
Joined: 16 Apr 2021, 11:18
Contact:

Re: windows capture, image search and colors search

07 Oct 2023, 23:13

Most image related algorithms require a lot of computation, and different algorithms have different performance.
Not performing calculations can significantly improve performance when the image has not changed.
The BitmapBuffer object has tick property that can be used to distinguish whether to update or not.
User avatar
thqby
Posts: 560
Joined: 16 Apr 2021, 11:18
Contact:

Re: windows capture, image search and colors search

07 Oct 2023, 23:26

DXGI is not an instant screenshot method. It only returns image data when the target changes within a specified time, otherwise it will return a timeout error. This method can avoid processing duplicate images in continuous screenshots.
Feather
Posts: 24
Joined: 14 Nov 2022, 02:14

Re: windows capture, image search and colors search

11 Oct 2023, 12:50

I'm experiencing a problem. With multiple monitors, WGC only captures the first screen.
User avatar
thqby
Posts: 560
Joined: 16 Apr 2021, 11:18
Contact:

Re: windows capture, image search and colors search

11 Oct 2023, 21:27

WGC(hwnd_or_monitor_or_index)
You need to specify the monitor index.
User avatar
yfjuu6
Posts: 136
Joined: 28 Apr 2023, 15:28

Re: windows capture, image search and colors search

27 Feb 2024, 16:13

thqby wrote:
11 Oct 2023, 21:27
when I run the script color.ahk those errors appear.
Does anyone know what the problem is ?
Attachments
1.png
1.png (11.93 KiB) Viewed 1039 times
2.png
2.png (10.69 KiB) Viewed 1039 times
User avatar
thqby
Posts: 560
Joined: 16 Apr 2021, 11:18
Contact:

Re: windows capture, image search and colors search

27 Feb 2024, 22:39

Perhaps the vc2015 runtime is not installed.
william_ahk
Posts: 639
Joined: 03 Dec 2018, 20:02

Re: windows capture, image search and colors search

17 Jul 2024, 05:17

Can you show us how to capture videos with this library?
User avatar
thqby
Posts: 560
Joined: 16 Apr 2021, 11:18
Contact:

Re: windows capture, image search and colors search

19 Jul 2024, 09:13

Screen recording is not implemented.

Return to “Scripts and Functions (v2)”

Who is online

Users browsing this forum: No registered users and 30 guests