Hallo, ich arbeite immer noch an meinem Font-Tool.
Dieses soll die installierten Schriftarten auslesen und in einer Listbox auflisten.
Dann will ich für jede Schriftart und jedes deren darstellbaren Zeichen die Daten sammeln, wie z.B. Pixelanzahl oder eingrenzendes Rechteck etc
Wenn ich nun die Schriftarten durchlaufe, ist es dann möglich auf ein "unsichtbares" Fenster zu zeichnen oder gar im Speicher damit die Datenerfassung schneller läuft??
Und dann vllt. mit den Daten die Charaktere in den kleinen Fenstern anzeigt! Das wäre doch um einiges schneller!!
Also ich verwende noch die PixelGet Methode weil ich nich weiss wie des mit dem LockBits funktioniert..des würd doch auch schon einiges bringen..!?
Wer kann mir helfen??
Spoiler anzeigen
#include <Array.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <File.au3>
#include <Fontconstants.au3>
#include <GDIPlus.au3>
#include <GuiButton.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <ListviewConstants.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <UpDownConstants.au3>
#include <WindowsConstants.au3>
#include <GuiRichEdit.au3>
#include <GuiEdit.au3>
Opt("GUIOnEventMode", 1)
Opt("PixelCoordMode", 0)
;Data
$dString = 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,ä,ö,ü,1,2,3,4,5,6,7,8,9,0' ;26 Buchstaben 3 Umlaute 10 Zahlen
Global $aString = StringSplit($dString, ',')
Local $data[3][$aString[0] + 1]
Local $rLinks, $rRechts, $rOben, $rUnten, $rWidth, $rHeight
Local $aCoords1[100][100]
Local $aCoords2[100][100]
Local $aARect[2][5]
For $i = 1 To $aString[0]
$data[1][$i] = StringUpper($aString[$i])
$data[2][$i] = StringLower($aString[$i])
Next
$cDataCount = 1 ;Letter Stellenzähler
$data[0][0] = (UBound($data, 2) - 1)
Global $var = _FontGetList(1)
Global $aItems[$var[0][0]]
Global $fName[1]
$sgrA = 50
#region ### START Koda GUI section ### Form=C:\Users\IBM\Desktop\AU3_OCR_new\Form1.kxf
$msg = GUICreate("Form1", 680, 245, 215, 124)
$Datei = GUICtrlCreateMenu("&Datei")
$mFileOpen = GUICtrlCreateMenuItem("Datei öffnen" & @TAB & "", $Datei)
$MenuItem1 = GUICtrlCreateMenuItem("Optionen" & @TAB & "", $Datei)
$MenuItem2 = GUICtrlCreateMenuItem("Exit" & @TAB & "", $Datei)
$Hilfe = GUICtrlCreateMenu("&Hilfe")
$lLabel = GUICtrlCreateLabel('Speichern', 264, 10, 60, 20)
$lLabel2 = GUICtrlCreateLabel('Input:', 277, 100, 60, 20)
$listview = GUICtrlCreateListView("Nr.|Datei|Name", 337, 25, 335, 157)
GUICtrlCreateLabel('Suchen: ', 480, 4, 60, 20)
$sSuche = GUICtrlCreateInput('', 526, 1, 110, 20)
$iInput = GUICtrlCreateEdit('', 269, 117, 50, 50, BitOR($ES_CENTER, $ES_WANTRETURN, $WS_BORDER))
$idEdit1 = GUICtrlCreateEdit('', 10, 32, 100, 100, $ES_AUTOVSCROLL, BitOR($WS_EX_WINDOWEDGE, $WS_EX_CLIENTEDGE, $WS_EX_DLGMODALFRAME))
$idEdit2 = GUICtrlCreateEdit('', 151, 32, 100, 100, $ES_AUTOVSCROLL, BitOR($WS_EX_WINDOWEDGE, $WS_EX_CLIENTEDGE, $WS_EX_DLGMODALFRAME))
Global $hEdit1 = GUICtrlGetHandle($idEdit1)
Global $hEdit2 = GUICtrlGetHandle($idEdit2)
GUICtrlCreateLabel('Daten: ', 264, 30, 50, 20)
GUICtrlCreateLabel('Bilder: ', 264, 45, 50, 20)
GUICtrlCreateLabel('Overwrite: ', 264, 60, 50, 20)
$cDaten = GUICtrlCreateCheckbox('', 312, 32, 10, 10)
$cBilder = GUICtrlCreateCheckbox('', 312, 47, 10, 10)
$cOW = GUICtrlCreateCheckbox('', 312, 62, 10, 10)
$SchriftG = GUICtrlCreateInput($sgrA, 113, 70, 35, 20, $ES_NUMBER)
$updwnSGR = GUICtrlCreateUpdown($SchriftG)
$bUp = GUICtrlCreateButton("Up", 113, 32, 35, 35, -1, $WS_EX_CLIENTEDGE)
$bDown = GUICtrlCreateButton("Dwn", 113, 97, 35, 35, -1, $WS_EX_CLIENTEDGE)
$bStart = GUICtrlCreateButton("Start", 20, 160, 80, 25, -1, $WS_EX_STATICEDGE)
$bAbbruch = GUICtrlCreateButton("Abbruch", 160, 160, 80, 25, -1, $WS_EX_STATICEDGE)
$bDaten = GUICtrlCreateButton("Alle Daten", 412, 188, 190, 30)
$bFAkt = GUICtrlCreateButton('Aktuell', 105, 156, 50, 16, $BS_DEFPUSHBUTTON)
$bFAll = GUICtrlCreateButton('Alle', 105, 176, 50, 16, $BS_DEFPUSHBUTTON)
$bSetInput = GUICtrlCreateButton('Set', 274, 172, 40, 18)
$Progress1 = GUICtrlCreateProgress(11, 139, 238, 10, -1, $WS_EX_STATICEDGE)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
_GUICtrlListView_SetColumnWidth($listview, 0, 28)
_GUICtrlListView_SetColumnWidth($listview, 1, 40)
_GUICtrlListView_SetColumnWidth($listview, 2, 180)
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUICtrlSetOnEvent($bStart, "_StartButton")
GUICtrlSetOnEvent($bUp, "UP")
GUICtrlSetOnEvent($bDown, "DOWN")
GUICtrlSetOnEvent($listview, "HandleClicks")
GUICtrlSetOnEvent($updwnSGR, "SchriftGR")
GUICtrlSetOnEvent($bDaten, "AlleDaten")
GUICtrlSetOnEvent($bFAkt, "BAkt")
GUICtrlSetOnEvent($bFAll, "BAll")
GUICtrlSetOnEvent($mFileOpen, "_File_Open")
;GUICtrlSetOnEvent($bSetInput, "SetInput")
GUICtrlSetLimit($SchriftG, 99)
GUICtrlSetLimit($iInput, 1)
GUICtrlSetFont($iInput, 26)
GUICtrlSetFont($lLabel, 10, -1, 4)
GUICtrlSetFont($lLabel2, 10, -1, 4)
;GUICtrlSetData($iInput, StringUpper($aString[$cDataCount]))
GUICtrlSetState($cDaten, $GUI_CHECKED)
GUICtrlSetState($cBilder, $GUI_CHECKED)
GUICtrlSetStyle($bFAll, $BS_FLAT)
$bAll = 1
$bAkt = 0
$x = 0
For $a = 1 To $var[0][0]
If StringInStr($var[$a][0], 'Bold', 1) = False And StringInStr($var[$a][0], 'Italic', 1) = False _
And StringInStr($var[$a][0], 'MT Extra', 1) = False Then
$nName = $var[$a][0]
_ArrayAdd($fName, $nName)
$aItems[$x] = GUICtrlCreateListViewItem($x & '|' & $var[$a][1] & '|' & $nName, $listview)
GUICtrlSetOnEvent($aItems[$x], "HandleClicks")
$x = $x + 1
EndIf
Next
$fName[0] = $x
$x = 0
$cFonts = _GUICtrlListView_GetItemCount($listview)
_GUICtrlListView_SetSelectionMark($listview, 0)
$sTrim = _GUICtrlListView_GetSelectionMark($listview)
_GUICtrlListView_ClickItem($listview, 0, "left", False, 1)
$pList = _GUICtrlListView_GetSelectedColumn($listview)
While 1
$rAktList = GUICtrlRead($listview)
;MsgBox(0, '', $pList)
$sgr = GUICtrlRead($SchriftG)
If $sgr <> $sgrA Then
_Update()
$sgrA = $sgr
EndIf
$input = GUICtrlRead($iInput)
Sleep(100)
WEnd
;~ ;Funktionen
Func _Update()
$rInput = $aString[$cDataCount]
Global $rInput1 = StringUpper($rInput)
Global $rInput2 = StringLower($rInput)
Global $sgr = GUICtrlRead($SchriftG)
_Paint($rInput1, $rInput2, $sTrim, $sgr)
EndFunc ;==>_Update
Func _Paint($rInput1, $rInput2, $sTrim, $sgr)
_GDIPlus_Startup()
Global $hGraphics1 = _GDIPlus_GraphicsCreateFromHWND($hEdit1)
Global $hGraphics2 = _GDIPlus_GraphicsCreateFromHWND($hEdit2)
Global $hBmpBuffer1 = _GDIPlus_BitmapCreateFromGraphics(100, 100, $hGraphics1)
Global $hBmpBuffer2 = _GDIPlus_BitmapCreateFromGraphics(100, 100, $hGraphics2)
Global $hGfxBuffer1 = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer1)
Global $hGfxBuffer2 = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer2)
Global $hPen = _GDIPlus_PenCreate(0xFF00FF00)
Global $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000)
_GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer1, 2)
_GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer2, 2)
_GDIPlus_GraphicsClear($hGfxBuffer1, 0xFFFFFFFF)
_GDIPlus_GraphicsClear($hGfxBuffer2, 0xFFFFFFFF)
_Zentriere($rInput1, 45, 45, $sgr, $sTrim, $hGfxBuffer1)
_Zentriere($rInput2, 45, 45, $sgr, $sTrim, $hGfxBuffer2)
_GDIPlus_GraphicsDrawImage($hGraphics1, $hBmpBuffer1, 0, 0)
_GDIPlus_GraphicsDrawImage($hGraphics2, $hBmpBuffer2, 0, 0)
_release()
EndFunc ;==>_Paint
Func _StartButton() ;Daten einlesen und speichern
If $bAkt = 1 And $bAll = 0 Then
_AktFont()
ElseIf $bAll = 1 And $bAkt = 0 Then
For $g = 1 To $aString[0]
$rInput = $aString[$g]
$rInput1 = StringUpper($rInput)
$rInput2 = StringLower($rInput)
_Paint($rInput1, $rInput2, $sTrim, $sgr)
_AktFont()
Next
EndIf
EndFunc ;==>_StartButton
Func _AktFont()
$sgr = GUICtrlRead($SchriftG) ;Schriftgrösse ermitteln
$File1 = @ScriptDir & "\coords\" & $sTrim & "_" & $sgr & "_(" & $rInput1 & ")_Upper_coords.txt"
$File2 = @ScriptDir & "\coords\" & $sTrim & "_" & $sgr & "_(" & $rInput2 & ")_Lower_coords.txt"
If FileExists($File1) Or FileExists($File2) Then
If GUICtrlRead($cOW) = 1 Then
_FW_RAW($hEdit1, $File1)
_FW_RAW($hEdit2, $File2)
Else
$FAsk1 = MsgBox(4, $rInput1 & '/' & $rInput1, $File1 & @CRLF & "Exists" & @CRLF & @CRLF & 'Overwrite?')
If $FAsk1 = 6 Then ;Wenn Ja dann
_FW_RAW($hEdit1, $File1)
_FW_RAW($hEdit2, $File2)
ElseIf $FAsk1 = 7 Then ;Wenn Nein dann
;
EndIf
EndIf
Else
_FW_RAW($hEdit1, $File1)
_FW_RAW($hEdit2, $File2)
EndIf
;_Update()
EndFunc ;==>_AktFont
Func _FW_RAW($hEdit, $File) ;Pixelkoordinaten in Datei Speichern(Returns Array)
Local $aXY[1]
FileOpen($File, 10)
For $iX = 0 To 100
For $iY = 0 To 100
If Dec(PixelGetColor($iX, $iY, $hEdit)) < Dec('999999') Then
FileWrite($File, $iX & "," & $iY & @CRLF)
EndIf
Next
Next
FileClose($File)
EndFunc ;==>_FW_RAW
Func SpecialEvents()
Select
Case @GUI_CtrlId = $GUI_EVENT_CLOSE
;cleanup()
Exit
EndSelect
EndFunc ;==>SpecialEvents
Func AlleDaten()
$sgr = GUICtrlRead($SchriftG)
For $f = 1 To $fName[0]
$sTrim = $fName[$f]
ConsoleWrite($sTrim & @CRLF)
For $g = 1 To $aString[0]
$rInput = $aString[$g]
$rInput1 = StringUpper($rInput)
$rInput2 = StringLower($rInput)
$File1 = @ScriptDir & "\coords\" & $sTrim & "_" & $sgr & "_(" & $rInput1 & ")_Upper_coords.txt"
$File2 = @ScriptDir & "\coords\" & $sTrim & "_" & $sgr & "_(" & $rInput2 & ")_Lower_coords.txt"
FileOpen($File1, 10)
FileOpen($File2, 10)
_Paint($rInput1, $rInput2, $sTrim, $sgr)
Sleep(100)
For $iX = 0 To 100 - 1
For $iY = 0 To 100 - 1
$iPixelColor1 = PixelGetColor($iX, $iY, $hEdit1)
$iPixelColor2 = PixelGetColor($iX, $iY, $hEdit2)
If Dec($iPixelColor1) < Dec('999999') Then
FileWrite($File1, $iX & "," & $iY & @CRLF)
EndIf
If Dec($iPixelColor2) < Dec('999999') Then
FileWrite($File2, $iX & "," & $iY & @CRLF)
EndIf
Next
Next
FileClose($File1)
FileClose($File1)
Next
Next
EndFunc ;==>AlleDaten
Func HandleClicks()
$aktSel = GUICtrlRead(GUICtrlRead($listview))
$aList = StringSplit($aktSel, '|')
$sTrim = StringTrimRight($aList[3], 0)
_Update()
EndFunc ;==>HandleClicks
Func UP()
Local $cNUMCount
If $cDataCount < $aString[0] Then
$cDataCount = $cDataCount + 1
$cNUMCount = $cNUMCount + 1
_Update()
EndIf
EndFunc ;==>UP
Func DOWN()
Local $cNUMCount
If $cDataCount >= 2 Then
$cDataCount = $cDataCount - 1
_Update()
EndIf
EndFunc ;==>DOWN
Func BAll()
$bAll = 1
$bAkt = 0
GUICtrlSetStyle($bFAll, $BS_FLAT)
GUICtrlSetStyle($bFAkt, $BS_DEFPUSHBUTTON)
EndFunc ;==>BAll
Func BAkt()
$bAll = 0
$bAkt = 1
GUICtrlSetStyle($bFAkt, $BS_FLAT)
GUICtrlSetStyle($bFAll, $BS_DEFPUSHBUTTON)
EndFunc ;==>BAkt
Func SchriftGR()
$sgr = GUICtrlRead($SchriftG)
If $sgr <= 20 Then
GUICtrlSetData($SchriftG, 21)
EndIf
If $sgr >= 100 Then
GUICtrlSetData($SchriftG, 99)
EndIf
_Update()
EndFunc ;==>SchriftGR
Func _FontGetList($i_opt = 0)
Dim $a_FontNames[1], $a_FontNamesFiles[1][1], $i = 1
If @OSType = "WIN32_NT" Then $regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
If @OSType = "WIN32_WINDOWS" Then $regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts"
While 1
$s_temp = RegEnumVal($regkey, $i)
If @error <> 0 Then ExitLoop
$s_temp2 = RegRead($regkey, $s_temp)
$s_temp = StringRegExpReplace($s_temp, "\s\(.*?\)(\s*)?", "")
If $i_opt = 0 Then
ReDim $a_FontNames[($i + 1)]
$a_FontNames[$i] = $s_temp
ElseIf $i_opt = 1 Then
ReDim $a_FontNames[($i + 1)]
$a_FontNames[$i] = $s_temp & "|" & $s_temp2
EndIf
$i = $i + 1
WEnd
If $i_opt = 0 Then
_ArraySort($a_FontNames)
$a_FontNames[0] = (UBound($a_FontNames) - 1)
Return ($a_FontNames)
ElseIf $i_opt = 1 Then
_ArraySort($a_FontNames) ; Sort with font names and files as a single array
For $i = 1 To (UBound($a_FontNames) - 1) ; then split it up into 2D, so they will be alphabatized together.
$s_fontsplit = StringSplit($a_FontNames[$i], "|")
If IsArray($s_fontsplit) = 1 Then
ReDim $a_FontNamesFiles[($i + 1)][2]
$a_FontNamesFiles[$i][0] = $s_fontsplit[1]
$a_FontNamesFiles[$i][1] = $s_fontsplit[2]
EndIf
Next
$a_FontNamesFiles[0][0] = (UBound($a_FontNamesFiles) - 1)
Return ($a_FontNamesFiles)
EndIf
EndFunc ;==>_FontGetList
Func _GetRegValues($HKEY)
Local $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
If StringInStr($HKEY, '\') Then
If StringRight($HKEY, 1) = '\' Then
$HKEY = StringTrimRight($HKEY, 1)
Local $strKeyPath = ''
Else
Local $strKeyPath = StringRight($HKEY, StringLen($HKEY) - StringInStr($HKEY, '\'))
$HKEY = StringLeft($HKEY, StringInStr($HKEY, '\') - 1)
EndIf
Else
Local $strKeyPath = ''
EndIf
Select
Case $HKEY = "HKEY_LOCAL_MACHINE" Or $HKEY = "HKLM"
$HKEY = 0x80000002
Case $HKEY = "HKEY_USERS" Or $HKEY = "HKU"
$HKEY = 0x80000003
Case $HKEY = "HKEY_CURRENT_USER" Or $HKEY = "HKCU"
$HKEY = 0x80000001
Case $HKEY = "HKEY_CLASSES_ROOT" Or $HKEY = "HKCR"
$HKEY = 0x80000000
Case $HKEY = "HKEY_CURRENT_CONFIG" Or $HKEY = "HKCC"
$HKEY = 0x80000005
EndSelect
Local $oReg = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
Local $arrValueNames, $arrValueTypes, $strValue
$oReg.EnumValues($HKEY, $strKeyPath, $arrValueNames, $arrValueTypes)
$OEvent = ObjEvent($oReg, "EnumValues")
If Not IsArray($arrValueNames) Then Return ''
Local $arOut[UBound($arrValueNames)][3]
For $i = 0 To UBound($arrValueNames) - 1
$arOut[$i][0] = $arrValueNames[$i]
Switch $arrValueTypes[$i]
Case 1
$arOut[$i][1] = 'REG_SZ'
$oReg.GetStringValue($HKEY, $strKeyPath, $arrValueNames[$i], $strValue)
Case 2
$arOut[$i][1] = 'REG_EXPAND_SZ'
$oReg.GetExpandedStringValue($HKEY, $strKeyPath, $arrValueNames[$i], $strValue)
Case 3
$arOut[$i][1] = 'REG_BINARY'
$oReg.GetBinaryValue($HKEY, $strKeyPath, $arrValueNames[$i], $strValue)
Case 4
$arOut[$i][1] = 'REG_DWORD'
$oReg.GetStringValue($HKEY, $strKeyPath, $arrValueNames[$i], $strValue)
Case 7
$arOut[$i][1] = 'REG_MULTI_SZ'
$oReg.GetMultiStringValue($HKEY, $strKeyPath, $arrValueNames[$i], $strValue)
EndSwitch
$arOut[$i][2] = $strValue
Next
Return $arOut
EndFunc ;==>_GetRegValues
Func _Zentriere($sString, $iX, $iY, $fSize, $sFont, $hGfxBuffer)
Local $aResult = DllCall($ghGDIPDLL, "uint", "GdipCreatePath", "int", 0, "int*", 0)
Local $hPath = $aResult[2]
Local $hFormat = _GDIPlus_StringFormatCreate()
Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
Local $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0)
Local $tBounds = _GDIPlus_RectFCreate(0, 0, 0, 0)
DllCall($ghGDIPDLL, "uint", "GdipAddPathString", "hwnd", $hPath, "wstr", $sString, "int", -1, "hwnd", $hFamily, "int", 0, "float", $fSize, "ptr", DllStructGetPtr($tLayout), "hwnd", $hFormat)
DllCall($ghGDIPDLL, "uint", "GdipGetPathWorldBounds", "hwnd", $hPath, "ptr", DllStructGetPtr($tBounds), "hwnd", 0, "hwnd", 0)
Local $fRectX = DllStructGetData($tBounds, "X")
Local $fRectY = DllStructGetData($tBounds, "Y")
Local $fRectW = DllStructGetData($tBounds, "Width")
Local $fRectH = DllStructGetData($tBounds, "Height")
Local $hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixTranslate($hMatrix, -$fRectX - $fRectW / 2 + $iX, -$fRectY - $fRectH / 2 + $iY)
DllCall($ghGDIPDLL, "uint", "GdipTransformPath", "hwnd", $hPath, "hwnd", $hMatrix)
_GDIPlus_MatrixDispose($hMatrix)
DllCall($ghGDIPDLL, "uint", "GdipFillPath", "hwnd", $hGfxBuffer, "hwnd", $hBrush, "hwnd", $hPath)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_StringFormatDispose($hFormat)
DllCall($ghGDIPDLL, "uint", "GdipDeletePath", "hwnd", $hPath)
EndFunc ;==>_Zentriere
Func _File_Open()
$pFile = FileOpenDialog('Pattern laden', @ScriptDir & "\Coords\", "Text (*.txt)")
$cFL = _FileCountLines($pFile)
Global $Pattern[$cFL + 1]
$Pattern[0] = 'X,Y'
For $i = 1 To $cFL
$Pattern[$i] = FileReadLine($pFile, $i)
Next
_SetPixel($rInput1, $rInput2, $sTrim, $sgr, $Pattern)
EndFunc
Func _SetPixel($rInput1, $rInput2, $sTrim, $sgr, $Pattern)
_GDIPlus_Startup()
$hGraphics1 = _GDIPlus_GraphicsCreateFromHWND($hEdit1)
$hGraphics2 = _GDIPlus_GraphicsCreateFromHWND($hEdit2)
$hBmpBuffer1 = _GDIPlus_BitmapCreateFromGraphics(100, 100, $hGraphics1)
$hBmpBuffer2 = _GDIPlus_BitmapCreateFromGraphics(100, 100, $hGraphics2)
$hGfxBuffer1 = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer1)
$hGfxBuffer2 = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer2)
$hPen = _GDIPlus_PenCreate(0xFF000000)
$hBrush = _GDIPlus_BrushCreateSolid(0xFF000000)
_GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer1, 1)
_GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer2, 1)
_GDIPlus_GraphicsClear($hGfxBuffer1, 0xFFFFFFFF)
_GDIPlus_GraphicsClear($hGfxBuffer2, 0xFFFFFFFF)
For $i = 1 To UBound($Pattern) - 1
$coXY = StringSplit($Pattern[$i], ',')
ConsoleWrite($coXY[1] & ',' & $coXY[2] & @CRLF)
_GDIPlus_GraphicsDrawLine($hGfxBuffer1, $coXY[1] - 5, $coXY[2] - 5, $coXY[1] - 6, $coXY[2] - 6 ,$hPen)
_GDIPlus_GraphicsDrawLine($hGfxBuffer2, $coXY[1] - 5, $coXY[2] - 5, $coXY[1] - 6, $coXY[2] - 6 ,$hPen)
Next
_GDIPlus_GraphicsDrawImage($hGraphics1, $hBmpBuffer1, 0, 0)
_GDIPlus_GraphicsDrawImage($hGraphics2, $hBmpBuffer2, 0, 0)
_release()
EndFunc
Func _release()
_GDIPlus_PenDispose($hPen)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDispose($hGfxBuffer1)
_GDIPlus_GraphicsDispose($hGfxBuffer2)
_GDIPlus_BitmapDispose($hBmpBuffer1)
_GDIPlus_BitmapDispose($hBmpBuffer2)
_GDIPlus_GraphicsDispose($hGraphics1)
_GDIPlus_GraphicsDispose($hGraphics2)
_GDIPlus_Shutdown()
EndFunc ;==>_release