#include <GDIP.au3>
#include <Color.au3>
#include <Crypt.au3>
_Glob()
Global $delta = 10
$sImage = @ScriptDir & '\1327.png'
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
Global $iWidth = _GDIPlus_ImageGetWidth($hImage)
Global $iHeight = _GDIPlus_ImageGetHeight($hImage)
$iBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
Global $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($iBitmap)
Global $Ground = '0x' & Hex(_GDIPlus_BitmapGetPixel($hBitmap, 1, 1), 6)
$xLeft = 0
$xRight = 0
$x = 0
$sTring1 = ''
While $x < $iWidth - 1
While _BlackLine($x) And $x < $iWidth - 1
$x += 1
WEnd
$xLeft = $x
While Not _BlackLine($x) And $x < $iWidth
$x += 1
WEnd
$xRight = $x - 1
$hClone = _GDIPlus_BitmapCloneArea($hBitmap, $xLeft, 0, $xRight - $xLeft + 1, $iHeight, $GDIP_PXF24RGB)
$countstring = _SegmentMatrix($hClone)
Switch _Crypt_HashData($countstring, $CALG_MD5)
Case $countstring1
$sTring1 &= '1'
Case $countstring2
$sTring1 &= '2'
Case $countstring3
$sTring1 &= '3'
Case $countstring4
$sTring1 &= '4'
Case $countstring5
$sTring1 &= '5'
Case $countstring6
$sTring1 &= '6'
Case $countstring7
$sTring1 &= '7'
Case $countstring8
$sTring1 &= '8'
Case $countstring9
$sTring1 &= '9'
Case $countstring0
$sTring1 &= '0'
EndSwitch
_GDIPlus_ImageDispose($hClone)
WEnd
_GDIPlus_ImageDispose($hImage)
_WinAPI_DeleteObject($iBitmap)
_WinAPI_DeleteObject($hBitmap)
_GDIPlus_Shutdown()
MsgBox(0, 'Заголовок', $sTring1)
Func _SegmentMatrix($hBitmap1)
Local $tMap1, $bData, $Width1, $Height1
_GDIPlus_Startup()
$Width1 = _GDIPlus_ImageGetWidth($hBitmap1)
$Height1 = _GDIPlus_ImageGetHeight($hBitmap1)
$tMap1 = _GDIPlus_BitmapLockBits($hBitmap1, 0, 0, $Width1, $Height1, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
$bData1 = DllStructGetData(DllStructCreate('byte[' & ($Width1 * $Height1 * 4) & ']', DllStructGetData($tMap1, 'Scan0')), 1)
_GDIPlus_BitmapUnlockBits($hBitmap1, $tMap1)
_GDIPlus_BitmapDispose($hBitmap1)
Return StringTrimLeft($bData1, 2)
EndFunc
Func _BlackLine($stolb)
Local $color
For $i = 0 To $iHeight - 1
$color = '0x' & Hex(_GDIPlus_BitmapGetPixel($hBitmap, $stolb, $i), 6)
If Abs(_ColorGetRed($color) - _ColorGetRed($Ground)) > $delta Or _
Abs(_ColorGetGreen($color) - _ColorGetGreen($Ground)) > $delta Or _
Abs(_ColorGetBlue($color) - _ColorGetBlue($Ground)) > $delta Then Return False
Next
Return True
EndFunc
Func _Glob()
Global $countstring1 = '0xE1AFE94DC29AF51804FC8C75E952BB00'
Global $countstring2 = '0x08224666CF1D9524B7A6E323AC9C8424'
Global $countstring3 = '0x2AFE694C5E3FC663315FB6D65983F86E'
Global $countstring4 = '0xEA0C6F46E4B6BFFEC67E23F89AAA55EF'
Global $countstring5 = '0x4C4FA1B0B5CAFB68E86FF8ECD87CC490'
Global $countstring6 = '0xFBD76FFAA30C61E29D0ABB74C43F5C8E'
Global $countstring7 = '0x3AB9ED7A8DE0A26AEA2056954567B6C2'
Global $countstring8 = '0xD4A7A881A0E00E656DF05F7FDC857E47'
Global $countstring9 = '0x82A5549839B3602EF5CDEBA21FEA6061'
Global $countstring0 = '0x8E99DA0D20F02A3CA3781326B45A98B5'
EndFunc