_Nightblade_

Hello i create 1 circle in the center and want 4 circles to rotate

around it. butt they seam to have amind off there one.

this is the code sofare:

Code Block

Imports System.Drawing.Drawing2D

Public Class Form1

Friend WithEvents Timer1 As Timer

Friend WithEvents Button1 As Button

Friend WithEvents Button2 As Button

' -- Red Circle --

Private Redangle As Single = 0

Private Reddelta As Single = 1

' -- Yellow Circle --

Private Yellowangle As Single = 0

Private Yellowdelta As Single = 2

' -- Blue Circle --

Private Blueangle As Single = 0

Private Bluedelta As Single = 3

' -- Green Circle --

Private Greenangle As Single = 0

Private Greendelta As Single = 4

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

InitializeComponent()

Me.Timer1 = New Timer

Me.Button1 = New Button

Me.Button2 = New Button

' de instellingen van Form 1.

Me.Timer1.Enabled = False

Me.WindowState = FormWindowState.Maximized

Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None

Me.BackColor = Color.Black

Me.DoubleBuffered = True

Me.Controls.Add(Me.Button1)

Me.Controls.Add(Me.Button2)

' de instellingen van Button 1.

Me.Button1.Size = New Size(100, 30)

Me.Button1.UseVisualStyleBackColor = True

Me.Button1.Location = New Point(0, 0)

Me.Button1.Text = "Start."

' de instellingen van Button 2.

Me.Button2.Size = New Size(100, 30)

Me.Button2.UseVisualStyleBackColor = True

Me.Button2.Location = New Point(100, 0)

Me.Button2.Text = "Exit."

End Sub

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

e.Graphics.TranslateTransform(Me.ClientRectangle.Width / 2, Me.ClientRectangle.Height / 2)

' Create a 5 different pens.

Dim WhitePen As New Pen(Color.White, 2)

Dim RedPen As New Pen(Color.Red, 2)

Dim YellowPen As New Pen(Color.Yellow, 2)

Dim BluePen As New Pen(Color.Blue, 2)

Dim GreenPen As New Pen(Color.Green, 2)

' Create rotating point.

Dim RPoint As New Point(650.0, 450.0)

' Create location and size of Center ellipse.

e.Graphics.DrawEllipse(WhitePen, -50, -50, 100, 100)

e.Graphics.FillEllipse(Brushes.White, -50, -50, 100, 100)

' Create the rotating Circles.

e.Graphics.RotateTransform(Redangle)

e.Graphics.TranslateTransform(50, 0)

e.Graphics.DrawEllipse(RedPen, 50, 50, 50, 50)

e.Graphics.RotateTransform(Yellowangle)

e.Graphics.TranslateTransform(150, 0)

e.Graphics.DrawEllipse(YellowPen, 50, 50, 50, 50)

e.Graphics.RotateTransform(Blueangle)

e.Graphics.TranslateTransform(175, 0)

e.Graphics.DrawEllipse(BluePen, 50, 50, 50, 50)

e.Graphics.RotateTransform(Greenangle)

e.Graphics.TranslateTransform(200, 0)

e.Graphics.DrawEllipse(GreenPen, 50, 50, 50, 50)

End Sub

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Timer1.Enabled = True

End Sub

Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click

Timer1.Enabled = False

End

End Sub

Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Me.Redangle += Me.Reddelta

If Redangle > 360 Then

Redangle -= 360

End If

Me.Yellowangle += Me.Yellowdelta

If Yellowangle > 360 Then

Yellowangle -= 360

End If

Me.Blueangle += Me.Bluedelta

If Blueangle > 360 Then

Blueangle -= 360

End If

Me.Greenangle += Me.Greendelta

If Greenangle > 360 Then

Greenangle -= 360

End If

Invalidate()

End Sub

End Class

All i want is that they all rotate around the White Circle

Any Suggestions are welcom

thanks

Nightblade.




Re: Visual Basic Express Edition NOT FUNNY ENYMORE

ReneeC

If you want these circles to appear to rotate around a circle, I'd make an image and simply rotate the entire image.






Re: Visual Basic Express Edition NOT FUNNY ENYMORE

_Nightblade_

ReneeC

You gave me the link to

http://www.bobpowell.net/beginnersgdi.htm

this whas verry good stuf i'm still trying out things (like that yellow square)

did you fixed it .

Don't say how !

Besides i have figgert out how to make 2 circles rotate around.

the one in the center.

butt the other two are out off controle and all of this is annoiing

butt 1 week ago i dident know how to draw a line in the paint.

if i may say so i think i have learn a lot over the last week.

Butt this some test for the real thing.

i wanne build something like a screensaver Vista got some

sort off short movie that repeats on your desktop.

i have seen and downloaded only 8 off them.

all i try is to create something simple, the endgoal still far.

away butt i won't give up.

http://www.astrogemini.com/solar-system.html

there is the a example butt that is not the endgoal.

the one about earth is the end goal.

butt i want to click on one off the rotating circles

than switch to another form and do somthing

like this earth 3D.

I have collected a lot off pictures today as backgoundimage.

butt i need to controle 10 circles for it and by 2 i lose

control.

the third one is alway in conflict with the first and taking the

fourth right behind it and on.

the first makes 2 full rotations

the second makes 1.5 full rotations

the thirt commits suicide on the second not even to talk about the rest

i want to know how and the help off VS2008 sucks

