C# WPF: Creating 2D Graphics
I have been tasked with writing a program similar to AutoCAD but in a more simplified version. The functionality includes creating a drawing based on geodetic points, as well as creating a building or floor plan, with the ability to have an interactive interface. I plan to develop this using C# WPF following the MVVM pattern. However, I am unsure where to start or what to use. Should I use InkCanvas? Should I use an OpenGL engine? The catch is that it must support .NET Framework 4.5. If you have had a similar experience or any thoughts on this, I would appreciate it if you could share them with me.
It would be a significant advantage if this implementation could be ported to Linux, for example, through Wine.
22 Replies
WPF doesn't run on linux, period. Winforms can run under Wine. Something like Skia might be of interest. But to be honest, you might be better off using something like Unity
One person in our team managed to port the main program to Linux using Wine, although it doesn't work as well as we would like.
Avalonia works on linux, windows, macos for desktop
uses Skia
you can Draw
its very close to WPF in terms of dev
https://github.com/AvaloniaUI/Avalonia/blob/a6e936d74accdcf7ead6b776f374defb501e4434/samples/RenderDemo/Pages/CustomSkiaPage.cs
well .net framework is windows only
so there goes your "linux"
why can't you use .net 8?
AvaloniaUI is a good option, thank you
it fits all your needs specially on running natively
Due to the fact that there are users on windows xp š
:OOF:
I know avalonia works on win7
but xp
that is way off already
well if this is for a company
Avalonia offers XPF
so you can develop everything in WPF
and XPF makes it crossplaform
Well, perhaps it will be possible to convince them that support for >Win10 is unnecessary.
I wish u gl, some companies dont like having the cost to upgrade even justifiable I know a bunch of big supermakerts that still use win xp and just wont upgrade.
There is some truth to this, even though we want to provide all users with a modern product, there are challenges like this one.
@canton7 @leowest
Thank you, for now, I will look into "Skia", and if there are any more options, I would appreciate it.
Except for Wine š
which is a windows emulation on linux
ĀÆ\_(ć)_/ĀÆ
I mean, you did say "so there goes your "linux"" afterwards
Wine is very much linux
its not the same thing as running natively
Indeed. But it does let you run Framework stuff on Linux, including winforms
OpenGL, if you can muster learning it, would be an excellent application for such a program. Terms such as
but in a more simplified version
tell me you're not interested in making a robust product more so a product that works in the first place. At what level do you expect to work on? If you are manipulating/generating geometry then OpenGL would be extremely handy as you can render your generated meshes in a scene. Its extremely low level. Deep and complex. Silk.NET supports linux, mac, and windows as well. There is a lot of setup, since its pretty bare bones, but it could pay off.
As far as support from others go the OpenGL community (graphics in general) is filled with boomers who are still on the toxic programmer 'helping' mentality instead of the just fucking help side.Absolutely, I am interested in a robust product. However, given AutoCAD itself, its capabilities, and functionality, my application would require only about 20-30% of its features, as there is no urgent need for more extensive functionality. The primary focus is on cadastral applications.
It's worth noting that the main tasks will involve geometry manipulation, constructing complex shapes with numerous geodetic points. Additionally, there is a need for the ability to translate "drawings" into required coordinate systems (which I am proficient at) and other related tasks.
Considering my interest in a high-quality product with good optimization, I turned to the community's experience for guidance.
Given that AutoCAD is HUGE, 20-30% of its features is still a mammoth task
Like, give me a team and a year or two, sort of scope
Agreed, AutoCAD is vast, perhaps I exaggerated with the percentages somewhere.
Yeah opengl is the move
I think it even warrants a separation of engine from business code as well
The engine should probably be written as its own library