also ich hab mir jetz das gdi+ rotator beispiel von uez angesehen
aber ich bekomme es einfach nicht hin das sich der doodle um die eigene achse dreht
wenn mir jemand helfen kann nur zu
also ich hab mir jetz das gdi+ rotator beispiel von uez angesehen
aber ich bekomme es einfach nicht hin das sich der doodle um die eigene achse dreht
wenn mir jemand helfen kann nur zu
doodle?
was wie wann wo?
bitte beispielscript mit problem anhängen sonst wird da wahrscheinlich keiner durchblicken
Zitatsonst wird da wahrscheinlich keiner durchblicken
Doch ich
(Das Script lädt eine "Doodle.png" aus dem Script Verzeichnis)
#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)
$iHeight = _GDIPlus_ImageGetHeight($hImage_Doodle)
AdlibRegister("_ReDrawWithAngle", 30)
[/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) * $Pi_Div_180) * $iWidth
$iY1 = $iGUIHeight / 2 + Sin(($Angle + 0) * $Pi_Div_180) * $iHeight
$iX2 = $iGUIWidth / 2 + Cos(($Angle + 90) * $Pi_Div_180) * $iWidth
$iY2 = $iGUIHeight / 2 + Sin(($Angle + 90) * $Pi_Div_180) * $iHeight
$iX3 = $iGUIWidth / 2 + Cos(($Angle + 270) * $Pi_Div_180) * $iWidth
$iY3 = $iGUIHeight / 2 + Sin(($Angle + 270) * $Pi_Div_180) * $iHeight
_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
Edit: Hey ich hab ja schon über 200 Posts . Das hab ich erst jetzt realisiert.
Du willst warscheinlich den Trampolin-Jump des Doodles hinbekommen oder?
das nenn ich mal ne präzise antwort
danke
nur noch eine frage
welchen wert muss angle haben damit der doodle gerade steht?
@ bakku
joa genau das
Der Doodle steht gerade, wenn $Angle = -135 ist.
Mach es lieber so, sonst kommst du noch durcheinander...
$iX1 = $iGUIWidth / 2 + Cos(($Angle + 0 - 135) * $Pi_Div_180) * $iWidth
$iY1 = $iGUIHeight / 2 + Sin(($Angle + 0 - 135) * $Pi_Div_180) * $iHeight
$iX2 = $iGUIWidth / 2 + Cos(($Angle + 90 - 135) * $Pi_Div_180) * $iWidth
$iY2 = $iGUIHeight / 2 + Sin(($Angle + 90 - 135) * $Pi_Div_180) * $iHeight
$iX3 = $iGUIWidth / 2 + Cos(($Angle + 270 - 135) * $Pi_Div_180) * $iWidth
$iY3 = $iGUIHeight / 2 + Sin(($Angle + 270 - 135) * $Pi_Div_180) * $iHeight
danke XD