tic, you're the man, thx!
I figured it was something about not applying the transformed graphics to the bitmap, thx for pointing out the specifics
Could I get you to briefly scan this code, just to verify that its not going to be leaving anything open in memory or anything that is unneeded? I havnt added error checking or anything, I just wanna know if I'm cleaning up correctly
Code:
File1 = file.jpg
Angle = 45
; Start gdi+
If !pToken := Gdip_Startup()
{
MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
ExitApp
}
pBitmap := Gdip_CreateBitmap(350, 350)
G := Gdip_GraphicsFromImage(pBitmap)
pBitmapFile1 := Gdip_CreateBitmapFromFile(File1)
Width := Gdip_GetImageWidth(pBitmapFile1), Height := Gdip_GetImageHeight(pBitmapFile1)
; using white in my program, green for testing
;pBrush := Gdip_BrushCreateSolid(0xffffffff)
pBrush := Gdip_BrushCreateSolid(0xff00ff00)
Gdip_FillRectangle(G, pBrush, 0, 0, 350, 350)
Gdip_DeleteBrush(pBrush)
Gdip_GetRotatedDimensions(Width, Height, Angle, RWidth, RHeight)
Gdip_GetRotatedTranslation(Width, Height, Angle, xTranslation, yTranslation)
Gdip_TranslateWorldTransform(G, xTranslation, yTranslation)
Gdip_RotateWorldTransform(G, Angle)
Gdip_DrawImage(G, pBitmapFile1, 0, 0, Width, Height, 0, 0, Width, Height)
Gdip_DisposeImage(pBitmapFile1)
Gdip_SaveBitmapToFile(pBitmap, "out.jpg")
Gdip_DisposeImage(pBitmap)
Gdip_DeleteGraphics(G)
Gdip_Shutdown(pToken)