NetAF.Imaging
1.0.0
See the version list below for details.
dotnet add package NetAF.Imaging --version 1.0.0
NuGet\Install-Package NetAF.Imaging -Version 1.0.0
<PackageReference Include="NetAF.Imaging" Version="1.0.0" />
<PackageVersion Include="NetAF.Imaging" Version="1.0.0" />
<PackageReference Include="NetAF.Imaging" />
paket add NetAF.Imaging --version 1.0.0
#r "nuget: NetAF.Imaging, 1.0.0"
#:package NetAF.Imaging@1.0.0
#addin nuget:?package=NetAF.Imaging&version=1.0.0
#tool nuget:?package=NetAF.Imaging&version=1.0.0
NetAF.Imaging
NetAF.Imaging extension to add simple imaging capabilities to NetAF.
Overview
NetAF.Imaging extension to add simple imaging capabilities to NetAF.
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 SystemConsoleAdapter();
var frame = new GridVisualFrame(VisualHelper.FromImage(@"C:\TestImage.jpg", displaySize, CellAspectRatio.Console));
adapter.RenderFrame(frame);
This can be used in a game:
var frame = new GridVisualFrame(VisualHelper.FromImage(@"C:\TestImage.jpg", displaySize, CellAspectRatio.Console));
game.ChangeMode(new VisualMode(frame));
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 frame = new GridVisualFrame(VisualHelper.FromImage(@"C:\TestImage.jpg", game.Configuration.DisplaySize, CellAspectRatio.Console));
game.ChangeMode(new VisualMode(frame));
return new(ReactionResult.GameModeChanged, string.Empty);
})
]);
Applying Textures
A texturizer can be applied to add extra depth to the image:
var frame = new GridVisualFrame(VisualHelper.FromImage(@"C:\TestImage.jpg", displaySize, CellAspectRatio.Console, new BrightnessTexturizer()));
Documentation
Please visit https://benpollarduk.github.io/NetAF-docs/ to view the NetAF documentation.
For Open Questions
| 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- NetAF (>= 2.9.0)
- SixLabors.ImageSharp (>= 3.1.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added texturizer.