<commit_before># NGraphics

[![NuGet Package](https://img.shields.io/nuget/v/NGraphics.svg)](https://www.nuget.org/packages/NGraphics) [Build Status](https://github.com/praeclarum/NGraphics/actions)

<img src="TestResults/Icon-Mac.png" width="64" height="64" /> 

NGraphics is a cross platform library for rendering vector graphics on .NET. It provides a unified API for both immediate and retained mode graphics using high quality native renderers.

You can use it for cross platform rendering of UI widgets. Or as the basis for graphically rich interactive views. Or maybe you just want an easy way to import and export SVG and PNG files. Either way, I'm sure you'll find something interesting here.





## Installation

[Install NGraphics from nuget](https://www.nuget.org/packages/NGraphics/).



## Getting Started

The most important class is `ICanvas`. Uses canvases to render vector graphics (rectangles, ellipses, paths) to "something". Sometimes canvases are views on the screen, sometimes they are images -- you never really know.

We can draw a little house easily enough:

```csharp
var canvas = Platforms.Current.CreateImageCanvas (new Size (100), scale: 2);

var skyBrush = new LinearGradientBrush (Point.Zero, Point.OneY, Colors.Blue, Colors.White);
canvas.FillRectangle (new Rect (canvas.Size), skyBrush);
canvas.FillEllipse (10, 10, 30, 30, Colors.Yellow);<commit_msg>Update build badge<commit_after># NGraphics

[![NuGet Package](https://img.shields.io/nuget/v/NGraphics.svg)](https://www.nuget.org/packages/NGraphics) ![Build](https://github.com/praeclarum/NGraphics/workflows/Build/badge.svg?branch=master)

<img src="TestResults/Icon-Mac.png" width="64" height="64" /> 

NGraphics is a cross platform library for rendering vector graphics on .NET. It provides a unified API for both immediate and retained mode graphics using high quality native renderers.

You can use it for cross platform rendering of UI widgets. Or as the basis for graphically rich interactive views. Or maybe you just want an easy way to import and export SVG and PNG files. Either way, I'm sure you'll find something interesting here.





## Installation

[Install NGraphics from nuget](https://www.nuget.org/packages/NGraphics/).



## Getting Started

The most important class is `ICanvas`. Uses canvases to render vector graphics (rectangles, ellipses, paths) to "something". Sometimes canvases are views on the screen, sometimes they are images -- you never really know.

We can draw a little house easily enough:

```csharp
var canvas = Platforms.Current.CreateImageCanvas (new Size (100), scale: 2);

var skyBrush = new LinearGradientBrush (Point.Zero, Point.OneY, Colors.Blue, Colors.White);
canvas.FillRectangle (new Rect (canvas.Size), skyBrush);
canvas.FillEllipse (10, 10, 30, 30, Colors.Yellow);
{'fraction_non_alphanumeric': 0.10053475935828877, 'fraction_numerical': 0.01140819964349376, 'mean_word_length': 4.882599580712788, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '273256', 'n_tokens_mistral': 863, 'n_tokens_neox': 800, 'n_words': 318}