Hey guys!
I have a button on my form, now everytime I click on it, I want a picture to rotate a further 90 degrees. This is what I have so far :
The problem is, eventhough my counter RC, becomes incremented, the graphic doesn't rotate to a value of more than 90 degrees. The Selrect object is a dynamic selection rectangle.Code:Dim RBMP As New Bitmap(Selrect.Width, Selrect.Height) Dim RI As Graphics = Graphics.FromImage(rbmp) Select Case RC 'counter Case 90 RI.TranslateTransform(90.0F, 0.0F) 'needs a bit of work RI.RotateTransform(90) 'needs a bit of work RI.DrawImage(pic1.Image, New Rectangle(0, 0, Selrect.Width, Selrect.Height), rtSel, GraphicsUnit.Pixel) Case 180 RI.TranslateTransform(180.0F, 0.0F) 'needs a bit of work RI.RotateTransform(180) 'needs a bit of work RI.DrawImage(pic1.Image, New Rectangle(0, 0, Selrect.Width, Selrect.Height), rtSel, GraphicsUnit.Pixel) Case 270 RI.TranslateTransform(270.0F, 0.0F) 'needs a bit of work RI.RotateTransform(270) 'needs a bit of work RI.DrawImage(pic1.Image, New Rectangle(0, 0, Selrect.Width, Selrect.Height), rtSel, GraphicsUnit.Pixel) Case 360 RI.TranslateTransform(360.0F, 0.0F) 'needs a bit of work RI.RotateTransform(360) 'needs a bit of work RI.DrawImage(pic1.Image, New Rectangle(0, 0, Selrect.Width, Selrect.Height), rtSel, GraphicsUnit.Pixel) Case Is > 360 RC = 0 End Select pic2.Image = RBMP
How can I achieve this?




Reply With Quote