Hi
I created an user control where I intend to do some grafical charts.
I put on the user control border style fixed and inside I plot a white rectangle (my background) where I intend to plot.
My question is why sometimes at the edge of the rectangle (usualy in the top or left area) I see some random grey pixels..why disapear if I do resize? The rectangle is ploted from 0,0 which is top left coordinated of the control.
some code below:
class CPlotGraphUserControl : UserControl
in this class i have:
private void OnUserCtrlResize(object sender, EventArgs e)
{
mGetRelativeControlSize();
Invalidate();
Refresh();
}
protected void mInitGraphicalComponents()
{
offScreenBmp = new Bitmap(xSizeMax, ySizeMax);
offScreenDC = Graphics.FromImage(offScreenBmp);
offScreenDC.SmoothingMode = SmoothingMode.AntiAlias;
mUsedPenDrawGraphics = new Pen(Color.Black, 1);
offScreenDC.FillRectangle(backGroundBrush, 0, 0, xSizeMax, ySizeMax);
}
protected override void OnPaint(PaintEventArgs e)
{
mGetRelativeControlSize();
mNormalizeMxCoordinates();
mInitGraphicalComponents();
e.Graphics.DrawImage(offScreenBmp, new Rectangle(0, 0, xSizeMax, ySizeMax), 0, 0, xSizeMax, ySizeMax, GraphicsUnit.Pixel);
base.OnPaint(e);
mDisposeGraphicalComponents();
}