only rotateflip is availleble

All i wanne know is how to make the white circle in the center the standaardt

rotating point so i'm downloading VS2005 Library (April) Maybe that helps me

It is like this the white circle gets a red around it then a yellow then blue

the red and yellow are doing what i want the ain't listening no mather what i

change it constand lapping the yellow one.

while the next one is chaising the yellow and on and on. so have to wait 1 more

hour for the download then instal and hope it is in there.

Nightblade






Re: Visual Basic Express Edition NOT FUNNY ENYMORE

_Nightblade_

Okee ReneeC

This is one for you because there is nothing about this

in vs2005 and vs2008 helpfiles.

i have made it simple for you

copy paste and try to remove the gray lines that are stil

visible i can't remove them.

Code Block

Public Class Form1

Private Move_To As New Point

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Me.Size = New Size(1024, 600)

Me.BackColor = Color.Pink

Me.TransparencyKey = Color.Pink

Me.Text = ""

Me.ControlBox = False

Me.MaximizeBox = False

End Sub

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

' Create a Pen.

Dim B_Pen As New Pen(Color.Black, 2)

Dim x As Single = 0

Dim y As Single = 30

Dim width As Single = 1000.0F

Dim height As Single = 500.0F

e.Graphics.DrawEllipse(B_Pen, x, y, width, height)

e.Graphics.FillEllipse(Brushes.Black, x, y, width, height)

End Sub

Private Sub Form1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove

Dim delta As New Size(e.X - Move_To.X, e.Y - Move_To.Y)

If (e.Button = MouseButtons.Left) Then

Me.Location += delta

Move_To = e.Location - delta

Else

Move_To = e.Location

End If

End Sub

End Class

So everybody can see that the original size is 1024 by 600

How i don't know and nothing in the helpfiles ether.

2 library's still nothing. AMAIZING HE.

Regards

Nightblade.






Re: Visual Basic Express Edition NOT FUNNY ENYMORE

JohnWein

Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None





Re: Visual Basic Express Edition NOT FUNNY ENYMORE

_Nightblade_

Thanks John

Do you no by anny chance for the rotating problem aswell






Re: Visual Basic Express Edition NOT FUNNY ENYMORE

ReneeC

Nightblade... you'll be more understandable of you tidy up your English a bit.

I've been trying to tell you something. Where you have images circling another image in a regular fashion. Make one image one rotate it rather than do all those caluclations.

I like your idea of a screen saver. You will have to calculate the points along an elipse to do that.

Let me know if you figure out how the Vista Mystify Screen saver is done because its beautiful.






Re: Visual Basic Express Edition NOT FUNNY ENYMORE

_Nightblade_

Ok i Understand

I try to explain it again

i have a circle in the center

then i have the idee of letting 10 other rotate around that one.

butt the first 2 are rotating like they have to.

the third is rotating around the second

the fourth around the third.

and on.

And they don't rotate at the same speed, if i understand you

then you want me to use a image and let that rotate.

butt the image use Fliprotate

http://msdn2.microsoft.com/en-us/library/system.drawing.rotatefliptype.aspx

http://msdn2.microsoft.com/en-us/library/system.drawing.image.rotateflip.aspx

this way all have the same speed 90, 180, 270, 360 steps not what i want.

Nightblade.






Re: Visual Basic Express Edition NOT FUNNY ENYMORE

ReneeC

OOOOOh

You are doing something far more complicated than I thought and you are right.

Goddess, you are going to have to do some computation. You know what

You may as well come up with an equation that calculates X and Y for

Mass1 = the body being revolved around

Mass2 = the revolving body

Velocity of Mass2

Distance between the masses

Orbital eliptical maxima

Orbital eliptical minima

Degree Heading of Eliptical Maximum

TimeSpan

Last X and Last Y

You are going to need that. This is astrophysics and I'm no astrophysicist. I have a feeling I haven't touched on everything.






Re: Visual Basic Express Edition NOT FUNNY ENYMORE

Dave299

Like Renee I'm having a bit of trouble understanding exactly what you are trying to do but going back to your original question you said:

"All i want is that they all rotate around the White Circle"

If that is the case then something as simple as this might work for you:

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

Dim Centre As New Point(CInt(Me.ClientRectangle.Width / 2), CInt(Me.ClientRectangle.Height / 2))

e.Graphics.TranslateTransform(CSng(Me.ClientRectangle.Width / 2), CSng(Me.ClientRectangle.Height / 2))

e.Graphics.FillEllipse(Brushes.White, -50, -50, 100, 100)

e.Graphics.RotateTransform(Redangle)

e.Graphics.DrawEllipse(RedPen, 50, -25, 50, 50)

e.Graphics.RotateTransform(Greenangle)

e.Graphics.DrawEllipse(GreenPen, 100, -25, 50, 50)

e.Graphics.RotateTransform(Yellowangle)

e.Graphics.DrawEllipse(YellowPen, 150, -25, 50, 50)

e.Graphics.RotateTransform(Blueangle)

e.Graphics.DrawEllipse(BluePen, 200, -25, 50, 50)

End Sub





Re: Visual Basic Express Edition NOT FUNNY ENYMORE


Re: Visual Basic Express Edition NOT FUNNY ENYMORE

ReneeC

if he is building a screen saver that accurately represents multi-bodied orbital paths, that's not all he wants and actually, I don't think that's where he wants to begin because will lead him down a very wrong path.