NetAF.Imaging
10.0.0
See the version list below for details.
dotnet add package NetAF.Imaging --version 10.0.0
NuGet\Install-Package NetAF.Imaging -Version 10.0.0
<PackageReference Include="NetAF.Imaging" Version="10.0.0" />
<PackageVersion Include="NetAF.Imaging" Version="10.0.0" />
<PackageReference Include="NetAF.Imaging" />
paket add NetAF.Imaging --version 10.0.0
#r "nuget: NetAF.Imaging, 10.0.0"
#:package NetAF.Imaging@10.0.0
#addin nuget:?package=NetAF.Imaging&version=10.0.0
#tool nuget:?package=NetAF.Imaging&version=10.0.0
NetAF.Imaging
Extension to add simple imaging capabilities to NetAF.
Overview
NetAF.Imaging provides extensions to NetAF to add simple functions to convert images to visuals.
Getting Started
Clone the repo/pull NuGet
Clone the repo:
git clone https://github.com/benpollarduk/netaf.imaging.git
Or add the NuGet package:
dotnet add package NetAF.Imaging
Hello World
Generating visuals is made easy with the VisualHelper class. The following example generates a visual on the console:
var displaySize = new Size(80, 50);
var adapter = new ConsoleAdapter();
var frame = VisualHelper.CreateFrame(@"C:\TestImage.jpg", displaySize, CellAspectRatio.Console);
adapter.RenderFrame(frame);
This can be used in a game:
var visualBuilder = VisualHelper.FromImage(@"C:\TestImage.jpg", displaySize, CellAspectRatio.Console);
var visual = new Visual("Test image", "A test image", visualBuilder);
game.ChangeMode(new VisualMode(visual));
Here is a simple room that contains a command to look at the view.
return new Room("Hillside", "A wild hillside with a lone tree", commands:
[
new CustomCommand(new CommandHelp("Look at view", "Look at the current view."), true, true, (game, args) =>
{
var visualBuilder = VisualHelper.FromImage(@"C:\TestImage.jpg", displaySize, CellAspectRatio.Console);
var visual = new Visual("Test image", "A test image", visualBuilder);
game.ChangeMode(new VisualMode(visual));
return new(ReactionResult.GameModeChanged, string.Empty);
})
]);
Applying Textures
A texturizer can be applied to add extra depth to the image:
var frame = VisualHelper.CreateFrame(@"C:\TestImage.jpg", displaySize, CellAspectRatio.Console, new BrightnessTexturizer());
Documentation
Please visit https://benpollarduk.github.io/NetAF-docs/docs/visuals.html to view the NetAF.Imaging documentation.
For Open Questions
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- NetAF (>= 10.0.0)
- SkiaSharp (>= 3.119.2)
- SkiaSharp.NativeAssets.Linux (>= 3.119.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.1 | 52 | 11/18/2026 |
| 10.0.0 | 277 | 5/18/2026 |
| 1.1.6 | 284 | 2/14/2026 |
| 1.1.5 | 142 | 2/8/2026 |
| 1.1.4 | 224 | 1/5/2026 |
| 1.1.3 | 940 | 3/12/2025 |
| 1.1.2 | 351 | 3/7/2025 |
| 1.1.1 | 286 | 3/6/2025 |
| 1.1.0 | 253 | 2/28/2025 |
| 1.0.3 | 498 | 11/29/2024 |
| 1.0.2 | 175 | 11/29/2024 |
| 1.0.1 | 181 | 11/27/2024 |
| 1.0.0 | 170 | 11/27/2024 |
| 0.0.1 | 183 | 11/26/2024 |
Updated to .NET 10.