-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By AnRios
Greetings friends!
I have been searching the help file and Google, with no success, to find a way to validate images from a folder and mark them somehow in a spreadsheet.
My context is: I made a code with the help of the community that captures images from SAP and saves them in a folder. Now I'd like to identify which ones are black, if it's even possible. I read about PixelSearch, but did not get it to work. If someone could point me in the right direction, I'd appreciate it.
The code I'm using:
#include <File.au3> #include <ScreenCapture.au3> $x = InputBox("Title", "Amount of Images To Capture", "", "", 320, 150) If @error Then Exit $x = Number($x) $y = InputBox("Title", "Batch Name", "", "", 320, 150) If @error Then Exit $y = String($y) HotKeySet("{HOME}", "printscreen") Func printscreen() $FilePath =("C:\Fiscalizacao\Fotos"&"/") $FileName = $y & " - " $FileList = _FileListToArray($FilePath, $FileName & '*.jpg', 1) If Not IsArray($FileList) Then $FileName&= '1.jpg' Else $FileName &= $FileList[0] + 1 & '.jpg' EndIf _ScreenCapture_Capture($FilePath & "\" & $FileName, 354, 196, 673, 436) EndFunc HotKeySet("{BS}", "Terminate") Func Terminate() Exit 0 EndFunc For $i = 1 to $x Opt("WinTitleMatchMode",2) If NOT WinExists("Relatorio") Then MsgBox(0, "Atenção!", "Relatório do MOM deve estar aberto!") Call("Terminate") EndIf Opt("WinTitleMatchMode",2) WinActivate("Relatorio") Sleep (250) Opt("WinTitleMatchMode",2) SendKeepActive("Relatorio") Send("{ENTER}") Sleep (1000) Send("{HOME}") Sleep (200) Opt("WinTitleMatchMode",2) WinActivate("Relatorio") Send("{DOWN}") Next
-
By plankton
While IsArray(PixelSearch(100, 100, 300, 300, 0xffffff)) Send("{ESC}") Sleep(1000) WEnd MsgBox(0,"Loop exited","") Hi, above is my function that will execute ESC button when white color is present in specific area which is color 0xffffff.
But how do I do the opposite like when white color is not present in that specific area? Like this below code which gives me error
While IsArray(PixelSearch(100, 100, 300, 300, <>0xffffff)) Send("{ESC}") Sleep(1000) WEnd MsgBox(0,"Loop exited","")
-
By plankton
Hi I want it to search for a specific color in certain area then excute the loop which presses ESC button and stop the loop when the color no longer present in that specific area. Here is the example of my code. But it doesnt stop when color is disappeared.
Pixelsearch(511, 455, 678, 501, 0xFFFFFF)
If Not @Error Then
While 1
Sleep(1000)
Send("{ESC}")
Pixelsearch(511, 455, 678, 501, 0xFFFFFF)
If @Error Then Exitloop
-
By Borges
Sorry if I posted in wrong section but...
how can I do something like that?
If PixelSearch(660, 30, 670, 38, 0x242424, 0 , 1) <> @error Then
Send("{F3}")
Sleep(200)
ElseIf PixelSearch(800, 30, 810, 38, 0x242424, 0 , 1) <> @error Then
Send("{F4}")
Sleep(200)
EndIf
-
By Daka
I find it very weird:
if I run like this:
Local $aCoord = PixelSearch($posX, $posY, $sizeX, $sizeY, '0xFF455E')
works fine!
If I run like this:
Local $metaColor1 = '0xFF455E' or like this Local $metaColor1 = "0xFF455E" or Local $metaColor1 = "'0xFF455E'"
Local $aCoord = PixelSearch($posX, $posY, $sizeX, $sizeY, $color)
it doesn't want to work! So something with variable is not working and yes if I print it out like this:
ConsoleWrite(@LF & $posX & ":"& $posY & ":"& $sizeX & ":" & $sizeY & ":" & $color&@LF)
771:80:833:151:0xFF455E
So I dont see the problem, maybe some of you people?
-