ImageHandler 4.0.0
dotnet add package ImageHandler --version 4.0.0
NuGet\Install-Package ImageHandler -Version 4.0.0
<PackageReference Include="ImageHandler" Version="4.0.0" />
<PackageVersion Include="ImageHandler" Version="4.0.0" />
<PackageReference Include="ImageHandler" />
paket add ImageHandler --version 4.0.0
#r "nuget: ImageHandler, 4.0.0"
#addin nuget:?package=ImageHandler&version=4.0.0
#tool nuget:?package=ImageHandler&version=4.0.0
ImageHandler ![workflow badge]()
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 8 in color distance per pixel.
public override string ToString()
return the label of the Snapshot class (used in FitNesse tables).
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
- System.Drawing.Common (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
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
4.0.0 Migrated to .NET 8.0 (single target), extracted the Size class, improved reduction factor calculation. Unit test coverage 100%.