Relative merits of GDI+ and WPF [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
Whar are the relative merits between GDI+ and WPF?
Also does anyone know the minimum system requirements needed in order to develop/run WPF apps?

GDI+ vs. WPF
What are the benefits of WPF graphics subsystem? Let's see:
Retained Mode Drawing/Composition
Vector Graphics
True Transparency
And more ...
What are the benefits of GDI+? Hmm. That's harder, because I love WPF so much. However, if you were in the position to have to be constantly recreating the geometry of the objects that you are trying to render, then you might need the immediate mode API that GDI+ offers.
Here are two (one, two) really great blog posts on this matter.
(Note that the above blog posts are rather old. They still contain great information, but also be aware that the WPF team has made significant advances in performance and graphics capabilities since the original version of WPF (.NET 3.0)).
System Requirements
They're are really no minimum system requirements for WPF applications other than that the operating system must be at Windows XP SP 2 or greater and that .NET 3.0 (at least) must be installed. However, that being said, the better quality graphics card in the machine the WPF application is running on the better.
What we have noticed ourselves is that WPF performs quite well even on older hardware, especially if you aren't doing anything too tricky or fancy.
What does that mean? Well, in my own experience, watch your performance more closely if you start doing anything with WPF 3D and/or bitmap effects. In fact, I would encourage you to monitor your performance throughout the development of the application.
One final thing I would add ... is that we have seen some very weird graphics issues (this and this) with certain video solutions and in particular with Intel integrated video.
Please check out this other StackOverflow post for more info on hardware limitations, and in particular, check out the information on Rendering Tiers.

Related

What is the most suitable control to use for 3D rendering and animation programming in Windows Forms? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am researching 3D and 2D rendering animation. I found the PictureBox control
is pretty okay for this purpose, but I feel I have only very beginner level knowledge. I am curious to know if it is possible to make a moderately complex level of rendering applications with the PictureBox control. In short, which is the best control in the Windows application tool box to be selected for my intended purpose?
I am making a Windows Forms application with C#.
I'm not sure what exactly you are doing with the PictureBox control for this purpose. But if you're using Windows Forms, then you may want to consider making your own Control subclass with all of your drawing operations handled using GDI+ calls in the OnPaint method. You could pair this with a Timer object called every so often to determine when to refresh.
This is an approach I have personally used for drawing previews of simulated mechanical objects in 2D, so this might work for your purposes as well.
Unless you can tell us what exactly you are trying to draw or provide some existing code for us to look at, it will be hard to give you a precise answer. But MSDN has some pages covering this topic, which you can take a look at to get started and for further reading:
Custom Control Painting and Rendering
Rendering a Windows Forms Control
User-Drawn Controls
Control.OnPaint Method (PaintEventArgs)
Graphics Class
The latest libraries you can use are from Xamarin,
SkiaSharp
UrhoSharp
They wrap over Skia and Urho engine so that you can render 2D or 3D contents in WinForms or WPF or any other kind of applications.

Is Windows Forms Application still a good option? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have not created Windows forms applications (using C# and .NET) since 2005 so I am not sure if it is still a good option for rich client applications. Also I do not know if there is any (comparatively) new framework for building Windows apps other than Composite Application Block.
We have a small team (3 people) in our company who manage the content (e.g. musics, mobile games etc) and I want to build a tool for them. Since there are only a few people who will use this tool I am thinking of creating a Windows app so that rather than spending time and effort on creating a rich Web UI (e.g. using ajax, jquery etc) I focus on the business logic.
I understand that WPF is another option but from my knowledge it is a bit more complicated and time consuming to build an app using WPF.
If Windows forms is my best option, is there any fairly new framework for building Windows apps? 10 years ago I used to use Microsoft's composite application block but it seems to me that it's something for the past!
Building an app using WPF is a bit double edged. It's extremely quick for building something simple, hence why so many tutorials can cover specific behaviours without being gigantic. It's excellent for having automatic layouts, and being able to build said layouts in XAML will feel a thousand times better than setting up alignments in forms, especially if you've done web development. However, deviating from the beaten path (smooth datatypes, good-or-error validation, hardcoded database fields...) will leave you with a steep learning curve, as I find digging around the guts of WPF to be a nightmare.
Note that there are also a number of options available for Mono, most of which also work on Windows without indcident.
EDIT: Since I'm still getting upvotes on this answer, apparently, I'll add that it doesn't seem mono is maintaining the attached page, and the only framework from the above list which appears to have ongoing support is Xwt.

3d animation - WPF or XNA [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I would like to make a 3d animation of a few dozens of primitives
I read the initial position of each atom and with other parameters I need to draw an animation that describe the ordering. I need to view then of all angles, manipulate the color and alpha channel.
All in all, it narrows to WPF 3D or XNA.
I would choose WPF, because I know it and it is a way much easier to add a TextBox to the app.
Yet I am afraid that WPF won't handle the animation or it would be problematic if I need to add some extra bits.
Which one is better for it? Can you point me to some examples how to manage datastructres and draw the animation? (I am new to 3d animations)
EDIT:
If anyone is interested in here the code and the app http://alloysvisualisation.codeplex.com/ I use Model3DGroup to build a mode from GeometryModel3D. As a result, performance is pretty good.
We use both WPF and XNA for 3D rendering in the projects I'm currently working on. The XNA stuff is used from within a WPF application, so there is no problem using those two combined either.
I would use WPF for the 3D rendering if you have a simple scene since I like the abstraction it gives you. You simply add objects to the scene, set up some cameras and lights and the rest is handled for you. We use WPF for a visual editor containing up to ~500 cylinders without any performance problems. The one performance issue we have had is that it takes a long time to add/remove objects from the scene. So WPF is not a good fit if that is something you need to do a lot of.
However, if you have more complex needs or if the application is performance critical I would go with XNA to get closer to the metal. It gives you a more "classic", OpenGL like approach to rendering.
To summarize:
WPF:
Simple to use
Nice abstraction
Ok performance overall
Poor performance when adding/removing objects
XNA:
Close to the metal
Good performance
Feels more like OpenGL if you are used to that
Works with both WinForms and WPF
A resource that we have used for the WPF side of things is Charles Petzold's writings on the subject. We currently use stuff from his library. It got us started quickly, but we've had some issues, so I would recommend some caution. However, the stuff on his site is worth looking at.
XNA + WPF is the solution. This article will guide you through the process: http://www.codeproject.com/Articles/38301/XNA-integration-inside-WPF
Definetely XNA is faster and more convenient for extensive 3D work. WPF is fine for 3D, but XNA is easier to debug and offers several nice features, such as additive alpha blending and a Camera object. Also, you can find good libraries to support your work.
If you are not sure, then you should without doubt use an XNA object to draw the graphics. WPF will provide you with buttons and text, which, in turn, are a pain in XNA.
Xna will offer easier debugging of the 3d aspects.
You could follow the winforms example to host xna in a windows forms form and then all the familiar controls like drop downs and buttons will work fine and interact with xna.

What to use? Tao, SharpGL, OpenTK, DirectX P/Invoke, XNA, MDX, SlimDX, Windows API Codec Pack [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Back in the day it was easy; You made your own 3D stuff, then came DirectX, then came OpenGL. For .Net developers MDX was nice. Then XNA took over for MDX, but it its not the same. XNA seems to be very game-centric with all the content pipelining and preloading of fixed models and stuff.
So where do we stand now? After a couple of days of reasearch/trial&error I feel everywhere I look I find half developed libraries, libraries with overhead, severe limitations or libraries that are overly complex.
I want to do "free-hand" 3D stuff. For instance displaying 200k dots on a screen in 3D and move them around at 30fps (Kinect depth image). I want to make 3D screensavers, audio analysis plugins, etc. All of which is not prefabs for a content pipeline, and which require high performance. And (ehm) I want to do it from .Net.
Anyone have experience with libraries that are easy/understandable and still gives some fair amount of freedom and speed?
I seem to have landed on OpenTK. I think it gives more or less direct access to the OpenGL API and doesn't require loads of dependencies.
It is comparatively easy to understand. It requires few (and understandable) lines of code to get started. It doesn't hold the objects for me so I'm free to change anything for each pass, which is great because I'm mainly working with unsafe pointers to memory.
It is of course difficult to combine speed with ease of use. Speed requires talking directly to the 3D API while ease of use requres abstraction. Therefore this must be considered a lower level API than some of the others I've tried. If I wanted to do some prefab character animation then XNA would probably be a better choice, but for my use (described above) this seems very promising so far (4-5 hours of hacking).
Some sample code:
private void Render()
{
// Every frame
GL.MatrixMode(MatrixMode.Modelview);
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
GL.LoadMatrix(ref cameraMatrix);
GL.Begin(BeginMode.Points);
// Here I can add lots of points. I add 200k without any big problem.
// It seems these points could have been passed in as an array pointer too,
// but I'll look at that later.
GL.Vertex3(x2, y2, z2);
GL.End();
glControl.SwapBuffers();
}
If you liked MDX, SlimDX should be right up your alley. It's basically a replacement for MDX, but with a lot of the questionable design decisions fixed up, and a lot more functionality included. Anything you had with MDX, you will find present in SlimDX in one form or another.
Alternatively there is another C# wrapper package for OpenGL: OpenGL DotNet. Works great for me! Check it out at http://www.taylaninan.com/opengl-dotnet.php .
It wraps OpenGL up to version 4.4 and supports over 550+ OpenGL Extensions. It also supports GLU, GLUT, FreeGLUT, DevIL (Developer's Image Library), ILU and ILUT for DevIL.
It a low level API for the above libraries.
We faced a similar issue some time ago and the following represents our opinion only of course. One of our main concerns was that the library should be versatile, produce 3D images of very good quality, free, and not put loads of extra constraints on the installer, i.e. like with XNA where you have to have the correct files installed. This seemed like a possible source of headache. In the end we settled for DirectX and wrote the GUI in C#. All needed interaction with the 3D was done with wndproc. This provided us with both the power of DirectX and the ease of GUI development with C#. We haven't regretted this at all.

Looking for fully managed WeifenLuo(DockPanel Suite) replacement or hints on implementing one [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I need a WeifenLuo replacement that'll run on both .NET and Mono, on Windows, Linux and Mac, preferrably licensed under the MIT license.
I'd appreciate if the API was similar to WeifenLuo's, but I understand that such may not be available.
Also, since I couldn't find anything on Google, I believe this might not exist.
In this case, I'd like some hints regarding how to implement this.
I have some(not much) Windows.Forms experience, and I must not use any P/Invoke. I already know out how to detect window motion and how to create a borderless translucent window on a given position and with a given size.
So here are some problems I am facing:
WeifenLuo supports multiple left/right/top/bottom panes, allowing them to be resized and contain more than one panel.
It also supports splittable tabs.
Is there anything else I should be aware of before starting? Are there similar open-source projects available?
It is possible to disable all PInvoke to Win32 API when running on Mono. The price you pay is to lose drag and drop support on Mono/Linux, which may be acceptable in some cases.
Edited: http://www.lextm.com/2012/05/a-call-to-the-community-dockpanel-suite-history-and-future-2/ A fork of DPS is now hosted on GitHub, http://github.com/dockpanelsuite/dockpanelsuite
I have been wanting the same thing. I have been testing a basic layout system for win forms and found that the mono Mac version of WinForms is not 100% complete like drag and drop has not been implemented and is slow.
From my own searching GTK# has the best support across all platforms. The other way is to split the UI for each platform i.e. WinFoms, GTK# (linux) and Cocoa (cocoa#/monobjc).
GTK# looks nice, but involving, and there is a learning curve. Myself, I tried QuickSharp, but couldn't find support anywhere, and the weifenluo docking system lacked a few features and was difficult to implement form sizes.
I ended up going with [dockDotNet][1] which allows for a minimumsize parameter, and is very easy to work with. You can set nearly all the floated form properties right there with the property manager - even setting the form icon!

Categories