Draw on pixel point with GDI+

P

Pat Keel

Hi there,
Im looking for a solution to draw a one pixel sized point to a graphics
control. E.g. DrawLine(10,10, 11,11) draws 2 pixels, DrawLine(10,10,
10,10) has no effect.
How to do?
Thanks
Pat
 
P

Pat Keel

Vijaye said:
Did you try DrawRectangle, with width and height 1 pixel each?

-vJ
Hi Vijaye,
Yes, unfortunately DrawRectangle with width and height of 1 gives a
square of total 4 pixel. I testet it with the magnifiying glass function
of WinXP.
Any other solutoins?
 
V

Vijaye Raji

ooops. Sorry. I should have said FillRectangle. DrawRect, uses a pen to
draw a border, FillRect, doesn't.

-vJ
 
P

Pat Keel

Hi Vijaye,
This makes the job! Thank You!
SolidBrush b = new SolidBrush(Color.Black);
g.FillRectangle(b, x, y, 1,1);
Nice workaround.
Best Regards
Pat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top