#include once "window9.bi"
Using GDIPLUS
Dim shared ULONG_PTR_01 AS ULONG_PTR
DIM GDIPLUSSTARTUPINPUT_01 AS GDIPLUSSTARTUPINPUT
GDIPLUSSTARTUPINPUT_01.GdiplusVersion = 1
IF (GDIPLUSSTARTUP(@ULONG_PTR_01, @GDIPLUSSTARTUPINPUT_01, NULL) <> 0) THEN
	PRINT "FAIL"
EndIf
Function Rotate4_Image(ByVal imagesourse As HBITMAP,ByVal angle As Integer) As HBITMAP Export
  Dim As GpBitmap Ptr GPIMAGE_01
  Dim As HBITMAP imageoutput
  GdipCreateBitmapFromHBITMAP(imagesourse, NULL, @GPIMAGE_01)
  GdipImageRotateFlip(Cast(GpImage Ptr,GPIMAGE_01),angle)
  GdipCreateHBITMAPFromBitmap(GPIMAGE_01 ,@imageoutput,0)
  GDIPDISPOSEIMAGE (Cast(GpImage Ptr,GPIMAGE_01))
  Return imageoutput
End Function


