Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Rotating a picture or shape


Rotating a picture or shape

Author
Message
DevinM
DevinM
Forum God
Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)

Group: Forum Members
Posts: 39, Visits: 85
I was wondering if it was possible to rotate or flip a picture or shape during run time.
mikemikk
mikemikk
Forum God
Forum God (479 reputation)Forum God (479 reputation)Forum God (479 reputation)Forum God (479 reputation)Forum God (479 reputation)Forum God (479 reputation)Forum God (479 reputation)Forum God (479 reputation)Forum God (479 reputation)

Group: Forum Members
Posts: 5, Visits: 27
' OriginalImage must already exit

Dim clonedImage As New Bitmap(OriginalImage.Width, OriginalImage.Height, OriginalImage.PixelFormat)

dim CenterPoint as PointF = new pointF(clonedImage.size.width/2,clonedimage.size.height/2)

dim WhereToDraw as new Rectangle(0,0,clonedimage.width,clonedimage.height)

dim Degrees as Single = 90.0F

dim m as New Drawing2D.Matrix

dim m.RotateAt(Degrees, CenterPoint)

dim g as Graphics = Grahpics.FromImage(clonedImage)

g.Transform = m

g.DrawImage(clonedImage,WheretoDraw)

g.Dispose

clonedimage.dispose



That works for me.
Edited
6/1/2007 by mikemikk
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search