#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <Array.au3>
#include <File.au3>
Opt("PixelCoordMode", 2)
Global $array[0], $newarray[0], $mainindex = 0, $parguiwin
global $FileList=_FileListToArray(@ScriptDir,"*.jpg",1)
for $as = 1 to $FileList[0]
$splnam = stringsplit($FileList[$as],'.')
$splnam = stringsplit($splnam[1],'-')
$firstchar = $splnam[1]*1
$secondchar = $splnam[2]*1
if(stringlen($secondchar) < 2) Then $secondchar = '0' & $secondchar
if(stringlen($secondchar) < 3) Then $secondchar = '0' & $secondchar
if(stringlen($secondchar) < 4) Then $secondchar = '0' & $secondchar
_arrayadd($newarray,$secondchar)
Next
_arraysort($newarray)
global $color = 'ed1b24'
$aa = 0
$parguiwin = GUICreate("AntiPanel", -1, -1, -1, @DesktopHeight + 200)
GUISetState()
while $aa < Ubound($newarray)
Example1($newarray[$aa]*1)
$aa = $aa + 1
WEnd
Func Example1($filename)
if $mainindex = 0 Then
_GDIPlus_Startup()
$hBitmap = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\1-" & $filename & ".jpg")
$img_w = _GDIPlus_ImageGetWidth($hBitmap)
$img_y = _GDIPlus_ImageGetHeight($hBitmap)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_Shutdown()
$gui_w = @desktopwidth-60
$gui_y = @DesktopHeight-100
$normalize_w = $img_w/$gui_w
$normalize_y = $img_y/$gui_y
if($img_y/$normalize_w < $gui_y) Then
$total_w = $gui_w
$total_y = $img_y/$normalize_w
Else
$total_w = $img_w/$normalize_y
$total_y = $gui_y
EndIf
$hgui = GUICreate("1-" & $filename & ".jpg", $gui_w, $gui_y, -1, @DesktopHeight + 200, -1, -1, $parguiwin)
$hImage = GUICtrlCreatePic(@ScriptDir & "\1-" & $filename & ".jpg", 0, 0, $total_w, $total_y)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState()
WinWaitActive($hgui)
sleep(250)
$pixel_coords = PixelSearch(0, 0, $gui_w, $gui_y,'0x' & $color,0,5,$hgui)
if @error <> 1 Then
$sosednie_pixel01 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]+5, $pixel_coords[1]),6))
$sosednie_pixel02 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]+10, $pixel_coords[1]),6))
$sosednie_pixel03 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]-5, $pixel_coords[1]),6))
$sosednie_pixel04 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]-10, $pixel_coords[1]),6))
$sosednie_pixel05 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0], $pixel_coords[1]+5),6))
$sosednie_pixel06 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0], $pixel_coords[1]+10),6))
$sosednie_pixel07 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0], $pixel_coords[1]-5),6))
$sosednie_pixel08 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0], $pixel_coords[1]-10),6))
$sosednie_pixel09 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]+5, $pixel_coords[1]-5),6))
$sosednie_pixel10 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]+10, $pixel_coords[1]-5),6))
$sosednie_pixel11 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]-5, $pixel_coords[1]-5),6))
$sosednie_pixel12 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]-10, $pixel_coords[1]-5),6))
$sosednie_pixel13 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]+5, $pixel_coords[1]-10),6))
$sosednie_pixel14 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]+10, $pixel_coords[1]-10),6))
$sosednie_pixel15 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]-5, $pixel_coords[1]-10),6))
$sosednie_pixel16 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]-10, $pixel_coords[1]-10),6))
$sosednie_pixel17 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]+5, $pixel_coords[1]+5),6))
$sosednie_pixel18 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]+10, $pixel_coords[1]+5),6))
$sosednie_pixel19 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]-5, $pixel_coords[1]+5),6))
$sosednie_pixel20 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]-10, $pixel_coords[1]+5),6))
$sosednie_pixel21 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]+5, $pixel_coords[1]+10),6))
$sosednie_pixel22 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]+10, $pixel_coords[1]+10),6))
$sosednie_pixel23 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]-5, $pixel_coords[1]+10),6))
$sosednie_pixel24 = _arrayadd($array,hex(PixelGetColor($pixel_coords[0]-10, $pixel_coords[1]+10),6))
$search_anotherpixel = _ArrayFindAll($array, $color)
if ubound($search_anotherpixel)>4 then
$mainindex = 1
FileDelete(@ScriptDir & "\1-" & $filename & ".jpg")
EndIf
EndIf
GUIDelete($hgui)
Else
FileDelete(@ScriptDir & "\1-" & $filename & ".jpg")
EndIf
EndFunc
GUIDelete($parguiwin)