<p>Is there another way to render graphics in C# beyond <a href="https://en.wikipedia.org/wiki/Graphics_Device_Interface#Windows_XP" rel="nofollow noreferrer">GDI+</a> and <a href="http://en.wikipedia.org/wiki/Microsoft_XNA" rel="nofollow noreferrer">XNA</a>? </p>

<p>(For the development of a tile map editor.)</p>

[{'answer_id': 58234, 'author': 'Serafina Brocious', 'author_id': 4977, 'author_profile': 'https://Stackoverflow.com/users/4977', 'pm_score': 4, 'selected': True, 'text': '<p><a href="http://cs-sdl.sourceforge.net/" rel="nofollow noreferrer">SDL.NET</a> is the solution I\'ve come to love. If you need 3D on top of it, you can use Tao.OpenGL to render inside it. It\'s fast, industry standard (<a href="http://en.wikipedia.org/wiki/Simple_DirectMedia_Layer" rel="nofollow noreferrer">SDL</a>, that is), and cross-platform.</p>\n'}, {'answer_id': 58242, 'author': 'Ash', 'author_id': 5023, 'author_profile': 'https://Stackoverflow.com/users/5023', 'pm_score': 2, 'selected': False, 'text': '<p>Yes, I have written a Windows Forms control that wraps DirectX 9.0 and provides direct pixel level manipulation of the video surface.</p>\n\n<p>I actually wrote another post on Stack Overflow asking if there are other better approaches: <em><a href="https://stackoverflow.com/questions/55963/unsafe-c-and-pointers-for-2d-rendering-good-or-bad">Unsafe C# and pointers for 2D rendering, good or bad?</a></em></p>\n\n<p>While it is relatively high performance, it requires the unsafe compiler option as it uses pointers to access the memory efficiently. Hence the reason for this earlier post.</p>\n\n<p>This is a high level of the required steps:</p>\n\n<ol>\n<li>Download the DirectX SDK.</li>\n<li>Create a new C# <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="nofollow noreferrer">Windows Forms</a> project and reference the installed\nMicrosoft DirectX assembly.</li>\n<li>Initialize a new DirectX Device object with Presentation Parameters\n(windowed, back buffering, etc.) you require.</li>\n<li>Create the Device, taking care to record the surface "Pitch" and\ncurrent display mode (bits per pixel).</li>\n<li>When you need to display something, <code>Lock</code> the backbuffer\nsurface and store the returned pointer to the start of surface\nmemory.</li>\n<li>Use pointer arithmetic, calculate the actual pixel position in the\ndata based on the surface pitch,\nbits per pixel and the actual x/y pixel coordinate.</li>\n<li>In my case for simplicity I am sticking to 32&nbsp;bpp, meaning setting a pixel is as simple as:  *(surfacePointer + (y * pitch + x))=Color.FromARGB(255,0,0);</li>\n<li>When finished drawing, <code>Unlock</code> the back buffer surface. Present the surface.</li>\n<li>Repeat from step 5 as required.</li>\n</ol>\n\n<p>Be aware that taking this approach you need to be very careful about checking the current display mode (pitch and bits per pxiel) of the target surface. Also you will need to have a strategy in place to deal with window resizing or changes of screen format while your program is running.</p>\n'}, {'answer_id': 58262, 'author': 'tbreffni', 'author_id': 637, 'author_profile': 'https://Stackoverflow.com/users/637', 'pm_score': 1, 'selected': False, 'text': '<p>You could try looking into WPF, using Visual Studio and/or Expression Blend. I\'m not sure how sophisticated you\'re trying to get, but it should be able to handle a simple editor.  Check out this <a href="http://msdn.microsoft.com/en-us/library/ms742562.aspx" rel="nofollow noreferrer">MSDN Article</a> for more info.</p>\n'}, {'answer_id': 58301, 'author': 'ima', 'author_id': 5733, 'author_profile': 'https://Stackoverflow.com/users/5733', 'pm_score': 2, 'selected': False, 'text': "<ul>\n<li><p>Managed DirectX (Microsoft.DirectX namespace) for faster 3D graphics. It's a solid .NET wrapper over DirectX API, which comes with a bit of performance hit for creating .NET objects and marshalling. Unless you are writing a full featured modern 3D engine, it will work fine.</p></li>\n<li><p>Window Presentation Foundation (WPF) (Windows.Media namespace) - best choice for 2D graphics. Also has limited 3D abilities. Aimed to replace Windows Forms with vector, hardware accelerated resolution-independent framework. Very convenient, supports several flavours of custom controls, resources, data binding, events and commands... also has a few WTFs. Speed is usually faster than GDI and slower than DirectX, and depends greatly on how you do things (seen something to work 60 times faster after rewriting in a sensible way). We had a success implementing 3 1280x1024 screens full of real-time indicators, graphs and plots on a single (and not the best) PC.</p></li>\n</ul>\n"}, {'answer_id': 286868, 'author': 'AngelBlaZe', 'author_id': 24252, 'author_profile': 'https://Stackoverflow.com/users/24252', 'pm_score': 1, 'selected': False, 'text': '<p>You might look into the <a href="https://en.wikipedia.org/wiki/Cairo_(graphics)" rel="nofollow noreferrer">Cairo graphics library</a>. The <a href="http://en.wikipedia.org/wiki/Mono_%28software%29" rel="nofollow noreferrer">Mono</a> project has bindings for C#.</p>\n'}, {'answer_id': 697230, 'author': 'Igor Brejc', 'author_id': 55408, 'author_profile': 'https://Stackoverflow.com/users/55408', 'pm_score': 1, 'selected': False, 'text': '<p><a href="http://igorbrejc.net/development/c/welcome-to-cairo" rel="nofollow noreferrer">Cairo</a> is an option. I\'m currently rewriting my mapping software using both GDI+ and Cairo. It has a tile map generator, among other features.</p>\n'}]
['https://Stackoverflow.com/questions/58230', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/568/']