How do I make a picture rotate.
Oh, and how do I make a thing move along an angle (45 degrees would equal moving up and right....)
Printable View
How do I make a picture rotate.
Oh, and how do I make a thing move along an angle (45 degrees would equal moving up and right....)
for rotating pictures take a look at www.ur.co.nz or search the forum this question has been asked many times...
for the movement along an angle you just need a little trig:
x=x+Speed*cos(angle)
y=y+Speed*cos(angle)
while angle is in radians. To convert degree to radians take it times (Pi/180).
I tried the cos/pi/angle and all that, can,t get it to work. :mad: :(
Do u have an example of the code?
hm well what I just put here is the code...
you lets say for a test you are running a button over a form with an angle of 45.
so you go like
now the button should move 5 pixels of distance every time you press it.Code:angle=45*Pi/180
Sub Button1_Click()
button1.left = button1.left + 5*cos(angle)
button1.top = button1.top + 5*sin(angle)
End Sub
ur code worked but I changed te angle and it still went the same direction!!!!:( :confused:
totally impossible unless you added n*360 :)
check if you wrote the code right again...
do I have to define pi as 3.#####?
(do u know the numbers?)
yeah you do 3.14 will do it...
now I just need ot know how ot make a picture rotate. as in bitblt image (or paintpicture) to form and have it rotate, so if it was going up and right it would face that way.
well that question is answered to
go to www.ur.co.nz and take a look at the rotate pictures tutorial!