Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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!

Posted

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...