G
Guest
I have a DrawRectangle() method to draw a rectangle on my UserControl. The
OnPaint clear it. But in my reall application I cannot draw or update the
rectangle in OnPain. I have to draw or update it in my own method. What
shoudl I do?
Another question: how to draw just one pixel. The coe snippet do not work.
theGraphicsToDrawPoints.DrawRectangle(pen, xCoordinate, yCoordinate, 1, 1);
// Draw 2 by 2 sqare.
theGraphicsToDrawPoints.DrawRectangle(pen, xCoordinate, yCoordinate, 0, 0);
// Draw nothing.
theGraphicsToDrawPoints.DrawRectangle(pen, xCoordinate, yCoordinate, -1,
-1); // Draw nothing.
OnPaint clear it. But in my reall application I cannot draw or update the
rectangle in OnPain. I have to draw or update it in my own method. What
shoudl I do?
Another question: how to draw just one pixel. The coe snippet do not work.
theGraphicsToDrawPoints.DrawRectangle(pen, xCoordinate, yCoordinate, 1, 1);
// Draw 2 by 2 sqare.
theGraphicsToDrawPoints.DrawRectangle(pen, xCoordinate, yCoordinate, 0, 0);
// Draw nothing.
theGraphicsToDrawPoints.DrawRectangle(pen, xCoordinate, yCoordinate, -1,
-1); // Draw nothing.