Hallo
ich arbeite momentan an ein programm was mithilfe von Kordinaten Also X und Y eine zeichnung erstellt mein problem ist nun das er sie auf den kopf zeichnet
hier ist mein Code:
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <Array.au3>
#include <File.au3>
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
Global $g_hGUI, $g_hGraphics, $g_hBmp_Buffer, $g_hGfx_Buffer, $g_hImage
Global $g_iMouseX, $g_iMouseY
Local $hGUI, $hGraphic, $hPen,$aArray,$g_hBmp_Buffer,$g_hGraphics
Local $g_iMouseX,$g_iMouseY,$lParam
$hGUI = GUICreate("GDI+", 1000, 300)
GUISetState(@SW_SHOW)
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
If Not _FileReadToArray("a2.din", $aArray, 0) Then
MsgBox($MB_SYSTEMMODAL, "", "There was an error reading the file. @error: " & @error) ; An error occurred reading the current script file.
EndIf
For $x = 1 To UBound($aArray)-1
If StringInStr($aArray[$x],"G00 X") Then
;~ _GDIPlus_GraphicsDrawLine($hGraphic, StringTrimLeft($spl[2],1), StringTrimLeft($spl[3],1), StringTrimLeft($spl2[2],1), StringTrimLeft($spl2[3],1), $hPen)
ElseIf StringInStr($aArray[$x],"G01 X") Then
$spl = StringSplit($aArray[$x]," ")
$spl2 = StringSplit($aArray[$x-1]," ")
If $spl[0] >= 3 and $spl2[0] >= 3 Then
IF StringTrimLeft($spl2[2],1) = "-0.1" Then
Else
_GDIPlus_GraphicsDrawLine($hGraphic, StringTrimLeft($spl[2],1), StringTrimLeft($spl[3],1), StringTrimLeft($spl2[2],1), StringTrimLeft($spl2[3],1), $hPen)
EndIf
EndIf
EndIf
Next
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Clean up resources
_GDIPlus_PenDispose($hPen)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
im anhang ist die cordinaten datei