Kryukov is correct in that the variable
Img
doesn't have anything set to it, so of course it won't save anything properly. You can save the file with the bitmap object that you have created. Here is a method that I found and tweeked for one of my apps to save a jpg file:
Private Sub CreateImage(ByVal strText As String, ByVal strFileName As String, _
ByVal inFont As Font, ByVal inForeColor As Color, _
ByVal inBackColor As Color)
Dim Height As Integer = 400
Dim Width As Integer = 620
Dim objBitmap As New Bitmap(Width, Height)
Dim objGraphics As Graphics = Graphics.FromImage(objBitmap)
Dim objRect As New RectangleF(5, 5, 610, 390)
Dim objBrushForeColor As New SolidBrush(inForeColor)
Dim objBrushBackColor As New SolidBrush(inBackColor)
objGraphics.FillRectangle(objBrushBackColor, 0, 0, Width, Height)
objGraphics.DrawString(strText, inFont, objBrushForeColor, objRect)
objBitmap.Save(strFileName & ".JPG", ImageFormat.Jpeg)
objBrushForeColor.Dispose()
objBrushBackColor.Dispose()
objBitmap.Dispose()
objGraphics.Dispose()
End Sub
My method is hard set to create a 400 x 620 pixel image and I save as a jpg file which was required for my project, but at least this shows you how the save is supposed to work. You should be able to use this code to at least get you past this issue. Hope it helps.