Okay, das er in die richtige richtung geht hab ich jetzt hinbekommen, aber jetzt zeigt er das Bild nicht mehr richtig an! Also die Positon wo er es malen soll stimm! Aber er malt es nicht richtig!
Das wo man erkennen kann das jetzt richtig läuft
#include <GDIPlus.au3>
#include <Misc.au3>
#include <WindowsConstants.au3>
_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Data\1.png")
$X = @DesktopWidth / 2 - _GDIPlus_ImageGetWidth($hImage)
$Y = @DesktopHeight / 2 - _GDIPlus_ImageGetHeight($hImage)
$hGui = GUICreate("Laufen", _GDIPlus_ImageGetWidth($hImage),_GDIPlus_ImageGetHeight($hImage),$X,$Y,$WS_POPUP)
GUISetBkColor (0xFFFFFF)
GUISetState()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Data\1.png")
$iWidth = _GDIPlus_ImageGetWidth($hImage) * 96 / _GDIPlus_ImageGetVerticalResolution($hImage)
$iHeight = _GDIPlus_ImageGetHeight($hImage) * 96 / _GDIPlus_ImageGetHorizontalResolution($hImage)
$hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixTranslate($hMatrix, 0, 0)
GUIRegisterMsg($WM_PAINT, "WM_PAINT")
_GDIPlus_MatrixRotate($hMatrix, 0, False)
_GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
_GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage,- $iWidth /2 , - $iHeight /2)
$Rotate = 0
$Speed = 20
While GUIGetMsg() <> -3
ToolTip ($Rotate & "," & $X & "," & $Y)
If $Rotate > 360 Then
$Rotate -=360
ElseIf $Rotate < 0 Then
$Rotate +=360
EndIf
If _IsPressed ("27") Then
$Rotate += 5
_GDIPlus_MatrixRotate($hMatrix, 5, True)
_Draw()
ElseIf _IsPressed ("25") Then
$Rotate -= 5
_GDIPlus_MatrixRotate($hMatrix, -5, True)
_Draw()
EndIf
If _IsPressed ("26") Then
If $Rotate <= 90 Then
$X1 = Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
$X += $X1
$Y -= ($Speed - $X1)
ElseIf $Rotate <= 180 Then
$Rotate1 = $Rotate - 90
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X += ($Speed - $X1)
$Y += $X1
ElseIf $Rotate <= 270 Then
$Rotate1 = $Rotate - 180
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X -= $X1
$Y += ($Speed - $X1)
ElseIf $Rotate <= 360 Then
$Rotate1 = $Rotate - 270
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X -= ($Speed - $X1)
$Y -= $X1
EndIf
_Draw1()
ElseIf _IsPressed ("28") Then
If $Rotate <= 90 Then
$X1 = Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
$X -= $X1
$Y += ($Speed - $X1)
ElseIf $Rotate <= 180 Then
$Rotate1 = $Rotate - 90
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X -= ($Speed - $X1)
$Y -= $X1
ElseIf $Rotate <= 270 Then
$Rotate1 = $Rotate - 180
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X += $X1
$Y -= ($Speed - $X1)
ElseIf $Rotate <= 360 Then
$Rotate1 = $Rotate - 270
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X += ($Speed - $X1)
$Y += $X1
EndIf
_Draw1()
EndIf
Sleep(10)
WEnd
Func WM_PAINT($hWnd, $Msg, $wParam, $lParam)
_GDIPlus_MatrixRotate($hMatrix, $Rotate, "False")
_GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
_GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage,- $iWidth /2 , - $iHeight /2)
EndFunc ;==>WM_PAINT
Func _Draw()
_GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
_GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage,- $iWidth /2 , - $iHeight /2)
EndFunc
Func _Draw1()
WinMove ($hGui,"",$X,$Y)
EndFunc
_GDIPlus_MatrixDispose($hMatrix)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
Das wo er es Falsch zeichent
#include <GDIPlus.au3>
#include <Misc.au3>
#include <WindowsConstants.au3>
_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$hGui = GUICreate("Test Rotate", @DesktopWidth,@DesktopHeight,0,0,$WS_POPUP)
GUISetBkColor (0xFFFFFF)
GUISetState()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Data\Gun\1.png")
$iWidth = _GDIPlus_ImageGetWidth($hImage) * 96 / _GDIPlus_ImageGetVerticalResolution($hImage)
$iHeight = _GDIPlus_ImageGetHeight($hImage) * 96 / _GDIPlus_ImageGetHorizontalResolution($hImage)
$hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixTranslate($hMatrix, 500, 800)
GUIRegisterMsg($WM_PAINT, "WM_PAINT")
_GDIPlus_MatrixRotate($hMatrix, 0, "False")
_GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
_GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, -$iWidth / 2, -$iHeight / 2)
$X = 500
$Y = 800
$Rotate = 0
$Speed = 20
While GUIGetMsg() <> -3
ToolTip ($Rotate & "," & $X & "," & $Y)
If $Rotate > 360 Then
$Rotate -=360
ElseIf $Rotate < 0 Then
$Rotate +=360
EndIf
If _IsPressed ("27") Then
$Rotate += 5
_GDIPlus_MatrixRotate($hMatrix, 5, True)
_Draw()
ElseIf _IsPressed ("25") Then
$Rotate -= 5
_GDIPlus_MatrixRotate($hMatrix, -5, True)
_Draw()
EndIf
If _IsPressed ("26") Then
If $Rotate <= 90 Then
$X1 = Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
$X += $X1
$Y -= ($Speed - $X1)
ElseIf $Rotate <= 180 Then
$Rotate1 = $Rotate - 90
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X += ($Speed - $X1)
$Y += $X1
ElseIf $Rotate <= 270 Then
$Rotate1 = $Rotate - 180
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X -= $X1
$Y += ($Speed - $X1)
ElseIf $Rotate <= 360 Then
$Rotate1 = $Rotate - 270
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X -= ($Speed - $X1)
$Y -= $X1
EndIf
_Draw()
ElseIf _IsPressed ("28") Then
If $Rotate <= 90 Then
$X1 = Round ($Speed / 100 * Round ($Rotate / 90 * 100,0),0)
$X -= $X1
$Y += ($Speed - $X1)
ElseIf $Rotate <= 180 Then
$Rotate1 = $Rotate - 90
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X -= ($Speed - $X1)
$Y -= $X1
ElseIf $Rotate <= 270 Then
$Rotate1 = $Rotate - 180
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X += $X1
$Y -= ($Speed - $X1)
ElseIf $Rotate <= 360 Then
$Rotate1 = $Rotate - 270
$X1 = Round ($Speed / 100 * Round ($Rotate1 / 90 * 100,0),0)
$X += ($Speed - $X1)
$Y += $X1
EndIf
_Draw()
EndIf
Sleep(10)
WEnd
Func WM_PAINT($hWnd, $Msg, $wParam, $lParam)
_GDIPlus_MatrixRotate($hMatrix, 0, "False")
_GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
_GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, -$iWidth / 2, -$iHeight / 2)
EndFunc ;==>WM_PAINT
Func _Draw()
_GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
_GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage,$X -$iWidth / 2,$Y -$iHeight / 2)
EndFunc
_GDIPlus_MatrixDispose($hMatrix)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
Bitte um hilfe, pleas