Reputation: 320
I have an array of 36000 points and I'm drawing them on a canvas in a WPF. It takes a lot of time for the CPU to draw it. I have seen alot of information online about GPU acceleration but I didn't find one example / tutorial on how to do this.
foreach (Point myPoint in arr)
{
Rectangle r = new Rectangle();
r.Height = 3;
r.Width = 3;
r.Fill = myBrush;
drawingboard.Children.Add(r);
Canvas.SetTop(r, Center.Y + myPoint.y * 50);
Canvas.SetLeft(r, Center.X + myPoint.x * 50);
}
I want to know how to let the GPU do this work.
Upvotes: 1
Views: 999
Reputation: 17858
To make it a real answer, see how does hardware acceleration work with wpf but the short version is, if it can it will, of it cant it wont.. you dont have to do anything to change that.
Upvotes: 2