GPAL.Image 1.0.2

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package GPAL.Image --version 1.0.2
                    
NuGet\Install-Package GPAL.Image -Version 1.0.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="GPAL.Image" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GPAL.Image" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="GPAL.Image" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GPAL.Image --version 1.0.2
                    
#r "nuget: GPAL.Image, 1.0.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.
#:package GPAL.Image@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GPAL.Image&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=GPAL.Image&version=1.0.2
                    
Install as a Cake Tool

GPAL.Image

Image matching for GPAL, the Generally Positive Automation Library.

A GPAL selector can name an element by how it looks: a picture of a button, an icon, a logo. GPAL finds that picture on the screen, or in the browser's own capture when the browser is headless or on a hidden desktop. The matching itself lives in this package, so GPAL carries none of OpenCV's weight unless a workflow needs it.

Use

Add the package, then register it once at startup, before the first image selector runs:

using GenerallyPositive;
using GenerallyPositive.Image;

GPALImage.Register();

Selector logo = GPAL.Selector
    .WithImage((GPALFile)@"C:\templates\logo.png")
    .ToGPALObject();

Without it, an image selector finds nothing and GPAL publishes a warning saying the package is needed.

QR codes

The same registration lets GPAL read QR codes, such as the one a site shows when two-factor sign-in is turned on, or a Google Authenticator export holding every exported account. The secret it holds then makes the 6-digit sign-in code:

ICredentials fidelity = GPAL.CredentialsFor(CredentialServiceType.None)
    .WithOtpQRCode((GPALFile)@"C:\secure\fidelity-qr.png")
    .ToGPALObject();
fidelity.GetOtpCode(out string code);

Requirements

  • .NET Framework 4.8 on Windows
  • A 64-bit process: OpenCV ships its native library for 64-bit Windows only. For an AnyCPU program, turn off Prefer 32-bit in the build settings, or target x64
  • GPAL at the same version, installed with this package

Documentation: https://gpal.sditx.com/docs/concepts

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  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.

- Reads the QR codes WithOtpQRCode takes, phone photos of a screen included