I am writing WPF code to show a real-time plot which is a connected line containing about 10,000 points. It takes about 5 seconds to show a picture in my computer. Does anyone have an idea to make it quicker and within 0.5 second?
class eee : FrameworkElement
{
public eee()
{
_children = new VisualCollection(this);
Random rand = new Random();
DrawingVisual dv = new DrawingVisual();
using (DrawingContext dx = dv.RenderOpen())
{
Pen drawingPen = new Pen(Brushes.Black, 1);
double x=rand.Next(300);
double y = rand.Next(300);
for (double i = 0; i < 1000; i = i + 0.1)
{
y = 100 + rand.Next(100);
dx.DrawLine(drawingPen, new Point(i, x), new Point(i + 1, y));
x = y;
}
}
_children.Add(dv);
}