Hey Leute
alle meinen, dass GDI+ total schnell ist, aber irgendwie flackert das bei mir trotz Buffer-.-
Hoffentlich könnt ihr mir helfen
Spoiler anzeigen
#include
#include
#include
$xg = 0
$yg = 0
$xb = 400
$yb = 0
OnAutoItExitRegister("_EXIT")
_GDIPlus_Startup()
$Gui = GUICreate("GDIPlus",500,500,100,100)
$graphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
$bitmap = _GDIPlus_BitmapCreateFromGraphics(500,500,$graphic)
$buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
$brushGruen = _GDIPlus_BrushCreateSolid(0xFF60CC3F)
$brushWeiss = _GDIPlus_BrushCreateSolid(0xFF000000)
$brushBlau = _GDIPlus_BrushCreateSolid(0xFF6677FF)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case _IsPressed(25 ) And $xg >= 0
$xg -= 2
Case _IsPressed(26 ) And $yg >= 0
$yg -= 2
Case _IsPressed(27 ) And $xg <= 400
$xg += 2
Case _IsPressed(28 ) And $yg <= 400
$yg += 2
EndSelect
_GDIPlus_GraphicsFillRect($buffer,0,0,500,500,$brushWeiss)
_GDIPlus_GraphicsFillRect($buffer,$xg,$yg,100,100,$brushGruen)
_GDIPlus_GraphicsDrawImageRect($graphic, $bitmap,0,0,500,500)
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case _IsPressed(41) And $xb >= 0
$xb -= 2
Case _IsPressed(57) And $yb >= 0
$yb -= 2
Case _IsPressed(44) And $xb <= 400
$xb += 2
Case _IsPressed(53) And $yb <= 400
$yb += 2
EndSelect
_GDIPlus_GraphicsFillRect($buffer,0,0,500,500,$brushWeiss)
_GDIPlus_GraphicsFillRect($buffer,$xb,$yb,100,100,$brushBlau)
_GDIPlus_GraphicsDrawImageRect($graphic, $bitmap,0,0,500,500)
WEnd
Func _EXIT()
_GDIPlus_GraphicsDispose($graphic)
_GDIPlus_GraphicsDispose($buffer)
_GDIPlus_BitmapDispose($bitmap)
_GDIPlus_Shutdown()EndFunc ;==>_EXIT