how can i directly write or manage the graphics memory in c#?
previously i was using picture box and its built in utilities to draw some heavy graphics initially it works very fine but when my GUI grows its response and up开发者_高级运维date time becomes enough large that it shows delays, now i want to directly write in graphics memory to resolve this problem:
first of all tell me is it a good idea if yes then i need some guide lines to do so, or any other good option will be accepted
regards,
You can't really do high performance graphics work in GDI+. Aside from the fact that there's no hardware acceleration, the API is just not designed for it.
If you want raw access to a writable bitmap, you could use the Bitmap.LockBits method. But you would need to implement all of the graphics routines yourself. Another option is Managed DirectX.
This is problaly not really what you're looking for but you can try to use WPF. But it has a steep learning curve. It has a smarter way of rendering graphics, using when possible your graphic cards capabilities so it should make better use of your computer resources.
If you want control of the graphics check out XNA Dev center. While it was designed for games, there is nothing that prevents you from using it for other purposes on a computer.
If you are looking for something that meshes better with standard UIs then you may want to check out WPF. It has some 3D features and works great with 2d acceleration.
It depends on how far you're looking to take it. You can use GDI+ and mix in some unmanaged code into your C# to get a better hold on the graphics capabilities. Learn to use the Bitmap class and pay close attention to your references (I've had numerous encounters with dangling references to bitmaps.)
If you're looking for high-performance graphics in .NET check out Managed DirectX.
精彩评论