Code: Alles auswählen
XIncludeFile "gdiplus.pbi"
lib = OpenLibrary(#PB_Any, "gdiplus.dll") 
Global sl.l,sl1.l,ga.l,gar.l,wia.f,wiar.f
Enumeration
  #Container_0
  #Button_0
  #Button_1
  #Button_2
EndEnumeration
color = MakeColor(255,255,255,0)
InitSprite()
 
  OpenWindow(0, 0, 0, 800,600, "GdiPlus 1.0", #PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
  OpenWindowedScreen(WindowID(0),10,200,400,400,0,0,0)
   
  CreateSprite(1,128,128,#PB_Sprite_Texture)
   
  ButtonGadget(#Button_0, 20, 40, 110, 40, "QUIT ")
  ButtonGadget(#Button_1, 20, 90, 110, 40, "vor")
  ButtonGadget(#Button_2, 20, 140, 110, 40, "zurück")
  
  ContainerGadget(#Container_0, 260, 10, 128,128)
  Gdiplus_New()
  GdipCreateFromHWND(GadgetID(#Container_0), @*gfx1)
  
  GdipCreateBitmapFromFile("raupe-grau.bmp", @*image1)
  
  sl=64*2.5
  sl1=sl/2
  ga=32
  
  Repeat
  
  Event.l = WaitWindowEvent(2)
  
  GdipDrawImageI(*gfx, *image1, 0, 0)
  
  If GetAsyncKeyState_(#VK_Q)
      wia.f = wia+1
      GdipTranslateWorldTransform(*gfx1, sl1,sl1,0)
      GdipRotateWorldTransform(*gfx1, wia, 0)
      GdipDrawImagei(*gfx1, *image1,-ga,-ga)
      GdipResetWorldTransform(*gfx1)
  EndIf
  
  If GetAsyncKeyState_(#VK_E)
       wia.f = wia-1
      GdipTranslateWorldTransform(*gfx1, sl1,sl1,0)
      GdipRotateWorldTransform(*gfx1, wia, 0)
      GdipDrawImagei(*gfx1, *image1,-ga,-ga)
      GdipResetWorldTransform(*gfx1)
  EndIf
  
  ClearScreen(RGB(255,255,0))
   
  DisplayTransparentSprite(1,10,10)
  
  FlipBuffers() 
   
  Until Event = #PB_Event_CloseWindow   
 
End