Adirondack Software & Graphics


Introduction

The Apprehend screen capture component for Embarcadero ™ Delphi captures images of the desktop or full screen, a selected area of the screen, the active window, a selected object or window, a freehand (polygon) area of the screen, pre-selected icon sized (16x16, 32x32 or 48x48) area, and user specified area of the screen. Apprehend demos for TImage or ImageEN are provided. (See Demos).

Apprehend is a non-visual component that encapsulates the functionality of screen capture with functions to CaptureTheDesktop, SpeedCaptureDesktop, CaptureTheActiveWindow, CaptureSelectedObject, CaptureSelection, CaptureSmallIcon, CaptureIcon, CaptureLargeIcon CaptureSpecificSizeSelection, and CapturePolygon.

Apprehend optionally minimizes the main form before capturing an image and optionally copies the image to the clipboard. Hints and Capture information are available as ShowHint and ShowInfoDialog options respectively. Apprehend returns a bitmap of the captured image. Using the component to capture images is simple, requiring only one line of code.

BMP.Assign(ASGScreenCapture1.CaptureDesktop);

Methods

Create
Description
Create TASGScreenCapture

Destroy
Description
Destroy TASGScreenCapture

Functions

function CaptureDesktop: TBitmap;
Description
To capture an image of the desktop (full screen).
Note: Optionally prompts the user to position the cursor when the ShowCursor property is true. The ShowCursor property is fully functional with this method.

function SpeedCaptureDesktop: TBitmap;
Description
To quickly capture an image of the desktop (full screen) without flicker.
Note: The ShowCursor property is functional with this method, but the user is not prompted to position the cursor.

function
CaptureWholeDesktop: TBitmap;
Description
To capture all monitors simultaneously.

function CaptureActiveWindow: TBitmap;
Description
To copy an image of the active window.

function CaptureObject: TBitmap;
Description
To Copy an image of the selected object.

function CaptureSelection: TBitmap;
Description
To capture an image of selected area. Click the left mouse button and hold the left mouse button down and position the selection with the mouse by dragging a rectangle, then release the left mouse button to complete the capture.

function CapturePolygon: TBitmap;
Description
To capture an image of selected polygon area.

function CaptureLargeIcon: TBitmap;
Description
To capture an image of a 48x48 (icon size) area.

function CaptureIcon: TBitmap;
Description
To capture an image of a 32x32 (icon size) area. Position the selection with the mouse or keyboard arrowkeys, then press enter to complete the capture.

function CaptureSmallIcon: TBitmap;
Description
To capture an image of a 16x16 (icon size) area. Position the selection with the mouse or keyboard arrowkeys, then press enter to complete the capture.

function CaptureSpecificSizeSelection: ( CaptureWidth: integer; CaptureHeight: integer ): TBitmap;
Description
To capture a rectangular image of a user specified area. Position the selection with the mouse or keyboard arrowkeys, then press enter to complete the capture.


Helper Functions (not supported - developed by end user)

function CaptureObjectByHWND ( const Handles: Integer ): TBitmap;
Description
Capture specific window by Handle.

function CaptureObjectByTControlp ( const tcontrolp: TControl ): TBitmap;
Description
Capture Specific Object by TControl

Properties

property: Auto: Boolean
Description
To automatically copy the captured image to the clipboard when the auto property is true.

property: Delay: Boolean
Description
To change the time between minimizing the main form and the time that the snapshot takes place set the delay property.

property: Minimize: Boolean
Description
To automatically minimize the main form of the application before a capture and to automatically restore the main form, set the Minimize property to true.

property: MonitorNum: Integer
Description
This provided support for auto-detecting active window so that caller can know where in the bitmap image the active window was. Instead of relying on the cursor to determine the screen to capture from, you can now override by setting a MonitorNum=0,1,2,3,etc. property. Default of -1 causes it to use monitor where the mouse is located.

property: ObjectLeft: Integer
Description
X pos of active object (during desktop caoture)

property: ObjectRight Integer;
Description
Y pos of active object (during desktop capture)

property: ObjectTop Integer;
Description
Width pos of active object (during desktop capture)
property: ObjectBottom Integer;
Description
Height pos of active object (during desktop capture)

property
: ShowCursor: Boolean
Description
To include the screen cursor in a capture of the desktop. Note: This property is supported only by the CaptureDesktop function. All other capture functions do not support the ShowCursor property.

property: ShowHint: Boolean
Description
To display a hint showing the dimensions of the captured bitmap in the CaptureSelection and CapturePolyline methods. If ShowHint is true the hint is displayed. If ShowHint is false then the hint is not displayed.

property
ShowInfoDialog: Boolean;
Description
Displays a small window at the top right side of the screen to display user interaction information with apprehend.


property Version: string; ReadOnly;
Description
Apprehend version number.... currently 6.0

Procedure

procedure ResetCaptureCount;
Description
Reset the public variable CaptureCount to 0.

Events

event OnAfterCapture;
Description
Event executed after capture

event OnBeforeCapture;
Description
Event executed before capture

event OnCapture; Removed - Breaking Change

Example

procedure CaptureDesktopClick( Sender: TSender );
var
  BMP: TBitmap;
begin
  // Set the ScreenCapture properties
  // Minimise application before capture

  ASGScreenCapture1.Minimize := True;
  // Show the cursor in the capture
  ASGScreenCapture1.ShowCursor := False;
  // Show the capture hint
  ASGScreenCapture1.ShowHint := True;
  // Show capture directions
  ASGScreenCapture1.ShowInfoDialog := True;
  // Send the capture to the clipboard
  ASGScreenCapture1.Auto := True;
  // Delay the capture ms to allow screen refresh
   ASGScreenCapture1.Delay := 500;
  try
    // Capture desktop & assign to a bitmap
    BMP.Assign( ASGScreenCapture1.CaptureDesktop );
    // Assign bitmap to TImage
    Image1.Picture.Bitmap.Assign( BMP );
    // Refresh Image component to display the image
    Image1.Refresh;
  finally
    //Free the temporary bitmap
    BMP.Free;
  end;
end;

Installation

To use the component in Delphi XE or XE2 create a new package and add the pascal files to the package.  Compile then install the package.  Packages are provided for Delphi 5, 6, 7 and Delphi 2010.  After installation add the path to the source files to the IDE's Library path.

 

Demos

Requires Delphi VCL (Requires Only VCL Controls To Compile)
• PageControlTImage (Multipage TImage on TPageControl)
• RibbonImage (Multipage TImage on TPageControl with VCL TRibbon interface)
• Simple
• TImageToolbarImage (TImage on TPageContrprol)
Requires DevelopersExpress ExpressBars and ImageEN To Compile
• DevelopersExpressImageEN (Developers Express GUI with Developers Express Express Editors and ImageEN)
Requires VCL and ImageEN To Compile

• ImageENImageList (VCL Interface with ImageEN)
• RibbonImageENView  (Multipage TImageENView on TPageControl with VCL TRibbon interface)

Developers Express ExpressBars may be obtained here.
Developers Express Editors are shipped With Express Speller or other Developer Express products and may be obtained here.
ImageEN may be obtained here.

Go To Top