thanks anybody. I found the best way to resolve my problem and I think it is good.
Public Function RotateImg(ByVal bmpimage As Bitmap, ByVal angle As Single) As Bitmap
Dim w As Integer = bmpimage.Width
Dim h As Integer = bmpimage.Height
Dim pf As PixelFormat = Nothing
pf = bmpimage.PixelFormat
Dim tempImg As New Bitmap(w, h, pf)
Dim g As Graphics = Graphics.FromImage(tempImg)
g.DrawImageUnscaled(bmpimage, 1, 1)
g.Dispose()
Dim path As New GraphicsPath()
path.AddRectangle(New RectangleF(0.0F, 0.0F, w, h))
Dim mtrx As New Matrix()
mtrx.Rotate(angle)
Dim rct As RectangleF = path.GetBounds(mtrx)
Dim newImg As New Bitmap(Convert.ToInt32(rct.Width), Convert.ToInt32(rct.Height), pf)
g = Graphics.FromImage(newImg)
g.TranslateTransform(-rct.X, -rct.Y)
g.RotateTransform(angle)
g.InterpolationMode = InterpolationMode.HighQualityBilinear
g.DrawImageUnscaled(tempImg, 0, 0)
g.Dispose()
tempImg.Dispose()
Return newImg
End Function
call this function:
Dim img As Bitmap
img = New Bitmap(My.Resources.bg4)
PictureBox1.Image = RotateImg(img, Convert.ToSingle(iAngel))