Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
scan not working in .exe on another computer
#1
When I create an .exe and run it on another computer some scans are not working (err when waiting). It has something to do with the position of the image in the screen. If they are not in a particular sequence the program fails, but on the system where the scan were created the position makes no difference and the program does not fail.

When I created the scans I did not specify the search area.

Since I can't control the position of the images on the screen, I need to resolve this issue somehow. Any ideas where to start?

All the images are resource files stored in the macro not external images.

there is one line of code with the wait command for an image:
wait 15 S "image:h05DA2B14" w1 0 1|16|128|0x400
#2
scan and wait S are good for local short-living macros, but they often are unreliable in macros that must work on any computer etc. Some reasons are in scan Help:

Quote:The function may fail after you apply new theme, color scheme, skin, etc, because the background color may change. To make the function independent from such changes, try flag 4. Then it does not compare pixels that have the same color as the top-left pixel of the captured image. Usually it is background color, so if background will change in the future, the function will not fail. Icons usually already have transparent areas, so this is only useful with bitmap files. The function also may fail after you change display color resolution. The function may not find icons in some controls because they slightly change icon colors. Also it will fail to find captured text after changing font smoothing.
Some other reasons:
Different DPI, ie font size that can be set in Control Panel.
Window shadows. Especially wide shadows are on Windows 10, more than 1 cm.

scan searches in whole client area of the window, and does not depend on image position in it.
#3
I was under the impression that scan and wait for image were basically the same thing except that wait continually scans for the duration of the wait time.

Isn't the command "wait 15 S "image:h05DA2B14" w1 0 1|16|128|0x400" scanning the whole window 'w1' for the image 'h05DA2B14' for 15 sec or I am misunderstanding this command?
#4
Quote:I was under the impression that scan and wait for image were basically the same thing except that wait continually scans for the duration of the wait time.
Yes.

Quote:Isn't the command "wait 15 S "image:h05DA2B14" w1 0 1|16|128|0x400" scanning the whole window 'w1' for the image 'h05DA2B14' for 15 sec or I am misunderstanding this command?
Yes. Flag 16 excludes caption and borders.


Forum Jump:


Users browsing this thread: 1 Guest(s)