日期:2014-05-17 浏览次数:20762 次
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim ag As Graphics
ag = Me.CreateGraphics
Dim pbleft, pbtop As Single
pbleft = 312 + 60
pbtop = 169 + 60
Dim rotatePoint As New PointF(pbleft, pbtop)
Dim mymatrix As New Matrix
mymatrix.RotateAt(-10, rotatePoint, MatrixOrder.Append)
ag.Transform = mymatrix
Dim newImage As Image = Image.FromFile("D:\66.png")
Dim ulCorner As New PointF(312.0F, 169.0F)
ag.DrawImage(newImage, ulCorner)
ag.Dispose()
End Sub
Graphics g = e.Graphics;
g.TranslateTransform(pictureBox1.Width / 2, pictureBox1.Height / 2);
g.RotateTransform(angle);
g.DrawImage(boximg, -pictureBox1.Width / 2, -pictureBox1.Height / 2, pictureBox1.Width, pictureBox1.Height);
g.RotateTransform(-angle);
g.ResetTransform();