|
-
Apr 24th, 2002, 09:25 AM
#1
Thread Starter
Fanatic Member
rotate, how?
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....)
Don't pay attention to this signature, it's contradictory.
-
Apr 25th, 2002, 07:17 AM
#2
Frenzied Member
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).
Sanity is a full time job
Puh das war harter Stoff!
-
Apr 25th, 2002, 07:43 AM
#3
Thread Starter
Fanatic Member
.........
I tried the cos/pi/angle and all that, can,t get it to work.
Do u have an example of the code?
Don't pay attention to this signature, it's contradictory.
-
Apr 25th, 2002, 07:46 AM
#4
Frenzied Member
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
Code:
angle=45*Pi/180
Sub Button1_Click()
button1.left = button1.left + 5*cos(angle)
button1.top = button1.top + 5*sin(angle)
End Sub
now the button should move 5 pixels of distance every time you press it.
Sanity is a full time job
Puh das war harter Stoff!
-
Apr 25th, 2002, 08:26 AM
#5
Thread Starter
Fanatic Member
well
ur code worked but I changed te angle and it still went the same direction!!!!
Don't pay attention to this signature, it's contradictory.
-
Apr 25th, 2002, 09:34 AM
#6
Frenzied Member
totally impossible unless you added n*360 
check if you wrote the code right again...
Sanity is a full time job
Puh das war harter Stoff!
-
Apr 25th, 2002, 10:43 AM
#7
Thread Starter
Fanatic Member
maybe if
do I have to define pi as 3.#####?
(do u know the numbers?)
Don't pay attention to this signature, it's contradictory.
-
Apr 25th, 2002, 11:00 AM
#8
Frenzied Member
yeah you do 3.14 will do it...
Sanity is a full time job
Puh das war harter Stoff!
-
Apr 25th, 2002, 01:17 PM
#9
Thread Starter
Fanatic Member
well, one uestion answered
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.
Don't pay attention to this signature, it's contradictory.
-
Apr 25th, 2002, 03:51 PM
#10
Frenzied Member
well that question is answered to
go to www.ur.co.nz and take a look at the rotate pictures tutorial!
Sanity is a full time job
Puh das war harter Stoff!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|