Oh nunja ich glaube mit meiner Methode funktioniert das nur bei Quadratischen Bildern.
Hier nochmal ein wenig überarbeitet:
Spoiler anzeigen
#include <GDIPlus.au3>
#include <GUIConstants.au3>
$iGUIWidth = 400
$iGUIHeight = 400
$GUIColorBG = 0xFFFFFFFF
$Angle = 0
Global Const $Pi_Div_180 = 4 * ATan(1) / 180
$hWnd = GUICreate("DoodleRotate", $iGUIWidth, $iGUIHeight)
GUISetState()
_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iGUIWidth, $iGUIHeight, $hGraphic)
$hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsClear($hGraphic, $GUIColorBG)
[/autoit] [autoit][/autoit] [autoit]$hImage_Doodle = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Doodle.png")
$iWidth = _GDIPlus_ImageGetWidth($hImage_Doodle) / 2
$iHeight = _GDIPlus_ImageGetHeight($hImage_Doodle) / 2
$iDiag = Sqrt(($iWidth) ^ 2 + ($iHeight) ^ 2)
AdlibRegister("_ReDrawWithAngle", 20)
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_GraphicsDispose($hBuffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_ImageDispose($hImage_Doodle)
_GDIPlus_Shutdown()
Exit
EndSwitch
WEnd
Func _ReDrawWithAngle()
$Angle += 10
$iX1 = $iGUIWidth / 2 + Cos(($Angle + 0 - 135) * $Pi_Div_180) * $iDiag
$iY1 = $iGUIHeight / 2 + Sin(($Angle + 0 - 135) * $Pi_Div_180) * $iDiag
$iX2 = $iGUIWidth / 2 + Cos(($Angle + 90 - 135) * $Pi_Div_180) * $iDiag
$iY2 = $iGUIHeight / 2 + Sin(($Angle + 90 - 135) * $Pi_Div_180) * $iDiag
$iX3 = $iGUIWidth / 2 + Cos(($Angle + 270 - 135) * $Pi_Div_180) * $iDiag
$iY3 = $iGUIHeight / 2 + Sin(($Angle + 270 - 135) * $Pi_Div_180) * $iDiag
_GDIPlus_GraphicsClear($hBuffer, $GUIColorBG)
_GDIPlus_DrawImagePoints($hBuffer, $hImage_Doodle, $iX1, $iY1, $iX2, $iY2, $iX3, $iY3)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iGUIWidth, $iGUIHeight)
EndFunc ;==>_ReDrawWithAngle