• Advertisement
Sign in to follow this  

drawing a row

This topic is 4586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi at all! I would to draw a line of 3 pixel thickness on the Top-left corner (0,0) of the window rendered and width as the whole window. I use this code but it doesn't work.
Line m = new Line(device);
				Vector2[] v = new Vector2[2];
				v[0].X = 0.0f;
				v[0].Y = 0.0f;
				
				v[1].X = -200.0f;
				v[1].Y = -200.0f;


				m.Draw(v, 3453453);
Some advice?

Share this post


Link to post
Share on other sites
Advertisement
By the looks of it, you're using C# and D3D/DDraw, right?

Haven't tested it, might work:

Line l = new Line(device);
Vector2[] v = new Vector2[2];
v[0].X = 0.0f;
v[0].Y = 0.0f;
v[1].X = this.Width; // Assume this is a valid Form. If not, replace with reference to your Form or specify the window width somewhere else
v[2].Y = 3.0f; // 3 pixels high

l.Draw(v, Color.Green);


Next time, don't use Int32 values for colors, as they confuse the reader. In fact, never use magic numbers. Use constants :)

Toolmaker

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement