draw a chart to image and display it

I have a chart and I write the points to it - it has a lot of flicker (I have already double buffered the usercontrol) so I want to write the chart to an image and display the image - how do I do that?
        private void UpdatePoints()
        {
            try
            {
                /////////////////////////////////TO LIST START
                while (fSeries.DataPoints.Count > 600)
                {
                    fSeries.DataPoints.RemoveAt(0);
                }
                while (rSeries.DataPoints.Count > 600)
                {
                    rSeries.DataPoints.RemoveAt(0);
                }
                while (blankSeries.DataPoints.Count > 600)
                {
                    blankSeries.DataPoints.RemoveAt(0);
                }
                while (cSeries.DataPoints.Count >= 600)
                {
                    cSeries.DataPoints.RemoveAt(0);
                }
                for (int i = 0; i < alist.Count(); i++)
                {
                    //Helpers.DrawingControl.SuspendDrawing(pressureChart);
                    fSeries.DataPoints.Add(new CategoricalDataPoint() { Value = alist[i].FilteredPressure, Category = alist[i].PressureTime });
                    rSeries.DataPoints.Add(new CategoricalDataPoint() { Value = alist[i].RawPressure, Category = alist[i].PressureTime });
                    cSeries.DataPoints.Add(new CategoricalDataPoint() { Value = alist[i].cValue, Category = alist[i].PressureTime });
                    blankSeries.DataPoints.Add(new CategoricalDataPoint() { Value = alist[i].FilteredPressure, Category = alist[i].PressureTime });
                    //Helpers.DrawingControl.ResumeDrawing(pressureChart);
                }
}
catch(Exception ex)
{
 MessageZBox.Show(ex.Message);
}

Open in new window

LVL 6
r3nderAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
You might try to call SuspendLayout on your UserControl while you are drawing. This could remove the flickering. Call ResumeLayout when you are ready to show it.
r3nderAuthor Commented:
I have a helper class that I do that with - but it didn't help.
Helpers.DrawingControl.ResumeDrawing(pressureChart)

 class DrawingControl
    {
        [DllImport("user32.dll")]
        public static extern int SendMessage(IntPtr hWnd, Int32 wMsg, bool wParam, Int32 lParam);

        private const int WM_SETREDRAW = 11;

        public static void SuspendDrawing(Control parent)
        {
            SendMessage(parent.Handle, WM_SETREDRAW, false, 0);
        }

        public static void ResumeDrawing(Control parent)
        {
            SendMessage(parent.Handle, WM_SETREDRAW, true, 0);
            parent.Refresh();
        }

    }

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
r3nderAuthor Commented:
I ended up drawing the chart to memory and showing the image after it was drawn but thanks for the suggestion James
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.