Hello,
I just started learning C# and have a problem with drawing. I have a small piece of code where I draw to a bitmap defined in memory and then draw the bitmap on the form using the Paint event. I have a piece of code like this :
This should, afair, produce three parallel white lines, and it does indeed, except the color.
The color changes on each line. When I tried to draw more lines I noticed that the color changes in cycles - first line is white, then next five lines have different colors (all variations of grey), then it starts again.
Any hints on that ? I'm pretty lost ...
Mike
I just started learning C# and have a problem with drawing. I have a small piece of code where I draw to a bitmap defined in memory and then draw the bitmap on the form using the Paint event. I have a piece of code like this :
Code:
Graphics objGraphics;
Pen mypen;
// some code I cut
mypen = new Pen(System.Drawing.Color.White);
objGraphics.DrawLine(mypen, 0, 10, drawingArea.Width, 10);
objGraphics.DrawLine(mypen, 0, 20, drawingArea.Width, 20);
objGraphics.DrawLine(mypen, 0, 30, drawingArea.Width, 30);
The color changes on each line. When I tried to draw more lines I noticed that the color changes in cycles - first line is white, then next five lines have different colors (all variations of grey), then it starts again.
Any hints on that ? I'm pretty lost ...
Mike