Quimbo Posted October 9, 2003 Posted October 9, 2003 Hi, I'm new to this GDI stuff in VB.NET. How can I draw a single pixel onto a control? e.Graphics.DrawLine(MyPen, x, y, x, y) doesn't work and e.Graphics.DrawLine(MyPen, x, y, x + 1, y) draws a small line instead of a single pixel... There isn't a DrawPoint or DrawPixel method, is it? Thank you! Quote
*Experts* mutant Posted October 9, 2003 *Experts* Posted October 9, 2003 You would have to draw a rectangle that is one pixel big using the DrawRectangle method, or FillRectangle. Quote
Quimbo Posted October 10, 2003 Author Posted October 10, 2003 I tried e.Graphics.DrawRectangle(MyPen, New Rectangle(x, y, 1, 1)). It doesn't draw a single pixel point but a 2x2 pixel rectangle. e.Graphics.DrawRectangle(MyPen, New Rectangle(x, y, 0, 0)) doesn't draw anything at all... Same with FillRectangle Any other suggestion? Quote
*Experts* Volte Posted October 10, 2003 *Experts* Posted October 10, 2003 Are you sure? It appears to do a 1x1 pixel for me. [edit]Oh, try using FillRectangle instead[/edit] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.