Can somebody change the following code that it could be used with sfml directly
Private Shared Function RotateImageByAngle(ByVal oldBitmap As System.Drawing.Image, ByVal angle As Single) As Bitmap
Dim newBitmap As Bitmap
Dim graphics1 As Graphics
If oldBitmap.Width >= oldBitmap.Height Then
newBitmap = New Bitmap(oldBitmap.Width * 2, oldBitmap.Width * 2)
Else
newBitmap = New Bitmap(oldBitmap.Height * 2, oldBitmap.Height * 2)
End If
graphics1 = Graphics.FromImage(newBitmap)
graphics1.TranslateTransform(CSng(oldBitmap.Width) / 2, CSng(oldBitmap.Height) / 2)
graphics1.RotateTransform(angle)
graphics1.TranslateTransform(-CSng(oldBitmap.Width) / 2, -CSng(oldBitmap.Height) / 2)
graphics1.DrawImage(oldBitmap, New Point(0, 0))
Return newBitmap
End Function
PS: the code is the reason, why i wanted to change the image into sfml