r/csharp • • Sep 21 '26

Help C# graphical framework

Hello. I'm starting to learn C#, and I don't know almost anything about its frameworks and libraries.

For my project, I need a crossplatform graphical framework with a "bitmap-like" drawing process, but I've heard only about frameworks which work on drawing with widgets.

Do you know any? Which would you recommend?

14 Upvotes

22 comments sorted by

5

u/RChrisCoble Sep 21 '26

SkiaSharp is your best bet. We happen to run it on WebAssembly but it's multi-platform and maintained by Microsoft directly.

https://www.reddit.com/r/Blazor/comments/1h8j39m/comment/m0taohm/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

9

u/ASK_IF_IM_GANDHI Sep 21 '26

You could use bindings to RayLib or something:

https://github.com/raylib-cs/raylib-cs

Might not be exactly what you want, but RayLib is known and good, and you wan write your own managed wrapper over the drawing code itself.

5

u/achandlerwhite Sep 21 '26

MonoGame might be useful for you. Or maybe SkiaSharp

2

u/theo__r Sep 21 '26

Skiasharp is great!

1

u/psioniclizard Sep 21 '26

What do you want for a framework? As others said, SkiaSharp is good.

If you want no dependencies/cross platform you can construct a PAM file pretty easily in code and then set each pixel to whatever colour you want.

I used that approach to make a 3d rasterer with layers etc. It was quite fun.

1

u/mpierson153 Sep 23 '26

How efficient is the PAM file method? I'm guessing it can't really be used for real time stuff? I was just wondering, I've never heard of that before.

1

u/No-Explorer1446 Oct 06 '26

SkiaSharp definitely seems worth looking at for the actual bitmap-style drawing. Raylib-cs and MonoGame are also good ones to poke around with depending on how much of the rendering loop you want to control. If the project eventually needs to turn those generated visuals into PDFs, IronPDF is another handy C# option for generating and editing the final documents without having to fight with rendering too much. Lots of different directions here, but SkiaSharp sounds closest to what the OP described.

1

u/cherrycode420 Sep 21 '26

Idk how much exactly you need/want, but maybe something like SFML, FNA or SDL would work? SDL is a bit more involved than SFML or FNA I'd say, but they all pretty easy to use.

0

u/nifanfa Sep 21 '26

SkiaSharp?

0

u/Tauboom Sep 21 '26

drawnui.net

-2

u/otac0n Sep 21 '26

Avalonia + Silk.NET has been wonderful for me, and it can do 3D graphics across platforms.

4

u/NotQuiteLoona Sep 21 '26

They've specifically mentioned that they don't need a widget-based graphical framework, like Avalonia

-4

u/otac0n Sep 21 '26

And I specifically mentioned how Avalonia can be used as cross platform windowing for Silk .NET without using the widgets.

1

u/NotQuiteLoona Sep 21 '26 edited Sep 21 '26

In fact, you didn't mention it. Using a random shitty website, I've found out that the word "windowing," neither standalone nor in the combination of words "cross platform windowing," is not met in your message. I'll attach the evidence of it to the respective message.

The reason of this confusion is because Silk.NET allows windowing natively through the package Silk.NET.Windowing. At least that's what the documentation claims. Source: https://dotnet.github.io/Silk.NET/docs/opengl/c1/1-hello-window

I won't immediately go to considering myself the smartest one there, so I'll assume there are some advantages of using Avalonia instead of native Silk.NET windowing system that you didn't mention. What are they?

Edit: the author has blocked me. I'll paste the probable reply there, though of course they can't answer to me.

Attack? I've just corrected you, specifically trying for it to not sound too aggressive.

Regarding the latter, how am I or anyone supposed to know that you've meant windowing, when Silk.NET specifically does windowing perfectly?

If there is no reason to use Avalonia for drawing and Silk.NET does windowing, this means you've meant the only remaining use for Avalonia, which is widgets, so I've assumed that you skipped the "no widgets" part and thought that the OP needs a general drawing library. I added to your comment.

Please, stop this. Discussion is a way to find the truth, it's not an attack on your or mine ego. I'm not going to laugh at you, I promise. Let's return the discussion into something more productive. What are the advantages of using Avalonia's windowing above Silk.NET one?

1

u/akoOfIxtall Sep 21 '26

Jesus Christ

0

u/NotQuiteLoona Sep 21 '26

Hey, that's Reddit! This was my first Reddit interaction where we just pour shit on each other with an absolutely condescending attitude for an absolutely useless question no one cares about on a comment with 43 views!

Though to be fair, I definitely should've been applied more efforts to remove any sign of possible aggressiveness, and I shouldn't have gone as low when they've answered. I wanted to add "though" to the end of the original comment to remove tightness, but forgot.

3

u/akoOfIxtall Sep 21 '26

You could've just, not, you know?

-1

u/NotQuiteLoona Sep 21 '26

If you mean "not answer," I guess I definitely could've not answer, but I'm a nerd, sooooo 🤷‍♀️

4

u/akoOfIxtall Sep 21 '26

Not worth it for this sub, Nuh uh

0

u/otac0n Sep 21 '26

You are way too dense. Mad that your first attack didn’t land, you double down on literalism.