HTLLeonding.Utility.SimpleDrawing
1.0.0-preview9
Prefix Reserved
This is a prerelease version of HTLLeonding.Utility.SimpleDrawing.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package HTLLeonding.Utility.SimpleDrawing --version 1.0.0-preview9
NuGet\Install-Package HTLLeonding.Utility.SimpleDrawing -Version 1.0.0-preview9
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HTLLeonding.Utility.SimpleDrawing" Version="1.0.0-preview9" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HTLLeonding.Utility.SimpleDrawing --version 1.0.0-preview9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HTLLeonding.Utility.SimpleDrawing, 1.0.0-preview9"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install HTLLeonding.Utility.SimpleDrawing as a Cake Addin #addin nuget:?package=HTLLeonding.Utility.SimpleDrawing&version=1.0.0-preview9&prerelease // Install HTLLeonding.Utility.SimpleDrawing as a Cake Tool #tool nuget:?package=HTLLeonding.Utility.SimpleDrawing&version=1.0.0-preview9&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SimpleDrawing - Cross Platform
- Allows for the simple drawing of basic shapes on a canvas
- Renders the canvas in a window
- Works on multiple platforms (tested Windows, Linux, Mac)
- Based on SkiaSharp
- via Avalonia UI
- User click events are registered
This library is meant for simple applications so only basic functions are available to keep the API easy to use.
Sample Usage
using Avalonia.Media;
using SimpleXPlatDrawing;
SimpleDrawing.Init(400, 400);
SimpleDrawing.DrawLine(new(100, 100), new(300, 300));
SimpleDrawing.DrawLine(new(300, 100), new(100, 300), thickness: 4, color: Brushes.Green);
SimpleDrawing.DrawRectangle(new(50, 50), new(100, 80), lineColor: Brushes.Red);
SimpleDrawing.DrawRectangle(new(325, 325), new(375, 375), fillColor: Brushes.Azure);
SimpleDrawing.DrawEllipse(new(200, 300), 50, 75,
lineColor: Brushes.Firebrick, fillColor: Brushes.Firebrick);
SimpleDrawing.DrawCircle(new(350, 75), 40, lineThickness: 2.5D,
lineColor: Brushes.BlueViolet, fillColor: Brushes.Gold);
SimpleDrawing.DrawText(new(25, 350), "Hello World", 24, Brushes.Lime);
await SimpleDrawing.Render();
SimpleDrawing.DrawLine(new(200, 25), new(200, 375), 8);
await SimpleDrawing.Render();
await Task.Delay(TimeSpan.FromSeconds(2));
SimpleDrawing.Clear();
var x = 50;
for (var i = 0; i < 10; i++)
{
SimpleDrawing.DrawLine(new(x, 25), new(x, 375), 8);
x += 25;
await SimpleDrawing.Render();
await Task.Delay(TimeSpan.FromSeconds(1));
}
Console.Write("Press any key to exit...");
Console.ReadKey();
Click Events
An Action
can be passed to the Init
function to register a click handler which will receive the location the user clicked within the canvas.
SimpleDrawing.Init(600, 600, DrawCircleOnClick);
async void DrawCircleOnClick(Point clickLocation)
{
SimpleDrawing.DrawCircle(clickLocation, 25);
await SimpleDrawing.Render();
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Avalonia (>= 11.0.10)
- Avalonia.Desktop (>= 11.0.10)
- Avalonia.Fonts.Inter (>= 11.0.10)
- Avalonia.Themes.Fluent (>= 11.0.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on HTLLeonding.Utility.SimpleDrawing:
Package | Downloads |
---|---|
HTLLeonding.Utility.Turtle
Allows ordering a turtle around a beach to draw simple shapes |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.2.2 | 212 | 9/5/2024 |
3.2.1 | 160 | 8/22/2024 |
3.2.0 | 123 | 8/22/2024 |
3.1.2 | 127 | 8/22/2024 |
3.1.1 | 97 | 6/6/2024 |
3.1.0 | 111 | 5/21/2024 |
3.0.1 | 121 | 4/30/2024 |
3.0.0 | 117 | 4/30/2024 |
2.0.0 | 110 | 4/26/2024 |
1.0.0 | 118 | 4/26/2024 |
1.0.0-preview9 | 93 | 4/26/2024 |
1.0.0-preview8 | 102 | 4/26/2024 |
1.0.0-preview7 | 211 | 3/9/2023 |
1.0.0-preview6 | 121 | 3/9/2023 |
1.0.0-preview5 | 117 | 3/9/2023 |
1.0.0-preview4 | 135 | 3/9/2023 |
1.0.0-preview3 | 137 | 3/8/2023 |
1.0.0-preview2 | 130 | 3/8/2023 |
1.0.0-preview1 | 139 | 3/5/2023 |