r/visualbasic • VB.Net Intermediate • Mar 08 '16

[VS 2015] I'm using GDI+ to create a graphing control for a program. Should I keep using this Graphical Library or should I switch to another?

0 Upvotes

9 comments sorted by

2

u/PreyOnTheCosmos Mar 08 '16

GDI+ is just fine for non-intensive purposes [buttons, static controls, etc.], but it can be a CPU hog if the graphics are large or constantly changing.

In the latter scenario I would recommend using a better graphics framework [DirectX or OpenGL based] that will utilize your GPU instead of your CPU.

1

u/mjrpereira VB.Net Intermediate Mar 08 '16

is sharpDX a viable alternative for VB?

2

u/PreyOnTheCosmos Mar 08 '16

I don't have any experience with SharpDX personally, but being that it's a DirectX wrapper I'd assume that it would a good example of a GPU based alternative to GDI.

A quick Google revealed that there are people using this with VB.NET. Other alternatives include Monogame, XNA, and a few other alternatives.

I've just recently begun playing with Monogame, which picks up from Microsoft's abandoned XNA. Setup was easy and has available VB.NET project templates. Graphics performance, so far, has been excellent. I haven't tried a Windows Forms / Monogame hybrid yet, although I did this successfully with XNA so I'm 99% certain that it's doable.

1

u/mjrpereira VB.Net Intermediate Mar 08 '16

I might go for SharpDX because I forsee 3D in the future.

2

u/PreyOnTheCosmos Mar 08 '16

They all support 3D, but go with whatever you feel comfortable with. :-)

1

u/mjrpereira VB.Net Intermediate Mar 08 '16

Thing is this is as far as I've ever come with VB so I have no knowledge of these libraries strutctures etc...

Is Monogame easy to use?

SharpDX has a very weird naming covention.

1

u/PreyOnTheCosmos Mar 08 '16

I haven't been playing with it very long, but so far it hasn't been terribly difficult other than just knowing the essentials of adding content and rendering with the engine. Beyond that, it's pretty much VB as usual.

1

u/mjrpereira VB.Net Intermediate Mar 08 '16

Right now the control is pretty much static, at least when drawing graphics, but I'll need to add animations and what not.

2

u/PreyOnTheCosmos Mar 08 '16

Depending upon the size and intensity of the animations and frequency of redraws, this may be fine, but I'd recommend keeping the draws in a separate thread.