CrossGraphics aims to deliver a simple immediate mode interface for drawing graphics on a variety of platforms running .NET.
Currently the following platforms are supported:
- iOS and macOS using CoreGraphicsGraphics.cs
- Android using AndroidGraphics.cs
- Cross-platform SkiaSharp using SkiaSharpGraphics.cs
- Cross-platform SVG using SvgGraphics.cs
dotnet add package CrossGraphicsThe interface CrossGraphics.IGraphics is the recipient of all drawing commands.
You should now code your objects to be able to draw themselves by being passed and IGraphics object.
Drawing commands include:
- Rectangles using
FillRectandDrawRect - Rounded Rectangles using
FillRoundedRectandDrawRoundedRect - Ovals using
FillOvalandDrawOval - Lines using
DrawLineand the optionBeginLineandEndLineprimitives - Images using
DrawImage - Text using
DrawStringand the associated font functions
- Run Acceptance Tests
dotnet run --project atests/CrossGraphicsAcceptanceTests.csproj -- $(pwd)The code is copyright Frank A. Krueger and is released under the MIT license.