I have already developed the algorithms behind the physics of projectile motion. My only problem is drawing on a form.How would I achieve this from scratch.
Asked
Active
Viewed 930 times
0
-
you want to know how custom drawing works on a form? – bas Feb 03 '13 at 21:20
-
can you please paste your code vs posting a url link – MethodMan Feb 03 '13 at 21:20
-
@DJKRAZE I dont really have any code at the moment. – user1920206 Feb 03 '13 at 21:22
-
1I'm afraid that's a bit too general for stackoverflow. Google it, you'll get plenty of hits. Maybe this is a starting point: http://www.c-sharpcorner.com/uploadfile/TheButler/the-basics-of-drawing-graphics-onto-windows-forms/ – bas Feb 03 '13 at 21:24
-
search for: winforms custom drawing. hope that helps. – bas Feb 03 '13 at 21:25
1 Answers
1
The question is a bit too general, but just to shed some light, I think you probably want to create a PictureBox
control and draw on that, instead of on the actual form that has your controls and settings.
Here's how you create the Graphics
object for a pictureBox, for example, and then draw a line on it: Draw a line on PictureBox from parent
Now, your simulation, I believe, should actually draw lines, between the newly calculated (x,y) and the previously calculated one, in order to plot a full line instead of just dots, and that will probably happen within a loop in which you vary t
(time) in intervals.

Community
- 1
- 1

Pablo Romeo
- 11,298
- 2
- 30
- 58
-
Feel free to upvote or accept the answer if it has solved your current problem ;) – Pablo Romeo Feb 03 '13 at 21:47