![]() |
GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
|
Provides comprehensive image capture, conversion, and matching capabilities for automation scenarios. Supports both desktop (headful) and browser (headless/headful) screenshot workflows with fluent chaining. More...
Public Member Functions | |
| IAllowGraphicSettings | CaptureScreen (object ApplicationOrBrowser=null) |
| Captures the current screen or visible browser tab. Works in both headful (desktop screenshot) and headless (browser screenshot) modes. Output is always a PNG-format image internally. | |
| IAllowGraphicSettings | ToBase64String (out string base64String) |
| Converts the last captured screenshot to a Base64 string (JPEG format). | |
| IAllowGraphicSettings | ToBitmap (out Bitmap bitmap) |
| Returns the last captured screenshot as a Bitmap. | |
| IAllowGraphicSettings | SaveTo (GPALFile file) |
| Saves the captured screenshot to a file (overwrites if exists). | |
| Rectangle | FindImage (string imagePath, object ApplicationOrBrowser=null) |
| Finds the location of a template image within the current screen/browser screenshot using OpenCV template matching. | |
| IImageHelper | ToGPALObject () |
| Returns this instance as IImageHelper for interface-based usage. | |
Static Public Member Functions | |
| static System.Drawing.Image | LoadImageFromFile (string filename) |
| Loads an image from the specified file path. | |
| static Image | Base64ToImage (string base64String) |
| Converts a Base64 string (with or without data URI prefix) to a System.Drawing.Image. | |
Properties | |
| Browser.Browser | Browser [get, set] |
| Gets or sets the associated Browser instance for headless capture operations. | |
| static Bitmap | ScreenShot [get, set] |
| Static reference to the most recent screenshot captured by this helper. | |
Provides comprehensive image capture, conversion, and matching capabilities for automation scenarios. Supports both desktop (headful) and browser (headless/headful) screenshot workflows with fluent chaining.
Definition at line 33 of file ImageHelper.cs.
|
static |
Converts a Base64 string (with or without data URI prefix) to a System.Drawing.Image.
| base64String | Base64-encoded image string. |
Definition at line 314 of file ImageHelper.cs.
| IAllowGraphicSettings GenerallyPositive.ImageHelper.CaptureScreen | ( | object | ApplicationOrBrowser = null | ) |
Captures the current screen or visible browser tab. Works in both headful (desktop screenshot) and headless (browser screenshot) modes. Output is always a PNG-format image internally.
| ApplicationOrBrowser | Optional. Pass a Browser.Browser instance for browser-specific capture logic. |
Implements GenerallyPositive.Browser.IAllowScreenshot.
Definition at line 76 of file ImageHelper.cs.
| Rectangle GenerallyPositive.ImageHelper.FindImage | ( | string | imagePath, |
| object | ApplicationOrBrowser = null ) |
Finds the location of a template image within the current screen/browser screenshot using OpenCV template matching.
| imagePath | Path to the template image to search for. |
Definition at line 347 of file ImageHelper.cs.
|
static |
Loads an image from the specified file path.
| filename | Path to the image file. |
Definition at line 299 of file ImageHelper.cs.
| IAllowGraphicSettings GenerallyPositive.ImageHelper.SaveTo | ( | GPALFile | file | ) |
Saves the captured screenshot to a file (overwrites if exists).
| file | GPALFile object specifying the target path. |
Implements GenerallyPositive.Browser.IAllowGraphicSettings.
Definition at line 245 of file ImageHelper.cs.
| IAllowGraphicSettings GenerallyPositive.ImageHelper.ToBase64String | ( | out string | base64String | ) |
Converts the last captured screenshot to a Base64 string (JPEG format).
| base64String | Output parameter containing the Base64-encoded image. |
Implements GenerallyPositive.Browser.IAllowGraphicSettings.
Definition at line 205 of file ImageHelper.cs.
| IAllowGraphicSettings GenerallyPositive.ImageHelper.ToBitmap | ( | out Bitmap | bitmap | ) |
Returns the last captured screenshot as a Bitmap.
| bitmap | Output parameter containing the Bitmap. |
Implements GenerallyPositive.Browser.IAllowGraphicSettings.
Definition at line 227 of file ImageHelper.cs.
| IImageHelper GenerallyPositive.ImageHelper.ToGPALObject | ( | ) |
Returns this instance as IImageHelper for interface-based usage.
Implements GenerallyPositive.Browser.IAllowToGPALObject< TResult >.
Definition at line 406 of file ImageHelper.cs.
|
getset |
Gets or sets the associated Browser instance for headless capture operations.
Definition at line 38 of file ImageHelper.cs.
|
staticgetset |
Static reference to the most recent screenshot captured by this helper.
Definition at line 43 of file ImageHelper.cs.