Hi epvpers,
ich habe wiedermal ein Problem mit GDI+. Ich habe mir ein Tutorial über Front und backbuffer angesehen und wollte das selbst mal umsetzen. Nur irgendwie gehts nicht

Hoffe jemand kann helfen.
Der Code:
PHP Code:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GdiPlus.au3>
#include <Misc.au3>
_GDIPLUS_STARTUP()
OnAutoItExitRegister("_ende")
VarSet()
setGui()
GdiSetStats()
GUISetOnEvent(-3, "_Exit")
GUISetState()
while 1
Select
case _IsPressed(25)
$x=$x-1
case _IsPressed(26)
$y=$y-1
case _IsPressed(27)
$x=$x+1
case _IsPressed(28)
$y=$y+1
EndSelect
newPos()
if $wm_paintt=1 Then WM_PAINT()
if GuiGetMsg($hGUI)=$GUI_EVENT_CLOSE Then Exit
WEnd
Func _ende()
_GdiPlus_GraphicsDispose($flaeche)
_GdiPlus_Shutdown()
_GDIPLUS_BRUSHDISPOSE($REDstyle)
EndFunc
Func VarSet()
Global $iWidth=400, $iHeight=400, $x=1, $y=1, $xOld=1 , $yOld=1, $wm_paintt=0
Global $rSpeed=1
EndFunc
Func setGui()
Global $hGUI = GuiCreate("Meine GDI Tests",$iWidth,$iHeight)
GuiSetState()
EndFunc
Func GdiSetStats()
Global $flaeche=_GDIPlus_GraphicsCreateFromHWND($hGUI)
Global $REDstyle=_GdiPlus_BrushCreateSolid(0xFFFF0000)
GLobal $bBufferflaeche=_GDIPlus_BitmapCreateFromGraphics($iWidth,$iHeight,$flaeche)
Global $bBuffer=_GDIPlus_ImageGetGraphicsContext($bBufferflaeche)
Global $figur=_GDIPlus_ImageLoadFromFile(@ScriptDir&"\figur.jpg")
Local $h=_GDIPlus_ImageGetHeight($figur)
Local $b=_GdiPlus_ImageGetWidth($figur)
Global $gPlayer=$h/$b
EndFunc
Func newPos()
Global $wm_paintt=1
Global $yOld=$y
Global $wm_paintt=1
Global $xOld=$x
EndFunc
Func WM_PAINT()
_GDIPlus_GraphicsClear($bBuffer,0xFFF0F0F0) ; Das komplette Grafikobjekt übermalen ("Superradierer" :D)
_GdiPlus_GraphicsDrawImageRect($bBuffer,$figur,$x,$y,20,20 * $gPlayer)
_GDIPlus_GraphicsDrawImageRect($flaeche,$bBuffer,0,0, $iWidth, $iHeight)
EndFunc
Hoffe ich habe es nicht zu verwirrend geschrieben
Der Fehler:
Nichts passiert. Einfach eine weiße GUI.
Thx an alle Helfer, lg V8II