Перейти к файлу
Jon Lipsky c12ebbef0e Added more methods needed by Xamarin.Forms 2021-01-08 23:37:45 -08:00
.github/workflows Updating nuget publish 2021-01-08 18:01:22 -08:00
build Updated oversight in nuspec file. 2021-01-08 14:36:28 -08:00
samples Minor code cleanup 2021-01-05 13:42:18 -08:00
src Added more methods needed by Xamarin.Forms 2021-01-08 23:37:45 -08:00
.editorconfig CoreGraphics is now a single project 2020-11-20 14:42:55 -09:00
.gitignore Initial commit of source code (#1) 2020-11-17 13:50:50 -08:00
LICENSE Initial commit 2020-10-27 13:14:16 -07:00
README.md Update README.md 2021-01-04 15:29:41 -08:00
System.Graphics.Mac.sln Removed Blazor projects from solution. 2021-01-04 16:10:04 -08:00
System.Graphics.sln Renamed Folder, added more platform views 2020-12-08 12:57:31 -09:00
System.Graphics.sln.DotSettings Initial commit of source code (#1) 2020-11-17 13:50:50 -08:00

README.md

System.Graphics

System.Graphics is a cross-platform graphics library for iOS, Android, Windows, macOS and Linux completely in C#. With this library you can use a common API to target multiple abstractions allowing you to share your drawing code between platforms, or mix and match graphics implentations within a singular application.

Motivation

Within the dotnet ecosystem there are multiple graphics libraries available depending on your target platforms; however, if you are doing cross-platform development there is not a unified graphics abstraction. Some legacy API's (System.Drawing, I'm looking at you) only have limited support/usefulness on non-Windows platforms. SkiaSharp runs almost everywhere these days, but for many use cases the native graphics abstractions are needed.

Goals

  • No dependencies on System.Drawing
  • Support all graphics operations within an abstraction that the underlying abstraction supports.

Status

This is an experimental library; however it's based on code that's been in use in production applications for over 10 years. Because it was refactored out of another code base, some things may have been broken in that process.

Disclaimer

There is no official support. Use at your own Risk.

Supported Platforms

Platform Supported Abstractions
Xamarin.iOS CoreGraphics & SkiaSharp
Xamarin.Android Android.Graphics & SkiaSharp
Xamarin.Mac CoreGraphics & SkiaSharp
WPF SharpDX, SkiaSharp, Xaml & GDI
UWP SharpDX, Win2D, Xaml, SkiaSharp
WinForms SharpDX, SkiaSharp & GDI
Linux SkiaSharp
Xamarin.Forms Dependent on native platform support (noted above)

Main Abstractions

  • Canvas - You can draw to a any of the supported abstractions with a common drawing canvas API and a support of common operations and primitives
    • Rectangle, Point and Color primitives
    • Shapes (Rectangles, Rounded Rectangles, Ellipses, Arcs)
    • Paths
    • Images
    • Fonts
    • Shadows
    • Image and pattern fills
    • Clipping
    • etc...
  • Fonts - You can access fonts with a common API
  • Attributed text - You can draw attributed text with a common API
  • Bitmaps - You can create and draw on bitmap images with a common API
  • PDF - You can create PDF's using a common API

Known Limitations

  • Attributed text is not currently supported with SkiaSharp
  • The included Blazor (Canvas) implementation no longer compiles, but is included as a reminder to get it working again