I need to draw only 1 pixel but I can not found out the way...
I tried to use like following in some function
(point1 is Point instance)
Graphics gB = Graphics.FromImage(gBmp);
gB.DrawEllipse(pen.WHITE, point1.X, point1.Y, 1, 1);
gB.DrawRectangle(pen.WHITE, point1.X, point1.Y, 1, 1);
gB.DrawLine(pen.WHITE, point1,point1);
All of above example are not drawing only 1 pixel (looks 4 pixel...)
Someone recommand me drawEllipse or drawLine but the result was not
only 1 pixel...
I tried to find out the solution in web site but I could not find....
How to draw ONLY one pixel?????
Claire - 23 Aug 2007 10:20 GMT
Have u looked at the bitmap.setpixel() method?
>I need to draw only 1 pixel but I can not found out the way...
>
[quoted text clipped - 14 lines]
>
> How to draw ONLY one pixel?????
edward.j.stewart@gmail.com - 30 Aug 2007 23:15 GMT
I searched for a long time today to answer this question and finally
found something that works:
System.Drawing.Bitmap bm = new System.Drawing.Bitmap(1,1);
bm.SetPixel(0, 0, color);
graphics.DrawImageUnscaled(bm, x , y);
Creates a new 1x1 bitmap, sets it color, then adds it to your graphics
object. I lost the source where I found this now, but many thanks to
whomever that was!