1
DotNet / [UPDATED] convert graphics.image to sfml.graphics.image
« on: July 31, 2009, 10:18:57 pm »
Can somebody change the following code that it could be used with sfml directly
PS: the code is the reason, why i wanted to change the image into sfml
Code: [Select]
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