Drawing a pixel

Quimbo

New member
Joined
Oct 9, 2003
Messages
2
Hi,

Im 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) doesnt work and e.Graphics.DrawLine(MyPen, x, y, x + 1, y) draws a small line instead of a single pixel...

There isnt a DrawPoint or DrawPixel method, is it?

Thank you!
 
I tried e.Graphics.DrawRectangle(MyPen, New Rectangle(x, y, 1, 1)).

It doesnt draw a single pixel point but a 2x2 pixel rectangle.

e.Graphics.DrawRectangle(MyPen, New Rectangle(x, y, 0, 0)) doesnt draw anything at all...

Same with FillRectangle

Any other suggestion?
 
Are you sure? It appears to do a 1x1 pixel for me.

[edit]Oh, try using FillRectangle instead[/edit]
 
Back
Top