Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
well, i'm trying to make a small game involving shooting arrows at targets, and i'm trying to implement the first part (shooting the arrow) I've made some relatively simple code

Bitmap bit = new Bitmap(this.Width, this.Height);
                Graphics g = Graphics.FromImage(bit);
                Graphics form = this.CreateGraphics();
                pntPoints[0] = this.pictureBox1.Location;
             
                pntPoints[1] = new Point(100,300);
                pntPoints[2] = new Point(200, 150);
                g.DrawCurve(p, pntPoints);
          
            form.DrawImage(bit, 0, 0);
                bit.Dispose();
                g.Dispose();


using a bitmap and drawing it to the form (so it can be erased later) and using the random numbers to demonstrate a curve, and from what i can gather, the first point should be where my picturebox is, the second point at (100,300) and the third point at (200,150), meaning I should get a curve going up and then down, however i'm getting a curve that only goes up. Can anyone explain why? thanks :)
Posted

1 solution

I believe it is because vertical measure increases in a downward direction. This means that pntPoints[1](vertical 300) has a lower vertical position than pntPoints[2](vertical 150). This would cause your curve to swoop upwards.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900