Hab eure Beispiele jetzt zusammengefasst; Hier das Ergebnis:
Spoiler anzeigen
#include <GDIplus.au3>
#include <GUIConstants.au3>
#include <EditConstants.au3>
Opt("GUIOnEventMode", 1)
_GDIPlus_Startup()
Global $Stator = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Stator.png")
Global $Rotor = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Rotor_small.png")
Global $Schleifkontakte = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Schleifkontakte.png")
Global $width = _GDIPlus_ImageGetWidth($Stator)
Global $height = _GDIPlus_ImageGetHeight($Stator)
Global $dx = _GDIPlus_ImageGetWidth($Rotor)
Global $dy = _GDIPlus_ImageGetHeight($Rotor)
Global $i
[/autoit] [autoit][/autoit] [autoit]Global $hWnd = GUICreate("Elektromotor by Jan Scheiper mit freundlicher Mithilfe von UEZ & name22", 704, 780, -1, -1, Default)
GUICtrlCreateLabel("Wert:",50,733)
$slider = GUICtrlCreateSlider(50,670,604,34)
$speed = GUICtrlCreateInput("0",80,730,30,20,$ES_READONLY)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GUISetState()
Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphics)
Global $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
Global $hFGBitmap = _GDIPlus_BitmapCreateFromGraphics($dx, $dy, $hGraphics)
Global $hFGBackbuffer = _GDIPlus_ImageGetGraphicsContext($hFGBitmap)
Global $hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixTranslate($hMatrix, $dx / 2, $dy / 2)
_GDIPlus_GraphicsClear($hBackbuffer, 0xFFFFFFFF)
Global $FG_x = 163
Global $FG_y = 221
Global $mid_x = $dx * 0.5
Global $mid_y = $dy * 0.5
$i = 0
[/autoit] [autoit][/autoit] [autoit]While Sleep(20)
GUICtrlSetData($speed,GUICtrlRead($slider))
$i = GUICtrlRead($speed)
_GDIPlus_GraphicsDrawImage($hBackbuffer, $Stator, 0, 0) ;draw background
_GDIPlus_GraphicsClear($hFGBackbuffer, 0xFFFFFFFF) ;clear backbuffer from foreground graphics
_GDIPlus_MatrixRotate($hMatrix, $i, 0) ;rotate foreground graphic
_GDIPlus_GraphicsSetTransform($hFGBackbuffer, $hMatrix)
_GDIPlus_GraphicsDrawImage($hFGBackbuffer, $Rotor, -$mid_x, -$mid_y)
_GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hFGBitmap, $FG_x, $FG_y, $dx, $dy) ;copy foreground backbuffer to main backbuffer
_GDIPlus_GraphicsDrawImage($hBackbuffer, $Schleifkontakte, 0, 0)
_GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $width, $height) ;copy full drawn image to main screen
WEnd
Func _Exit()
_GDIPlus_BitmapDispose($Stator)
_GDIPlus_BitmapDispose($Rotor)
_GDIPlus_BitmapDispose($Schleifkontakte)
_GDIPlus_BitmapDispose($hFGBitmap)
_GDIPlus_GraphicsDispose($hFGBackbuffer)
_GDIPlus_MatrixDispose($hMatrix)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hBackbuffer)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
Exit
EndFunc
Danke für die Hilfe