|
-
Oct 27th, 2010, 05:19 AM
#1
Thread Starter
Junior Member
Multithreaded graph and GDI+ speed vs Direct2D
Hello,
I have finally made the switch VB.net and I am using VS2010 .NET 4.0 with WinForms. I want to generate a real time 2D plot with autoscaling and update the graphics/picturebox/form/<insert control here> from another thread so when I click a menu the device doesn't halt. The graphics are intensive in that a function is continually reading from hardware and drawing the data. I have been able to do this in VB6 (minus the multithreading) with GDI API and it ran great. Now in VB.NET GDI+ is used which is extremely slow. So my questions are as follows:
1) Should I go back to GDI commands or will this be outdated soon.
2) Should I use Direct2D, if so do I need to switch to WPF and are there any WinForm examples
3) Best approach to multithread this, if I double buffer can I have the GUI thread periodically read the buffer and display it. How can I tell the drawing thread to post an update and the UI thread displays it when it has the chance, similar to using InvalidateRect()
Thank you and sorry for the multiple questions, I just want many of the answers so I don't end up writing junk while trying to figure VB.NET out.
-
Oct 27th, 2010, 10:33 AM
#2
Re: Multithreaded graph and GDI+ speed vs Direct2D
WPF automatically uses DirectX, so it'll have the performance you're looking for. It's a nice package especially for doing business graphics.
Even GDI has it's limitations; but going back to it is like reverting back to DOS because it added 2+2 faster.
You don't need to use WPF to use DirectX, you can create a DirectX render window yourself either via direct API calls; the Managed DirectX (MDX) assembly from Microsoft, or Microsoft's XNA Game Studio platform. Just because it's called "Game Studio" doesn't mean you have to use it to make games. 
With either WPF, MDX or XNA, you don't need to worry about backbuffering or any of the nitty-gritty of performance graphics. The APIs handle it all for you. I wouldn't worry about multithreading it.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|