ImageHandler 3.2.2

dotnet add package ImageHandler --version 3.2.2
NuGet\Install-Package ImageHandler -Version 3.2.2
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="ImageHandler" Version="3.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ImageHandler --version 3.2.2
#r "nuget: ImageHandler, 3.2.2"
#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 ImageHandler as a Cake Addin
#addin nuget:?package=ImageHandler&version=3.2.2

// Install ImageHandler as a Cake Tool
#tool nuget:?package=ImageHandler&version=3.2.2

ImageHandler

Support for loading, saving, capturing and displaying images in FitNesse/FitSharp tests.

These are used by FitNesse fixtures such as FitNesseFitSharpUiAutomation to create screenshots and render images.

Class Snapshot

This class is used to capture a screenshot of a window or control.

Constructors

public Snapshot(byte[] byteArray)

Create a snapshot from a byte array containing an image.

public Snapshot(string input)

Create a snapshot by first trying to base64 decode the input, and if that doesn't work interpreting the string as a path to an image file to be opened.

Properties

public byte[] ByteArray { get; private set; }

auto-property returning the byte array containing the image.

public string MimeType

The mime type of the image (e.g. image/png).

public string Rendering

The rendering of the image for use in a web page: <img src="data:image/png;base64,<base64 encoded byte array>" />

public string ToBase64

Base64 encoded image.

Methods

public static Snapshot CaptureScreen(Rectangle bounds)

Capture a screenshot of the rectangle.

public static Snapshot Parse(string input)

Function to enable usage of Snapshot in FitNesse tables.

public string Save(string path)

Save the image to the specified path.

public double SimilarityTo(Snapshot other)

Calculate the similarity of this image to another image. This is done by reducing the size of both images and then comparing the pixels. Returns a number between 0 and 1, where 0 means the images are completely different and 1 means they are identical up to a margin of 4 in color distance per pixel.

public override string ToString()

return the label of the Snapshot class (used in FitNesse tables).

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
3.2.2 144 9/17/2023
3.2.1 94 9/17/2023
3.2.0 92 9/17/2023
3.1.0 132 8/20/2023
3.0.1 4,158 8/28/2021
3.0.0 472 8/8/2021
2.0.1 2,369 2/15/2019

2.0.0 Initial commit
3.0.0 Migration to .NET 5.0 (dual targeting .NET 5.0 and .Net Framework 4.6.1)
3.0.1 Fixed use of single quotes in img src
3.1.0 Migrated to .NET 6.0
3.2.0 Added image comparison (method SimilarityTo)
3.2.1 Made ExtensionFunctions internal to avoid conflicts with other libraries
3.2.2 Removed forgotten debug statements