01.12.2012 Views

AVT Active FirePackage User Guide - Allied Vision Technologies

AVT Active FirePackage User Guide - Allied Vision Technologies

AVT Active FirePackage User Guide - Allied Vision Technologies

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH<br />

Taschenweg 2a<br />

D-07646 Stadtroda / Germany<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong><br />

<strong>User</strong> <strong>Guide</strong><br />

V3.0.0<br />

06/12/2010


No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form by any means,<br />

electronic, mechanical, by photocopying, recording , or otherwise, without the prior written permission of <strong>Allied</strong> <strong>Vision</strong><br />

<strong>Technologies</strong> GmbH and A&B Software LLC.<br />

Information furnished by this document is believed to be accurate and reliable; however, no responsibility is assumed by <strong>Allied</strong><br />

<strong>Vision</strong> <strong>Technologies</strong> GmbH and A&B Software LLC for its use; nor for any infringements of patents or other rights of third parties<br />

which may result from its use.<br />

Use, duplication, or disclosure by the United States Government is subject to restrictions as set forth in subparagraph (c)(1)(ii)<br />

of the Rights in Technical Data and Computer software clause at 48 C.F.R, 252.227-7013, or in subparagraph (c)(2) of the<br />

Commercial Computer Software - Registered Rights clause at 48 C.F.R, 52-227-19 as applicable.<br />

All brand and product names are trademarks or registered trademarks of their respective companies.<br />

<strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH 10/2007<br />

All rights reserved.<br />

Managing Director: Mr. Frank Grube<br />

Tax ID: DE 184383113<br />

Support:<br />

Taschenweg 2A<br />

D-07646 Stadtroda, Germany<br />

Tel.: +49 (0)36428 6770<br />

Fax: +49 (0)36428 677-28<br />

e-mail: info@alliedvisiontec.com<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

2


Contents<br />

Document ..................................................................................................... history<br />

8<br />

Introduction ..................................................................................................... 9<br />

License .................................................................................................................... Agreement<br />

11<br />

System .................................................................................................................... Requirements<br />

14<br />

Installation<br />

.................................................................................................................... 16<br />

Automatic .................................................................................................................... Driver Setup<br />

22<br />

Manual .................................................................................................................... Driver Setup<br />

25<br />

1394b .................................................................................................................... (FireWire 800)<br />

29<br />

Redistribution<br />

.................................................................................................................... 33<br />

Getting ..................................................................................................... started<br />

34<br />

Visual .................................................................................................................... Basic<br />

35<br />

Visual .................................................................................................................... C++<br />

38<br />

VB.NET .................................................................................................................... 43<br />

Visual .................................................................................................................... C#<br />

48<br />

Delphi .................................................................................................................... 52<br />

Using .................................................................................................................... <strong>AVT</strong><strong>Active</strong>Cam API at runtime<br />

53<br />

Working .................................................................................................................... with multiple cameras<br />

56<br />

<strong>Active</strong>X ..................................................................................................... Reference<br />

57<br />

Properties .................................................................................................................... 58<br />

Acquire .................................................................................................................... 62<br />

AntiTearing .................................................................................................................... 64<br />

Asynch .................................................................................................................... 66<br />

AutoExposure .................................................................................................................... 68<br />

AutoExposureRef .................................................................................................................... 70<br />

BackColor .................................................................................................................... 72<br />

Bayer .................................................................................................................... 73<br />

BayerLayout .................................................................................................................... 75<br />

BitShift .................................................................................................................... 77<br />

BkgCorrect .................................................................................................................... 79<br />

BkgName .................................................................................................................... 81<br />

Brightness .................................................................................................................... 82<br />

BrightnessControl<br />

.................................................................................................................... 84<br />

Camera .................................................................................................................... 86<br />

Display .................................................................................................................... 88<br />

Edge .................................................................................................................... 90<br />

Flip .................................................................................................................... 91<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

3


Font .................................................................................................................... 93<br />

Gain .................................................................................................................... 95<br />

GainControl .................................................................................................................... 97<br />

Gamma .................................................................................................................... 99<br />

GammaControl .................................................................................................................... 101<br />

Integrate .................................................................................................................... 103<br />

IntegrateWnd .................................................................................................................... 104<br />

Hue .................................................................................................................... 105<br />

HueControl .................................................................................................................... 107<br />

LUTMode .................................................................................................................... 109<br />

Magnification .................................................................................................................... 110<br />

Mode .................................................................................................................... 112<br />

MonitorSync .................................................................................................................... 114<br />

Overlay .................................................................................................................... 116<br />

OverlayColor .................................................................................................................... 117<br />

OverlayFont .................................................................................................................... 118<br />

PacketSize .................................................................................................................... 119<br />

Palette .................................................................................................................... 121<br />

Rate .................................................................................................................... 123<br />

Rotate .................................................................................................................... 125<br />

Saturation .................................................................................................................... 127<br />

SaturationControl<br />

.................................................................................................................... 129<br />

ScrollBars .................................................................................................................... 131<br />

ScrollX .................................................................................................................... 132<br />

ScrollY .................................................................................................................... 133<br />

Sharpness .................................................................................................................... 134<br />

SharpnessControl<br />

.................................................................................................................... 136<br />

Shutter .................................................................................................................... 138<br />

ShutterControl .................................................................................................................... 140<br />

SizeX .................................................................................................................... 142<br />

SizeY .................................................................................................................... 144<br />

StartX .................................................................................................................... 146<br />

StartY .................................................................................................................... 147<br />

SwapBytes .................................................................................................................... 148<br />

Timeout .................................................................................................................... 149<br />

Trigger .................................................................................................................... 150<br />

TriggerCounter .................................................................................................................... 151<br />

TriggerDelay .................................................................................................................... 152<br />

TriggerMode .................................................................................................................... 154<br />

TriggerPolarity .................................................................................................................... 156<br />

WhiteBalanceControl<br />

.................................................................................................................... 157<br />

WhiteBalanceUB .................................................................................................................... 159<br />

WhiteBalanceVR .................................................................................................................... 161<br />

.................................................................................................................... Methods<br />

163<br />

Draw .................................................................................................................... 171<br />

DrawEllipse .................................................................................................................... 172<br />

DrawLine .................................................................................................................... 174<br />

DrawPixel .................................................................................................................... 176<br />

DrawRectangle .................................................................................................................... 177<br />

DrawText .................................................................................................................... 179<br />

GetBitsPerChannel<br />

.................................................................................................................... 181<br />

GetBrightnessMax<br />

.................................................................................................................... 183<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

4


GetBrightnessMin<br />

.................................................................................................................... 184<br />

GetBytesPerPixel<br />

.................................................................................................................... 185<br />

GetCameraList .................................................................................................................... 186<br />

GetCodec .................................................................................................................... 188<br />

GetCodecList .................................................................................................................... 189<br />

GetComponentData<br />

.................................................................................................................... 190<br />

GetComponentLine<br />

.................................................................................................................... 192<br />

GetDIB .................................................................................................................... 194<br />

GetExposureMax .................................................................................................................... 196<br />

GetExposureMin .................................................................................................................... 197<br />

GetF7Info .................................................................................................................... 198<br />

GetFeature .................................................................................................................... 200<br />

GetFeatureCapability<br />

.................................................................................................................... 202<br />

GetFeatureControl<br />

.................................................................................................................... 204<br />

GetFeatureMin .................................................................................................................... 206<br />

GetFeatureMax .................................................................................................................... 208<br />

GetFPS .................................................................................................................... 210<br />

GetFPSAcquired .................................................................................................................... 211<br />

GetGainMax .................................................................................................................... 212<br />

GetGainMin .................................................................................................................... 213<br />

GetGammaMax .................................................................................................................... 214<br />

GetGammaMin .................................................................................................................... 215<br />

GetHeight .................................................................................................................... 216<br />

GetHistogram .................................................................................................................... 217<br />

GetHueMax .................................................................................................................... 219<br />

GetHueMin .................................................................................................................... 220<br />

GetImageData .................................................................................................................... 221<br />

GetImageLine .................................................................................................................... 223<br />

GetImagePointer<br />

.................................................................................................................... 225<br />

GetImageStat .................................................................................................................... 227<br />

GetImageWindow<br />

.................................................................................................................... 229<br />

GetIsoSpeed .................................................................................................................... 231<br />

GetLevels .................................................................................................................... 232<br />

GetLUT .................................................................................................................... 233<br />

GetMaxChannel .................................................................................................................... 234<br />

GetModeList .................................................................................................................... 235<br />

GetPicture .................................................................................................................... 237<br />

GetPixel .................................................................................................................... 238<br />

GetRateList .................................................................................................................... 240<br />

GetRawData .................................................................................................................... 242<br />

GetRGBPixel .................................................................................................................... 244<br />

GetROI .................................................................................................................... 246<br />

GetSaturationMax<br />

.................................................................................................................... 247<br />

GetSaturationMin<br />

.................................................................................................................... 248<br />

GetSharpnessMax<br />

.................................................................................................................... 249<br />

GetSharpnessMin<br />

.................................................................................................................... 250<br />

GetShutterMax .................................................................................................................... 251<br />

GetShutterMin .................................................................................................................... 252<br />

GetTimeStamp .................................................................................................................... 253<br />

GetTriggerDelayMax<br />

.................................................................................................................... 254<br />

GetTriggerDelayMin<br />

.................................................................................................................... 255<br />

GetTriggerInfo .................................................................................................................... 256<br />

GetTriggerList .................................................................................................................... 258<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

5


GetWhiteBalanceMax<br />

.................................................................................................................... 260<br />

GetWhiteBalanceMin<br />

.................................................................................................................... 261<br />

GetWidth .................................................................................................................... 262<br />

Grab .................................................................................................................... 263<br />

LoadChannel .................................................................................................................... 264<br />

LoadImage .................................................................................................................... 265<br />

LoadSequence .................................................................................................................... 266<br />

LoadSettings .................................................................................................................... 268<br />

OverlayClear .................................................................................................................... 269<br />

OverlayEllipse .................................................................................................................... 270<br />

OverlayLine .................................................................................................................... 271<br />

OverlayPixel .................................................................................................................... 272<br />

OverlayRectangle<br />

.................................................................................................................... 273<br />

OverlayText .................................................................................................................... 274<br />

ReadBlock .................................................................................................................... 275<br />

ReadRegister .................................................................................................................... 277<br />

ReadSIO .................................................................................................................... 279<br />

SaveBkg .................................................................................................................... 281<br />

SaveImage .................................................................................................................... 283<br />

SaveChannel .................................................................................................................... 285<br />

SaveSettings .................................................................................................................... 286<br />

SetCodec .................................................................................................................... 287<br />

SetFeature .................................................................................................................... 289<br />

SetFeatureControl<br />

.................................................................................................................... 291<br />

SetGains .................................................................................................................... 293<br />

SetImageWindow<br />

.................................................................................................................... 295<br />

SetIsoSpeed .................................................................................................................... 297<br />

SetLevels .................................................................................................................... 298<br />

SetLUT .................................................................................................................... 300<br />

SetROI .................................................................................................................... 302<br />

SetSIO .................................................................................................................... 304<br />

ShowCodecDlg .................................................................................................................... 306<br />

ShowCompressionDlg<br />

.................................................................................................................... 307<br />

ShowProperties .................................................................................................................... 308<br />

SoftTrigger .................................................................................................................... 310<br />

StartCapture .................................................................................................................... 312<br />

StopCapture .................................................................................................................... 314<br />

WriteBlock .................................................................................................................... 315<br />

WriteRegister .................................................................................................................... 317<br />

WriteSIO .................................................................................................................... 319<br />

.................................................................................................................... Events<br />

320<br />

CameraPlugged .................................................................................................................... 321<br />

CameraUnplugged<br />

.................................................................................................................... 323<br />

CaptureCompleted<br />

.................................................................................................................... 324<br />

FormatChanged .................................................................................................................... 325<br />

FrameAcquired .................................................................................................................... 326<br />

FrameAcquiredX .................................................................................................................... 327<br />

FrameDropped .................................................................................................................... 328<br />

FrameLoaded .................................................................................................................... 329<br />

FrameReady .................................................................................................................... 330<br />

FrameRecorded .................................................................................................................... 332<br />

MouseDblClick .................................................................................................................... 333<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

6


MouseDown .................................................................................................................... 335<br />

MouseMove .................................................................................................................... 337<br />

MouseUp .................................................................................................................... 339<br />

RawFrameAcquired<br />

.................................................................................................................... 341<br />

Scroll .................................................................................................................... 342<br />

Timeout .................................................................................................................... 344<br />

.................................................................................................................... Property Pages<br />

345<br />

Source .................................................................................................................... 346<br />

Format .................................................................................................................... 348<br />

Exposure .................................................................................................................... 350<br />

Color .................................................................................................................... 352<br />

Advanced .................................................................................................................... 354<br />

Display .................................................................................................................... 355<br />

TWAIN ..................................................................................................... 359<br />

Samples ..................................................................................................... 361<br />

.................................................................................................................... 363<br />

Samples and <strong>User</strong> Account Control<br />

Troubleshooting<br />

..................................................................................................... 364<br />

Index ................................................................................................................................367<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

7


Document history<br />

Document history<br />

Version Date Remarks<br />

V2.0.0 24.09.2007 New Manual<br />

V2.1.0 05.02.2008 First Official Release<br />

V2.1.2 10.03.2008 Added redistribution chapter<br />

V2.1.3 23.05.2008 Adapted 1394b chapter to XP SP3<br />

requirements<br />

V2.2.0 24.11.2008 Updated Automatic driver setup chapter,<br />

<strong>Active</strong>X methods chapter and DirectShow<br />

chapter<br />

V2.2.1 02.03.2009 Added description for GetCodec, fixed<br />

several typos<br />

V3.0.0 06.12.2010 Updated following chapters:<br />

Introduction,Getting started, <strong>Active</strong>X<br />

Reference, TWAIN, Troubleshooting<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

8


Introduction<br />

Introduction<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> is an SDK that provides among other components an <strong>Active</strong>X control<br />

designed for rapid application development tools, such as Visual Basic, VB.NET, Visual C++, C#, Java,<br />

Delphi etc. The additionally provided <strong>AVT</strong> <strong>Active</strong>CamViewer application allows customers to operate<br />

multiple cameras and save images in a number of formats. Also included is a TWAIN driver for<br />

interfacing to third-party imaging software. With <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> (later also called AFP), your<br />

application immediately supports <strong>AVT</strong>'s 1394a and 1394b digital cameras. Although the <strong>AVT</strong> <strong>Active</strong><br />

<strong>FirePackage</strong> is available for 64-bit systems, the <strong>AVT</strong><strong>Active</strong>Cam API itself is only a 32-bit API.<br />

In general, with <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> you can :<br />

· Acquire and display live video from one or several 1394 cameras.<br />

· Select among multiple camera sources.<br />

· Set a desired video format and triggering mode.<br />

· Select among several hardware and software trigger sources.<br />

· Grab 8- and 16-bit monochrome images, or 24- and 48-bit color images.<br />

· Perform automatic color interpolation of a monochrome video generated by Bayer cameras.<br />

· Choose among several available frame rates.<br />

· Select the desired size and position of the scan area.<br />

· Flip and rotate the live image.<br />

· Adjust multiple camera parameters in real time: brightness, gain, shutter speed, gamma,<br />

sharpness, hue, saturation.<br />

· Activate automatic or one-push control over selected camera parameters, such as exposure and<br />

white balance.<br />

· Save camera settings in memory channels or system registry and reload them on demand.<br />

· Control non-standard camera features by direct access to 1394 registers.<br />

· Choose among several palettes for pseudo-color display.<br />

· Choose between synchronous and asynchronous acquisition modes.<br />

· Get an instant access to pixel values and pixel arrays.<br />

· Retrieve individual color planes from RGB images.<br />

· Import live video to a PictureBox object.<br />

· Perform image processing on captured frames and display processed video in real-time.<br />

· Perform real-time histogram and statistical analysis over a selected color component.<br />

· Save images in BMP, TIF and JPEG formats with adjustable compression.<br />

· Perform time-lapse capture to an AVI file or series of sequentially-named images.<br />

· Overlay custom graphic and texts on the live video.<br />

· Flip and rotate the live video.<br />

· Synchronize video rendering with the monitor refresh rate to eliminate the tearing artifact.<br />

· Interface to third-party imaging applications using the included TWAIN driver.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

9


Introduction<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> uses multiple threads to support video acquisition, therefore it does not<br />

require separate components for thread management.<br />

This document gives a detailed description of <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>, its properties and methods; it<br />

also explains how to use the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> objects to perform the most common tasks.<br />

License agreement<br />

System requirements<br />

Installation<br />

Automatic driver setup<br />

Manual driver setup<br />

1394b (FireWire 800)<br />

Important note:<br />

Since version 3.0, DirectShow is no longer supported by the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>. This means, the<br />

corresponding files are no longer provided with the SDK. Please note that the filters provided in<br />

previous versions of this SDK can no longer be used with AFP v3.0 or later.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

10


Introduction<br />

2.1 License Agreement<br />

This legal document is an agreement between you, the Licensee, and <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong><br />

GmbH. By installing the Software Development Kit (SDK) <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> on your computer,<br />

you are agreeing to be bound by the terms of the below-mentioned END-USER LICENSE<br />

AGREEMENT FOR ACTIVE FIREPACKAGE SDK. If you do not agree to the terms of this agreement,<br />

promptly return the unopened package, together with all the other material which comprises the<br />

product, respectively delete all <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> related files.<br />

END-USER LICENSE AGREEMENT FOR <strong>AVT</strong> ACTIVE FIREPACKAGE SDK<br />

NOTICE TO USER: This is a contract. Before you click on the "Accept" button below and complete the<br />

installation process, carefully read this agreement. By clicking the "Accept" button, you consent to the<br />

terms of this agreement and you agree to be bound by this agreement. If you do not wish to become a<br />

party to this agreement and be bound by all of its terms and conditions, click the "Cancel" button and<br />

do not install or use the software and promptly return the software (including all accompanying written<br />

materials, along with their containers) to the place you obtained them.<br />

1.GRANT OF LICENSE. <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH is willing to provide you with a limited, nonexclusive<br />

right to use the software you are installing and related documentation (the "SOFTWARE").<br />

This Agreement permits you to install and use one copy of the SOFTWARE on a single computer. The<br />

SOFTWARE is in "use" on a computer when it is loaded into temporary memory (i.e., RAM) or installed<br />

into permanent memory (e.g., hard disk, CD-ROM, or other storage device. All rights not expressly<br />

granted to you in this Agreement are reserved to <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH.<br />

2.COPYRIGHT. The SOFTWARE is owned by A&B Software LLC or its suppliers and is protected by<br />

United States copyright laws and international treaty provisions. Therefore, you must treat the<br />

SOFTWARE like any other copyrighted material. You may, however, either (a) make one copy of the<br />

SOFTWARE solely for backup or archival purposes, or (b) transfer the SOFTWARE to a single hard<br />

disk, provided you keep the original solely for backup or archival purposes. You may not copy the<br />

written materials accompanying the SOFTWARE.<br />

3.OTHER RESTRICTIONS.<br />

(A) General. You may not reverse engineer, decompile, or disassemble the SOFTWARE. You may<br />

transfer the SOFTWARE to a third party provided that the receiving party accepts the terms and<br />

conditions of this Agreement and after such transfer you do not retain any copies of the SOFTWARE,<br />

including all upgrades that you may have received, nor retain any of the written materials<br />

accompanying the SOFTWARE. You may not lease nor rent the SOFTWARE. Further, for<br />

SOFTWARE acquired within the United States, you may not export the SOFTWARE outside of the<br />

United States without first complying with all applicable United States export laws and regulations.<br />

(B) Hardware. You acknowledge that the SOFTWARE will only operate with <strong>AVT</strong> 1394 cameras and<br />

will not function with other video devices.<br />

(C) Updates. If the SOFTWARE is an upgrade from another product, whether from <strong>Allied</strong> <strong>Vision</strong><br />

<strong>Technologies</strong> GmbH or another supplier, you may use or transfer the SOFTWARE only in conjunction<br />

with the upgraded product or you destroy the upgraded product. If the SOFTWARE is an upgrade from<br />

a <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH or another supplier's product, you may now use that upgraded<br />

product only in accordance with this license agreement.<br />

4.COMPONENT PARTS; SUPPLEMENTAL CODE. The SOFTWARE is licensed as a single product.<br />

Its component parts may not be separated for use. Should <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH (in its<br />

sole discretion) provide you with supplemental code and other materials relating to the SOFTWARE,<br />

such supplemental code or materials shall be considered as part of the SOFTWARE and subject to the<br />

terms of this Agreement.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

11


Introduction<br />

5.The SOFTWARE is provided "as is" without warranty of any kind, and no other warranties, either<br />

expressed or implied are made with respect to the SOFTWARE, including but not limited to any implied<br />

warranties of merchantability, fitness for a particular purpose, title or non-infringement, or any other<br />

warranties that may arise from usage of trade or course of dealing. <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH<br />

does not warrant, guarantee, or make any representations regarding the use of or the results of the<br />

use of the SOFTWARE in terms of correctness, accuracy, reliability, or otherwise and does not warrant<br />

that the operation of the SOFTWARE will be uninterrupted or error free. <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong><br />

GmbH expressly disclaims any warranties not stated herein.<br />

6.NO LIABILITY FOR CONSEQUENTIAL DAMAGES. The entire liability of <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong><br />

GmbH and A&B Software LLC, and their licensors, distributors, and suppliers (including its and their<br />

directors, officers, employees, and agents) is set forth above. To the maximum extent permitted by<br />

applicable law, in no event shall <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH and its licensors, distributors, and<br />

suppliers (including its and their directors, officers, employees, and agents) be liable for any damages,<br />

including, but not limited to, any special, direct, indirect, incidental, exemplary, or consequential<br />

damages, expenses, lost profits, lost savings, business interruption, lost business information, or any<br />

other damages arising out of the use or inability to use the SOFTWARE, even if <strong>Allied</strong> <strong>Vision</strong><br />

<strong>Technologies</strong> GmbH or its licensors, distributors, and suppliers has been advised of the possibility of<br />

such damages. You acknowledge that the license fee for the SOFTWARE reflects this allocation of<br />

risk.<br />

7.WARNING. (1) <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH products are not designed with components and<br />

testing for a level of reliability suitable for use in or in connection with surgical implants or as critical<br />

components in any life support systems whose failure to perform can reasonably be expected to cause<br />

significant injury to a human. (2) in any application, including the above, reliability of operation of the<br />

software products can be impaired by adverse factors, including but not limited to fluctuations in<br />

electrical power supply, computer hardware malfunctions, computer operating system software fitness,<br />

fitness of compilers and development software used to develop an application, installation errors,<br />

software and hardware compatibility problems, malfunctions or failures of electronic monitoring or<br />

control devices, transient failures of electronic systems (hardware and/or software), unanticipated uses<br />

or misuses, or errors on the part of the user or applications designer (adverse factors such as these<br />

are hereafter collectively termed "system failures"). Any application where a system failure would<br />

create a risk of harm to property or persons (including the risk of bodily injury and death) should not be<br />

reliant solely upon one form of electronic system due to the risk of system failure. To avoid damage,<br />

injury, or death, the user or application designer must take reasonably prudent steps to protect against<br />

system failures, including but not limited to back-up or shut down mechanisms. Because each enduser<br />

system is customized and differs from <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH testing platforms and<br />

because a user or application designer may use the SOFTWARE in combination with other products in<br />

a manner not evaluated or contemplated by <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH, the user or application<br />

designer is ultimately responsible for verifying and validating the suitability of the software whenever<br />

the SOFTWARE is incorporated in a system or application, including, without limitation, the appropriate<br />

design, process and safety level of such system or application.<br />

8.COMPLIANCE. If you are a business or other entity, you agree that upon the request of <strong>Allied</strong> <strong>Vision</strong><br />

<strong>Technologies</strong> GmbH or <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH its authorized representative, you will<br />

promptly document and certify in writing to <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH that your and your<br />

employees' use of the SOFTWARE complies with the terms and conditions of each applicable license.<br />

9.TRANSFERRAL. <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH, reserves the right to transfer this license<br />

agreement to another entity. In the event that this happens, the terms of the license will remain fully in<br />

effect and the agreement will be between you and the new owner.<br />

10. ENFORCEMENT. This agreement shall be fully enforced by <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH<br />

and/or A&B Software, LLC.<br />

11. GENERAL. This agreement is governed by the laws of the state of Connecticut, exclusive of any<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

12


Introduction<br />

provisions of the United Nations convention on the international sale of goods, and without regard to<br />

principles of conflicts of law, and constitutes the complete agreement between you and <strong>Allied</strong> <strong>Vision</strong><br />

<strong>Technologies</strong> GmbH. It supersedes any oral or written proposals, prior agreements, purchase orders<br />

or any other communication between you and <strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong> GmbH relating to the subject<br />

matter of this agreement. This agreement shall automatically terminate upon failure by you to comply<br />

with its terms, in which event you must destroy all copies of the SOFTWARE. If any action is brought<br />

by either party to this agreement against the other regarding the subject matter hereof, the prevailing<br />

party shall be entitled to recover, in addition to any relief granted, reasonable attorney fees and court<br />

costs. If any provision of this agreement is held invalid, the offending clause will be modified so as to<br />

be enforceable and, as modified, shall be fully enforced, and the remainder of this agreement will<br />

continue in full force and effect. Product and company names used herein are trademarks or trade<br />

names of their respective companies.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

13


Introduction<br />

2.2 System Requirements<br />

Hardware requirements:<br />

· Pentium II 400 MHz or better CPU recommended.<br />

· A graphics card supporting 65535 colors or higher.<br />

· One or more FireWire (1394) boards or a FireWire PCMCIA notebook card installed on the system.<br />

· One or more <strong>AVT</strong> 1394 cameras connected to the system.<br />

FireWire hot plug precautions<br />

Although FireWire devices can be hot-plugged without powering down equipment, we recommend<br />

turning the computer power off, before connecting a 1394 digital camera to the system via a FireWire<br />

cable.<br />

Software requirements:<br />

· supported operating systems:<br />

· 32-bit: Windows 7, Vista and XP<br />

· 64-bit: Windows 7<br />

·.NET FrameWork 2.0 (for .NET compatibility)<br />

<strong>User</strong> Account Control: Special advice when working with Windows Vista/Windows 7:<br />

This chapter gives you a short introduction to the so-called <strong>User</strong> Account Control that Microsoft<br />

introduced with Vista operating systems.<br />

· Basic information<br />

<strong>User</strong> Account Control (UAC) is a technology and security infrastructure for Windows Vista / Windows<br />

7 operating systems. It aims at improving the security of Windows Vista / Windows 7 by limiting<br />

application software to standard user privileges until an administrator authorizes an increase in<br />

privilege level. In this way, only applications that the user trusts receive higher privileges, and<br />

malware is kept from receiving the privileges necessary to compromise the operating system. So a<br />

user account may have administrator privileges assigned to it, but applications that the user runs do<br />

not have those privileges automatically unless the user explicitly authorizes them to have higher<br />

privileges.<br />

· Effects<br />

Windows Vista / Windows 7 <strong>User</strong> Account Control (UAC) prevents the compilation of example<br />

projects if those are opened directly from a location protected by UAC (i.e. C:\Program Files\...).<br />

Therefore, to compile the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> example projects under Windows Vista /<br />

Windows 7, copy the project to a user-writable location as described in chapter<br />

Samples and <strong>User</strong> Account Control.<br />

· UAC warning<br />

An example of an UAC warning when a program (e.g. <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> installation program)<br />

wants to write in a system folder is the following:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

14


Introduction<br />

Perform the following steps:<br />

1. In this case just click Allow because the shown program (<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>) is the<br />

installer of the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> and needs to write certain files to the system folder for<br />

general use.<br />

2. Go on working.<br />

Note that you may prevent this UAC warning by right-clicking the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> and select<br />

Run as administrator before you install the software.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

15


Introduction<br />

2.3 Installation<br />

To install <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>, perform the following steps:<br />

1. Save and exit out of all currently running applications.<br />

2. Shut down your system and turn computer power off.<br />

3. Connect your camera to the 1394 (FireWire) port.<br />

4. Turn computer power on.<br />

5. Download the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> zip file from the <strong>AVT</strong> web site. Unpack it and start the<br />

"exe" file. The Windows Installer box with a status bar will appear while setup prepares to<br />

start the installation process.<br />

6. After the setup program has verified your system has the appropriate installer files, you are<br />

ready to start installing <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>. The Welcome dialog box will appear. After<br />

reading the preliminary information, click Next.<br />

7. The Readme Information dialog box will appear presenting a short release overview.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

16


Introduction<br />

Click Next to proceed.<br />

8. The Choose Setup Type dialog box will appear. Select the setup type by clicking on its icon:<br />

You can choose between Typical, Custom and Complete.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

17


Introduction<br />

Setup type Description<br />

Typical In most cases this will be the setup type suitable for most users. Compared to<br />

the Complete type less features are installed: The Typical setup does not install<br />

Programming examples.<br />

Custom Note: This setup type is recommended for advanced users. If you click the<br />

Custom icon, the Select Features dialog box will appear:. Here you can choose<br />

which components will be installed.. Click on the icons to change current settings:<br />

Click Reset to go back to standard settings.<br />

Click Disk Usage to show available disk space on different volumes.<br />

Documentation:<br />

Choose to install the documentation for <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> or not.<br />

Documentation will be installed as CHM Online Help and as PDF.<br />

Programming examples:<br />

Choose to install programming examples or not. Here the source files for<br />

example applications are installed, which show how to use various features of the<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>.<br />

Complete Installs all program features and requires therefore most disk space.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

18


Introduction<br />

9. The Installation Options dialog box will appear. The default location of <strong>AVT</strong> <strong>Active</strong><br />

<strong>FirePackage</strong> files is C:\Program Files\<strong>Allied</strong> <strong>Vision</strong> <strong>Technologies</strong>\<strong>Active</strong><strong>FirePackage</strong>. If you<br />

want to change the location, click Browse, enter drive and path for the desired folder.<br />

Furthermore you can set a few general Installation Options:<br />

Check box / option Description<br />

Run the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> Driver Installer... Activate to call setup of <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong><br />

Driver Installer automatically during the<br />

installation.<br />

Create shortcuts ... on the desktop. When chosen: for <strong>AVT</strong> <strong>Active</strong>Cam Viewer and<br />

AFP Driver Installer, shortcuts for desktop are<br />

created.<br />

Install startmenu items and shortcuts for... Choose an option to install the items/shortcuts for<br />

• All users<br />

• Current user<br />

Click Next to proceed.<br />

10. When the Updating System dialog box appears, <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> SDK will be<br />

installed.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

19


Introduction<br />

11. Once the installation is finished, the following dialog box will appear:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

20


Introduction<br />

Furthermore you can set a few options :<br />

Check box / option Description<br />

Show Release Notes Activate if you want to read the release notes with<br />

the last informations.<br />

Launch <strong>AVT</strong> <strong>Active</strong>Cam Viewer Activate to start <strong>AVT</strong> <strong>Active</strong>Cam Viewer<br />

immediately after the installation is finished.<br />

Click Finish to exit the installer.<br />

Note that depending on your operation system you might need to reboot your system at this<br />

point. You will be prompted if a reboot is required; if a message appears, follow the on-screen<br />

instructions.<br />

12. If you have selected to run the AFP Driver Installer tool in the Installation Option dialog, follow<br />

the instructions of this program. If you didn't want to do it during installation, you may start it<br />

afterwards from the Start menu, or you may install the driver manually following the description<br />

in Manual driver setup.<br />

13. If you are installing <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> on Windows XP SP2 system, it is recommended<br />

to apply the following hotfix from Microsoft:<br />

http://support.microsoft.com/kb/885222<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

21


Introduction<br />

2.4 Automatic Driver Setup<br />

This package includes the AFP Driver Installer for an easy configuration of 1394 host controllers and<br />

<strong>AVT</strong> cameras.<br />

Host controller configuration is only applicable for 32-bit operating systems, while camera configuration<br />

is available for all operating systems.<br />

Note - If using 64-bit operating systems, please install Microsoft bus driver on 1394 host controllers<br />

before starting the AFP Driver Installer.<br />

Host Controller Configuration (applicable only for 32-bit operating systems)<br />

Host controller driver configuration could be needed for two reasons: compatibility and performance.<br />

Compatibility may be an issue, as there are commercially available bus drivers exposing proprietary<br />

driver interfaces, which are not supported by the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>. The <strong>AVT</strong> <strong>Active</strong>Cam driver<br />

is intended to be used with the standard microsoft bus driver. It may, however, work with third-party<br />

bus drivers exposing a compatible interface.<br />

Additionally, on Windows XP 32 systems with Service Pack 2 or greater, changes may be needed to<br />

obtain the full data rate of 1394b adaptors. On these Systems, data rates exceeding the limits of 1394a<br />

are not supported officially. To circumvent this limitation, a downgrade to Service Pack 1 drivers may<br />

be perfomed. This unofficial workaround modifies important Windows system files and is not endorsed<br />

by Microsoft. Before performing this downgrade, a full system backup is highly recommended. Please<br />

note that this downgrade is only supported for Windows XP systems.<br />

At startup, the AFP Driver Installer determines the configuration of existing 1394 host controllers.<br />

When improvements are possible, the host controller configuration dialog will be shown.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

22


Introduction<br />

Host controllers already bound to the Microsoft bus driver are displayed in green or blue color. Green<br />

entries represent perfectly configured adaptors, whose configuration cannot be changed by the user.<br />

Blue entries represent adaptors which would benefit from a driver downgrade to SP1. When such an<br />

adaptor is selected, the downgrade option is shown on the right. Please note, that host controller driver<br />

downgrade is always performed system-wide.<br />

Controllers bound to unknown drivers are displayed normally (black color). These devices can be<br />

selected for re-configuration by use of the checkboxes next to the device description. The microsoft<br />

bus driver will be installed for all selected devices when the Next-Button is clicked. Instead, the Skip-<br />

Button may be clicked to proceed without host controller configuration.<br />

<strong>AVT</strong> Camera Configuration (applicable for 32-bit and 64-bit Windows OS)<br />

The camera driver configuration dialog shows a list of all detected <strong>AVT</strong> cameras:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

23


Introduction<br />

The Refresh-button triggers a rebuild of the camera list and should be clicked when additional cameras<br />

have been connected. As default, all cameras are selected for driver installation. Listed cameras that<br />

are not intended to be used with the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> may be de-selected to keep their driver<br />

configuration untouched.<br />

The <strong>AVT</strong> <strong>Active</strong>Cam driver will be installed for all selected cameras when the OK-button is clicked.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

24


Introduction<br />

2.5 Manual Driver Setup<br />

In order for <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> to recognize 1394 digital cameras that are connected to your<br />

system, <strong>AVT</strong> <strong>Active</strong>Cam Driver must be installed for each camera. This chapter explains how to install<br />

the driver manually in your system under the Windows XP operating system. If your 1394 camera<br />

comes with its own IIDC-compatible system software, do not use it, as it will not be compatible with<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> . Please note that with the <strong>Active</strong> <strong>FirePackage</strong>, an automatic driver install tool<br />

is provided, the AFP Driver Installer.<br />

To install <strong>AVT</strong> <strong>Active</strong>Cam Driver manually, perform the following steps:<br />

1. Make sure <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> is installed on your system.<br />

2. Connect your camera to the 1394 (FireWire) port. If no driver was previously installed for the<br />

camera, the Found New Hardware dialog will appear as shown below.<br />

If the dialog does not show up, proceed to section 4 .<br />

2. Choose not to connect to Windows Update and click Next. On the next dialog select Install the<br />

software automatically. Ignore the warning message that the driver is not signed up with Microsoft<br />

and click Continue Anyway.<br />

3. Click Finish to complete the installation of the <strong>AVT</strong> <strong>Active</strong>Cam Driver for the selected camera.<br />

Verify that your camera is now listed in the device manager as <strong>AVT</strong> <strong>Active</strong>Cam device:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

25


Introduction<br />

4. If the New Hardware Found dialog didn't appear after you connected your camera, right click on My<br />

Computer and click Properties. Select the Hardware tab and click Device Manager . If there is no<br />

compatible driver installed, your camera will appear in the device list as a Generic 1394 Camera with a<br />

question or exclamation mark next to it:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

26


Introduction<br />

In order for the camera to work properly with <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> software, its driver must be<br />

changed to <strong>AVT</strong> <strong>Active</strong>Cam Driver.<br />

5. Right click on your device and select Properties . Choose the Driver tab and then click Update<br />

Driver .<br />

6. Select Install from a list or specific location (Windows XP) and click Next . Then select Don't<br />

search, I will choose the driver to install and click Next . On the next dialog, click Have disk :<br />

7. Provide the path to <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> Driver folder where 1394dcam_avt.inf is located<br />

(typically C:\Program Files\<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>\Driver).Click OK :<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

27


Introduction<br />

7. Choose the entry that matches your specific camera model, if available. Otherwise, choose the<br />

generic entry <strong>AVT</strong> 1394 Digital Camera. Click Next to continue. Ignore the warning message that the<br />

driver is not signed up with Microsoft:<br />

8. Click Finish to complete the installation of <strong>AVT</strong> <strong>Active</strong>Cam Driver for the selected camera. Verify<br />

that your camera is now listed in the device manager as <strong>AVT</strong> <strong>Active</strong>Cam device.<br />

The driver installation is now complete. You might need to restart the system for the changes to come<br />

into effect.<br />

Note - the described procedure must be repeated for each <strong>AVT</strong> camera that you intend to use with<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>, regardless of the model.<br />

Note - <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> works only with <strong>AVT</strong> 1394 digital cameras.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

28


Introduction<br />

2.6 1394b (FireWire 800)<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> supports 1394b cameras that can operate at 800 Mbps. In order to run 1394b<br />

cameras like Pike and Stingray at full capacity, you should use a 1394b (FireWire 800) PCI, PCIe or<br />

PCMCIA card and 9-pin to 9-pin 1394b cable.<br />

However, a driver capable of dealing with this higher speed is necessary on the PC side. The<br />

availability of such a driver depends on the operating system you have:<br />

-On 32-bit Windows XP, it depends on the service pack<br />

-On 32-bit Windows Vista, only a driver capable of S400 speed is available<br />

-On Windows 7 (32-bit and 64-bit), S800 speed can be used without problems<br />

For details see below.<br />

Windows XP 32<br />

Microsoft Windows XP SP1 supports 800 Mbps through the built-in OHCI IEEE-1394 driver. However,<br />

with the release of Windows XP SP2, Microsoft introduced a bug that limited the speed of 1394b<br />

devices to 100 Mbps. Microsoft later released a Hotfix 885222 that provided a partial solution to the<br />

problem:<br />

Performance of 1394 devices may decrease after you install Windows XP Service Pack 2<br />

Applying the Hotfix increases the speed of 1394 bus to 400 Mbps, but it still fails to provide 800 Mbps<br />

required for 1394b cameras. As a workaround to this issue, you need to "rollback" to the 1394 OHCI<br />

drivers that come with Windows XP SP1.<br />

With Windows XP SP3, Hotfix 885222 is not applicable any more, so you have to "rollback" to the SP1<br />

driver to be able to achieve more than 100 Mbps with 1394b cameras.<br />

To perform a rollback, do the following steps:<br />

1. (SP2:)Make sure Microsoft Hotfix KB885222 is not installed. Go to Control Panel, Add or<br />

Remove Programs, select Show Updates, and remove this update if installed.<br />

2a. (SP2:)Rename sp2.cab (found in the C:\Windows\Driver Cash\i386 folder) to something like<br />

sp2_old.cab, so Windows will not find it.<br />

2b. (SP3:)Rename sp2.cab and sp3.cab (found in the C:\Windows\Driver Cash\i386 folder) to<br />

something like sp2_old.cab and sp3_old.cab, so Windows will not find them.<br />

3. Unplug your 1394 camera(s). Right click on My Computer and click Properties. Select the<br />

Hardware tab and click Device Manager. Under IEEE 1394 Bus host controllers locate your<br />

1394b card driver. It will typically be listed as OHCI Compliant IEEE 1394 Host Controller or Texas<br />

Instrument OHCI Compliant IEEE 1394 Host Controller:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

29


Introduction<br />

4. Right click on the device and select Properties . Choose the Driver tab and then click Update<br />

Driver.<br />

5. Select Install from a list or specific location and click Next . Then select Don't search, I will<br />

choose the driver to install and click Next . On the next dialog, click Have disk.<br />

6. Provide the path to <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> Driver folder where 1394.inf is located (typically<br />

C:\Program Files\<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>\Driver).Click OK :<br />

7. From the list of the drivers select OHCI Compliant IEEE 1394 Host Controller and click Next . Ignore<br />

the digital signing warnings and messages about installing the older version of the driver.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

30


Introduction<br />

8. Click Finish to complete the installation. To make sure the "rollback" procedure worked, go to<br />

Device Manager, right click on OHCI Compliant IEEE 1394 Host Controller, select Properties .<br />

Choose the Driver tab and then click Driver Details. Confirm that 1394bus.sys and ohci1394.sys files<br />

have file version 5.1.2600.1106:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

31


Introduction<br />

9. Rename sp2_old.cab back to sp2.cab (and sp3_old.cab to sp3.cab for SP3). Plug in your camera(s).<br />

If they do not appear as <strong>AVT</strong> <strong>Active</strong>Cam devices under Imaging Devices, repeat camera driver<br />

installation according to Driver Setup section. You might need to restart the system for the changes to<br />

come into effect.<br />

Windows Vista<br />

Windows Vista only supports S400 for all FireWire devices.<br />

Windows 7 (32-bit and 64-bit)<br />

Windows 7 supports S800 speed natively.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

32


Introduction<br />

2.7 Redistribution<br />

Introduction<br />

Distribution of <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>-based software also requires the redistribution of <strong>AVT</strong> <strong>Active</strong><br />

<strong>FirePackage</strong> components. The actual set of necessary components depends on the utilized interface<br />

(<strong>Active</strong>X or TWAIN).<br />

This section describes the redistribution of components on a file basis. When this approach is chosen,<br />

it lies in the responsibility of the packager that all required components are installed on the target<br />

system. Alternatively, the whole installer package provided by <strong>AVT</strong> may be integrated in third-party<br />

installers.<br />

Mandatory requirements<br />

If you create an application using <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> SDK, your distribution package should at<br />

least include the file Avt<strong>Active</strong>Cam.dll. This DLL must be registered on the end-user's system before<br />

the application can be used. Therefore, you may want your setup program to register <strong>AVT</strong> <strong>Active</strong><br />

<strong>FirePackage</strong> when the application is installed. You can do it by passing the complete path to<br />

Avt<strong>Active</strong>Cam.dll as an argument to regsvr32.exe, or you can write your own setup program to register<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> directly instead. You should also include <strong>AVT</strong> <strong>Active</strong>Cam Driver in your<br />

distribution package and make sure the user installs it before starting using your application.<br />

In addition, you must ensure that the following files exit on the end-user's system:<br />

mfc42.dll, v.6.0 MFCDLL shared library<br />

atl.dll <strong>Active</strong> template library<br />

msvcrt.dll, msvcrt40.dll C run-time libraries<br />

oleaut32.dll OLE property frame<br />

regsvr32.exe control registration utility<br />

These files are part of the Windows operating system and they are typically located in the Windows<br />

system directory. Please refer to Microsoft's redistribution policy if you need to redistribute them.<br />

Twain requirements<br />

TWAIN support for cameras requires the Twain driver to be installed in the target system. This driver<br />

should always be placed into the subdirectory "twain_32" of the Windows directory<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

33


Getting started<br />

Getting started<br />

This chapter describes how to create a simple application with <strong>AVT</strong> <strong>Active</strong>Cam control using various<br />

development platforms.<br />

Visual Basic<br />

Visual C++<br />

VB.NET<br />

Visual C#<br />

Delphi<br />

Using <strong>AVT</strong><strong>Active</strong>Cam API at runtime<br />

Working with multiple cameras<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

34


Getting started<br />

3.1 Visual Basic<br />

This chapter shows you how to get started with <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> control in VB 6.0. With just a<br />

few mouse clicks and one line of code, you will be able to display a live video image in your Visual<br />

Basic program and report a value of a selected pixel in real time.<br />

Creating the Project<br />

Assuming that you have already run the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> installation program and started<br />

Visual Basic, the next step is to create a project. Begin by selecting the New Project command from<br />

the file menu, and select Standard EXE as your project type. Then use the Project / Components...<br />

command and select <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> Control from the list. You will see <strong>AVT</strong> <strong>Active</strong><br />

<strong>FirePackage</strong> icon appear at the bottom of the toolbox:<br />

Creating the Control<br />

Click the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> icon in the Toolbox and draw a rectangular area on the form. A<br />

rectangle with the text "<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> Control" will apear on the form, and the Project<br />

window on the right will display <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong>'s properties.<br />

Selecting the Camera<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

35


Getting started<br />

In the properties window, click the Camera property. The list box will display all <strong>AVT</strong> 1394 cameras<br />

conntected to your system. Select the one you intend to use:<br />

Selecting the Video Mode<br />

In the properties window, click the Mode property. The list box will display all the video modes<br />

provided by the selected camera. Choose the one you intend to use:<br />

Activating continuous acquisition<br />

In the properties window, click the Acquire property and set it to "On". The live video will appear on<br />

the form in the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> control's window.<br />

Adding a label<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

36


Getting started<br />

Click the label icon on the toolbox and draw a small rectangular area on the form outside of the <strong>AVT</strong><br />

<strong>Active</strong> <strong>FirePackage</strong> window. A label Label 1 will appear on the form.<br />

Adding the FrameAcquired event<br />

Double-click in the control window. The code window will appear with the empty FrameAcquired<br />

subroutine in it. It is now time to enter the single line of code mentioned earlier:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

'the following line needs to be added to the code<br />

Label1.Caption = <strong>AVT</strong><strong>Active</strong>Cam1.GetPixel (64, 32)<br />

End Sub<br />

Running the application<br />

You are now ready to hit F5 and watch your program display a live video and report a real-time pixel<br />

value in the coordinates x = 64, y = 32.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

37


Getting started<br />

3.2 Visual C++<br />

This chapter shows you how to get started with <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> control in Visual C++. With<br />

just a few mouse clicks and a few lines of code, you will be able to display a live video image in your<br />

C++ program and report a value of a pixel pointed by a mouse cursor in real time.<br />

Creating the Project<br />

VC++ 6.0<br />

In the development environment select the New command from the file menu, and then select<br />

Projects/MFC AppWizard.exe . In the Project name field on the right type the name of your application,<br />

for instance My<strong>AVT</strong><strong>Active</strong>Cam and click OK . When MFC AppWizard appears, select Dialog based<br />

radio button and click Finish . The project will be created, and the program dialog My<strong>AVT</strong><strong>Active</strong>Cam<br />

will be displayed for editing.<br />

VC++ 7.1/8.0/9.0/10.0 (.NET)<br />

In the .NET development environment select New -> Project. The New Project Dialog box will<br />

appear. Select Visual C++ projects on the left and MFC Application on the right. In the Name filed<br />

below type the name of your application, for instance My<strong>AVT</strong><strong>Active</strong>Cam and click OK . When MFC<br />

Application Wizard appears, click Application Type , select Dialog based radio button and click Finish<br />

. The project will be created, and the program dialog My<strong>AVT</strong><strong>Active</strong>Cam will be displayed for editing.<br />

Creating the Control<br />

Right click in the dialog and select Insert <strong>Active</strong>X control from a shortcut menu. From the list of<br />

controls select <strong>AVT</strong><strong>Active</strong>Cam class and press OK .<br />

A white rectangle with the text "<strong>AVT</strong><strong>Active</strong>Cam Control" will appear on the dialog.<br />

Generating the class for the Control<br />

VC++ 6.0<br />

Right click in the dialog and select Class Wizard from the shortcut menu. When MFC Class Wizard<br />

appears, click the Member Variables tab. In the Control ID window click IDC_<strong>AVT</strong>ACTIVECAM1 and<br />

then click Add Variable. Confirm generating the new C<strong>AVT</strong><strong>Active</strong>Cam class. When the Add Member<br />

Variable dialog appears, enter the name for the <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> object, for instance<br />

m_<strong>AVT</strong><strong>Active</strong>Cam . Click OK to close the Wizard.<br />

VC++ 7.1/8.0/9.0/10.0 (.NET)<br />

Right click on the <strong>AVT</strong><strong>Active</strong>Cam control in the program dialog and select Add Variable from the<br />

shortcut menu. Add Member Variable Wizard will appear. In the Variable name field enter the name<br />

for the <strong>AVT</strong><strong>Active</strong>Cam object, for instance m_<strong>AVT</strong><strong>Active</strong>Cam , and click finish. The Wizard will<br />

generate a wrapper class for <strong>AVT</strong><strong>Active</strong>Cam control and add a corresponding member variable to the<br />

main dialog class.<br />

Selecting the Camera<br />

Right click on the <strong>AVT</strong><strong>Active</strong>Cam control in the program dialog and select Properties from the<br />

shortcut menu. (In .NET select Property pages from the View menu). This will display the<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

38


Getting started<br />

<strong>AVT</strong><strong>Active</strong>Cam Class Properties tab dialog. Click the Source tab. The Camera list box will contain<br />

the names of the <strong>AVT</strong> cameras connected to your system. Select the one you intend to use.<br />

Selecting the Video Mode and Frame Rate<br />

Switch to the Format tab. Click the arrow next to the Mode box. The list box will display all the video<br />

modes available for the chosen camera. Select the one you intend to use. Then select the desired<br />

frame rate from the Rate list box.<br />

Adjusting the Exposure settings<br />

Switch to the Exposure tab. Using the slider controls adjust the Shutter, Gain and Iris settings. Note<br />

that the availability of the controls depends on the selected camera.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

39


Getting started<br />

Modifying the Control's appearance<br />

Switch to the Source tab. Select 3D look and Scroll bars check boxes:<br />

Adding the Start button<br />

In the Controls toolbox click on the Button icon and then draw a rectangular area on the program<br />

dialog. A button "Button1" will appear. Right click on the button and select Properties from the shortcut<br />

menu. In the Caption field type "Start" and double click on the button. The Add Member Function<br />

dialog box will appear. After clicking OK the source code window will be displayed with the new<br />

member function OnButton1 added. Insert one line to the function body:<br />

VC++ 6.0<br />

void CMy<strong>AVT</strong><strong>Active</strong>CamDlg::OnButton1()<br />

{<br />

// TODO: Add your control notification handler code here<br />

m_<strong>AVT</strong><strong>Active</strong>Cam.SetAcquire(TRUE);<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

40


Getting started<br />

}<br />

VC++ 7.0 (and following versions)<br />

void CMy<strong>AVT</strong><strong>Active</strong>CamDlg::OnBnClickedButton1()<br />

{<br />

// TODO: Add your control notification handler code here<br />

m_<strong>AVT</strong><strong>Active</strong>Cam.put_Acquire(TRUE);<br />

}<br />

This will activate continuous acquisition when the button is clicked.<br />

Adding text boxes<br />

In the Controls toolbox click on the Edit Box icon and then draw a small rectangular area on the<br />

program dialog. Repeat this two more times. Your final design of the program dialog will be similar to<br />

this:<br />

Adding the MouseMove event<br />

Right click on the <strong>AVT</strong><strong>Active</strong>Cam control in the program dialog and select Events. . from the shortcut<br />

menu. Highlight the MouseMove event and click Add and Edit. The new event handler<br />

OnMouseMove<strong>AVT</strong><strong>Active</strong>Cam1 will be added to the source code. Add the following lines to the body<br />

of the function:<br />

void CMy<strong>AVT</strong><strong>Active</strong>CamDlg::OnMouseMove<strong>AVT</strong><strong>Active</strong>Cam1(short x, short y)<br />

{<br />

// TODO: Add your control notification handler code here<br />

SetDlgItemInt(IDC_EDIT1,x);<br />

SetDlgItemInt(IDC_EDIT2,y);<br />

SetDlgItemInt(IDC_EDIT3,m_<strong>AVT</strong><strong>Active</strong>Cam.GetPixel(x,y));<br />

}<br />

Running the application<br />

From the Build menu of the development environment select Execute My<strong>AVT</strong><strong>Active</strong>Cam.exe. This<br />

will build and run the application. The application dialog will appear on the screen with a black image<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

41


Getting started<br />

window and empty text boxes. Click the Start button to activate the continuous video acquisition and<br />

move the mouse cursor over the image window. You are now able to watch and scroll the live image<br />

and analyze pixel coordinates and values - all in real time!<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

42


Getting started<br />

3.3 VB.NET<br />

This chapter shows you how to get started with <strong>AVT</strong><strong>Active</strong>Cam control in VB.NET. With just a few<br />

mouse clicks and a few lines of code, you will be able to display a live video image in your VB.NET<br />

program, access the array of pixel values and display them in a table in real time.<br />

Creating the Project<br />

In the .NET development environment select New -> Project. The New Project Dialog box will<br />

appear. Select Visual Basic projects on the left and Windows Application on the right. In the Name<br />

filed below type the name of your application, for instance My<strong>AVT</strong><strong>Active</strong>Cam and click OK . The<br />

project will be created, and the main application form will be displayed for editing.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

43


Getting started<br />

Creating the Control<br />

In the Toolbox select Components. From the Tools menu select Choose Items... -> COM<br />

Components and then select <strong>AVT</strong><strong>Active</strong>Cam Class from the list. You will see <strong>AVT</strong><strong>Active</strong>Cam icon<br />

appear at the bottom of the toolbox.<br />

Click the <strong>AVT</strong><strong>Active</strong>Cam icon in the Toolbox and draw a rectangular area on the form. A rectangle<br />

with the text "<strong>AVT</strong><strong>Active</strong>Cam Control" will appear on the form, and the Properties window on the right<br />

will display <strong>AVT</strong><strong>Active</strong>Cam's properties.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

44


Getting started<br />

Selecting the Camera<br />

In the properties window, click the Camera property. The list box will display all <strong>AVT</strong> cameras<br />

connected to your system. Select the one you intend to use.<br />

Selecting the Video Mode<br />

In the Properties window, click the Mode property. The list box will display all the video modes<br />

available for the chosen camera. Select the one you intend to use.<br />

Adding the Start and Stop buttons<br />

In the Toolbox select Windows Form , click on the Button icon and then draw a rectangular area on<br />

the program dialog. A button "Button1" will appear. Go to the Property window and change the Text<br />

property to "Start". Double click on the button. A new function Button1_Click will be added to the<br />

Form1.vb source code. Insert one line to the function body:<br />

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles<br />

Button1.Click<br />

Ax<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

45


Getting started<br />

End Sub<br />

Repeat the same procedure for the Stop button adding the following line to the Button2_Click function:<br />

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles<br />

Button1.Click<br />

Ax<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = False<br />

End Sub<br />

Adding the Grid<br />

From the Tools menu select Customize Toolbox and then select Microsoft Flex Grid Control from the<br />

list. A FlexGrid icon will appear at the bottom of the toolbox. Click the icon and draw a rectangular area<br />

on the form. Go to the Property window and set both Cols and Rows property to 5. You will see a<br />

corresponding number of raws and columns added to the grid on the main form.<br />

Your final design of the main form will be similar to this:<br />

Adding the FrameAcquired event<br />

Double-click in the <strong>AVT</strong><strong>Active</strong>Cam control window. The code window will appear with an empty<br />

Ax<strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired subroutine in it. It is now time to enter the code that will retrieve<br />

an image data array and display pixel values in the grid cells:<br />

Private Sub Ax<strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired(ByVal sender As System.Object, ByVal e As<br />

System.EventArgs) Handles Ax<strong>AVT</strong><strong>Active</strong>Cam1.FrameAcquired<br />

Dim A As Array<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

46


Getting started<br />

Dim X As Integer<br />

Dim Y As Integer<br />

A = Ax<strong>AVT</strong><strong>Active</strong>Cam1.GetImageData<br />

For y = 1 To 4<br />

For x = 1 To 4<br />

AxMSFlexGrid1.set_TextMatrix(Y, X, A(X, Y))<br />

Next<br />

Next<br />

End Sub<br />

Running the application<br />

From the Debug menu of the development environment select Start or press F5. This will build and<br />

run the application. The application dialog will appear on the screen with a black image window and<br />

empty text boxes. Click the Start button to activate the continuous video acquisition. The live image<br />

will appear in the control window and the real-time pixel values will be displayed in the table.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

47


Getting started<br />

3.4 Visual C#<br />

This chapter shows you how to get started with <strong>AVT</strong><strong>Active</strong>Cam control in Visual C#. With just a few<br />

mouse clicks and a few lines of code, you will be able to display a live video image in your C# program<br />

and report a value of a pixel pointed by a mouse cursor in real time.<br />

Creating the Project<br />

In the .NET development environment select New -> Project. The New Project Dialog box will<br />

appear. Select Visual C# projects on the left and Windows Application on the right. In the Name<br />

filed below type the name of your application, for instance My<strong>AVT</strong><strong>Active</strong>Cam and click OK . The<br />

project will be created, and the main application form will be displayed for editing.<br />

Creating the Control<br />

In the Toolbox select Components. From the Tools menu select Add Reference... -> COM and<br />

then select <strong>AVT</strong><strong>Active</strong>Cam Class from the list. You will see <strong>AVT</strong><strong>Active</strong>Cam icon appear at the bottom<br />

of the toolbox.<br />

Click the <strong>AVT</strong><strong>Active</strong>Cam icon in the Toolbox and draw a rectangular area on the form. A rectangle<br />

with the text "<strong>AVT</strong><strong>Active</strong>Cam Control" will appear on the form, and the Properties window on the right<br />

will display <strong>AVT</strong><strong>Active</strong>Cam's properties.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

48


Getting started<br />

Selecting the Camera<br />

In the properties window, click the Camera property. The list box will display all <strong>AVT</strong> cameras<br />

connected to your system. Select the one you intend to use.<br />

Selecting the Video Mode<br />

In the Properties window, click the Mode property. The list box will display all the video modes<br />

available for the chosen camera. Select the one you intend to use.<br />

Modifying the Control's appearance<br />

In the Properties window scroll up to the DCAM Display category and set the Edge and ScrollBars<br />

fields to "Yes"<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

49


Getting started<br />

Adding the Start button<br />

In the Toolbox select Windows Form , click on the Button icon and then draw a rectangular area on<br />

the program dialog. A button "Button1" will appear. Go to the Property window and change the Text<br />

property to "Start". Double click on the button. A new member function button1_Click will be added to<br />

the Form1 source window. Insert one line to the function body:<br />

private void button1_Click(object sender, System.EventArgs e)<br />

{<br />

ax<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=true;<br />

}<br />

This will activate continuous acquisition when the button is clicked.<br />

This will activate continuous acquisition when the button is clicked.<br />

Adding text boxes<br />

In the Toolbox click on the TextBox icon and then draw a small rectangular area on the program<br />

dialog. Repeat this two more times. Your final design of the main form will be similar to this:<br />

Adding the MouseMove event<br />

Click on the <strong>AVT</strong><strong>Active</strong>Cam control on the main form. In the Property window click the Event button.<br />

In the list of events double-click the MouseMoveEvent .<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

50


Getting started<br />

The new event handler ax<strong>AVT</strong><strong>Active</strong>Cam1_MouseMoveEvent will be added to the source code. Add<br />

the following lines to the body of the function:<br />

private void ax<strong>AVT</strong><strong>Active</strong>Cam1_MouseMoveEvent(object sender,<br />

Ax<strong>AVT</strong>ACTIVECAMLib._I<strong>AVT</strong><strong>Active</strong>CamEvents_MouseMoveEvent e)<br />

{<br />

textBox1.Text=ToString(e.x);<br />

textBox2.Text=e.y;<br />

textBox3.Text=ax<strong>AVT</strong><strong>Active</strong>Cam1.GetPixel(e.x,e.y);<br />

}<br />

Running the application<br />

From the Debug menu of the development environment select Start or press F5. This will build and<br />

run the application. The application dialog will appear on the screen with a black image window and<br />

empty text boxes. Click the Start button to activate the continuous video acquisition and move the<br />

mouse cursor over the image window. You are now able to watch and scroll the live image and analyze<br />

pixel coordinates and values - all in real time!<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

51


Getting started<br />

3.5 Delphi<br />

This chapter shows you how to get started with <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> control in Delphi 7. For other<br />

versions of Delphi, the procedure is similar.<br />

The main prerequisite for using the <strong>AVT</strong> <strong>FirePackage</strong> in Delphi is to install the <strong>AVT</strong><strong>Active</strong>Cam<br />

<strong>Active</strong>X control as a Delphi component.<br />

This is done in the menu item "Import <strong>Active</strong>X..." in the menu "Components" by selecting<br />

"<strong>AVT</strong><strong>Active</strong>Cam Control" and by then following the wizard instructions.<br />

After finishing the installation, you will be able to use this control the same way as all other components<br />

in Delphi. The component is available on tab "<strong>Active</strong>X" of Delphi by the following icon:<br />

and by the name <strong>AVT</strong><strong>Active</strong>Cam (<strong>AVT</strong>ACTIVECAMLib_TLB)<br />

To explain the usage of this component, an example is provided.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

52


Getting started<br />

3.6 Using <strong>AVT</strong><strong>Active</strong>Cam API at runtime<br />

Most applications would use <strong>AVT</strong><strong>Active</strong>Cam by embedding one or several <strong>Active</strong>X objects into an<br />

application form at design time, as described in the previous topics. Sometimes however you may want<br />

to use <strong>AVT</strong><strong>Active</strong>Cam SDK dynamically at runtime. This can be useful if you want a user of your<br />

application to decide if he wants to use GigE <strong>Vision</strong> cameras or if you are creating a dynamic link<br />

library that has no GUI. <strong>AVT</strong><strong>Active</strong>Cam easily allows you to do it via its COM programming interface.<br />

C/C++<br />

1. Copy <strong>AVT</strong><strong>Active</strong>Cam_i.c and <strong>AVT</strong><strong>Active</strong>Cam.h files into your project folder and include them into<br />

your project.<br />

2. Add the following defines to a module which will be using <strong>AVT</strong><strong>Active</strong>Cam functions:<br />

#include <br />

#include <br />

#include <br />

#include "<strong>AVT</strong><strong>Active</strong>Cam.h"<br />

3. Initialize COM library and instantiate an <strong>AVT</strong><strong>Active</strong>Cam object:<br />

I<strong>AVT</strong><strong>Active</strong>Cam *p<strong>AVT</strong><strong>Active</strong>Cam;<br />

HRESULT hr = CoInitialize(0);<br />

if (hr==S_OK)<br />

{<br />

hr = CoCreateInstance(CLSID_<strong>AVT</strong><strong>Active</strong>Cam, NULL, CLSCTX_INPROC_SERVER, IID_I<strong>AVT</strong><strong>Active</strong>Cam,<br />

(void**) &p<strong>AVT</strong><strong>Active</strong>Cam);<br />

}<br />

4. Start using <strong>AVT</strong><strong>Active</strong>Cam properties and methods, for example:<br />

hr = p<strong>AVT</strong><strong>Active</strong>Cam->put_Camera(0); // selecting camera #0<br />

hr = p<strong>AVT</strong><strong>Active</strong>Cam->Grab(); // grabbing a frame<br />

hr = p<strong>AVT</strong><strong>Active</strong>Cam->SaveImage( OLESTR("frame1.jpg") ); //saving a frame as jpg file<br />

Refer to <strong>Active</strong>CamConsole and <strong>Active</strong>CamWin sample applications for more details.<br />

VB6<br />

1. Add the <strong>AVT</strong><strong>Active</strong>Cam component to the Toolbox as described in Getting started in VB.<br />

2. Declare a global <strong>AVT</strong><strong>Active</strong>Cam-type object variable in the beginning of your code:<br />

Dim WithEvents AD As <strong>AVT</strong><strong>Active</strong>Cam<br />

3. Instantiate an <strong>AVT</strong><strong>Active</strong>Cam object and assign it to the variable:<br />

Set AD = New <strong>AVT</strong><strong>Active</strong>Cam<br />

4. Start using <strong>AVT</strong><strong>Active</strong>Cam properties and methods, for example:<br />

CameraList=AD.GetCameraList 'retreiving the list of names of connected cameras<br />

AD.Camera=0 'selecting camera #0<br />

AD.SetFeature "GainRaw", 150 'setting Gain value<br />

AD.Acquire=True 'initiating the acquisition<br />

5. To add an <strong>AVT</strong><strong>Active</strong>Cam event handler to your code, select the AD variable from the Object combo<br />

box on top of your code window and then select a desired event from the Procedure box on the right,<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

53


Getting started<br />

for example FrameAcquired. The following fragment will be added to your code:<br />

Private Sub AD_FrameAcquired()<br />

End Sub<br />

Refer to <strong>Active</strong>CamByRef sample application for more details.<br />

6. When you are done with using the <strong>AVT</strong><strong>Active</strong>Cam object, destroy it with the following command:<br />

Set AD = Nothing<br />

VB.NET<br />

1. 1. Right click on your application in the Solution Explorer, select Add Reference...->COM, then select<br />

<strong>AVT</strong><strong>Active</strong>Cam Control from the list.<br />

2. Declare a global <strong>AVT</strong><strong>Active</strong>Cam-type object variable in the beginning of your code:<br />

Dim WithEvents AD As <strong>AVT</strong>ACTIVECAMLib.<strong>AVT</strong><strong>Active</strong>Cam<br />

3. Instantiate an <strong>AVT</strong><strong>Active</strong>Cam object and assign it to the variable:<br />

AD = New <strong>AVT</strong>ACTIVECAMLib.<strong>AVT</strong><strong>Active</strong>Cam<br />

4. Start using <strong>AVT</strong><strong>Active</strong>Cam properties and methods, for example:<br />

Dim CamLst As Object<br />

Dim i As Integer<br />

CamLst = AD.GetCameraList 'retreiving camera list<br />

CamNumber = UBound(CamLst) 'number of connected cameras found<br />

For i = 0 To CamNumber 'filling out combo box with the names of cameras<br />

ComboBox1.Items.Add(CamLst(i))<br />

Next<br />

......<br />

AD.Camera = 0<br />

AD.Acquire = True<br />

5. To add an <strong>AVT</strong><strong>Active</strong>Cam event handler to your code, select the AG variable from the Class Name<br />

box on top of your code window and then select a desired event from the Method Name box on the<br />

right, for example FrameAcquired. The following fragment will be added to your code:<br />

Private Sub AD_FrameAcquired() Handles AD.FrameAcquired<br />

End Sub<br />

6. When you are done using the <strong>AVT</strong><strong>Active</strong>Cam object, destroy it with the following command:<br />

C#<br />

AD = Nothing<br />

1. Right click on your application in the Solution Explorer, select Add Reference.../COM, then select<br />

<strong>AVT</strong><strong>Active</strong>Cam Control from the list.<br />

2. Declare a global <strong>AVT</strong><strong>Active</strong>Cam-type object variable:<br />

<strong>AVT</strong>ACTIVECAMLib.<strong>AVT</strong><strong>Active</strong>Cam AD;<br />

3. Instantiate an <strong>AVT</strong><strong>Active</strong>Cam object and assign it to the variable:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

54


Getting started<br />

AD = new <strong>AVT</strong>ACTIVECAMLib.<strong>AVT</strong><strong>Active</strong>cam();<br />

4. Start using <strong>AVT</strong><strong>Active</strong>Cam properties and methods, for example:<br />

AD.Camera = 0<br />

AD.Acquire=true; 'starting automatic acquisition<br />

AD.ShowProperties (true, 0); 'displaying buit-in property pages<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

55


Getting started<br />

3.7 Working with multiple cameras<br />

In general, interfacing to multiple cameras is as easy as dropping a few <strong>AVT</strong><strong>Active</strong>Cam objects on the<br />

surface of your application.<br />

1. Start by creating a new project. Depending on the development environment you are using, refer to<br />

one of the following chapters for more details:<br />

Visual Basic<br />

Visual C++<br />

VB.NET<br />

Visual C#<br />

2. Configure each <strong>AVT</strong><strong>Active</strong>Cam object for a different camera by clicking a corresponding<br />

<strong>AVT</strong><strong>Active</strong>Cam window and modifying the Camera property. Do not configure different <strong>AVT</strong><strong>Active</strong>Cam<br />

objects for the same camera. Multiple instances of <strong>AVT</strong><strong>Active</strong>Cam cannot acquire video from the same<br />

camera. For the same reason, if you run several <strong>AVT</strong><strong>Active</strong>Cam-based applications, make sure that<br />

each of them connects to a different camera.<br />

3. Add FrameAcquired event handlers per each <strong>AVT</strong><strong>Active</strong>Cam object following the procedure for your<br />

language environment. Due to the multithreading nature of <strong>AVT</strong><strong>Active</strong>Cam, they will not interfere with<br />

each other.<br />

4. Add the acquisition command for each <strong>AVT</strong><strong>Active</strong>Cam object to initiate the video streaming. In<br />

VB.NET you might have the following lines in your code:<br />

Ax<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

Ax<strong>AVT</strong><strong>Active</strong>Cam2.Acquire = True<br />

Ax<strong>AVT</strong><strong>Active</strong>Cam3.Acquire = True<br />

5. If you want to process the situation when a camera is being plugged or unplugged, add<br />

CameraPlugged and CameraUnplugged events to your code.<br />

6. For more information refer to the code of Multi<strong>Active</strong>Cam and PlugUnplug samples.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

56


<strong>Active</strong>X Reference<br />

<strong>Active</strong>X Reference<br />

This chapter provides a complete list of properties, methods and events of the <strong>AVT</strong><strong>Active</strong>Cam object.<br />

Properties<br />

Methods<br />

Events<br />

Property Pages<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

57


<strong>Active</strong>X Reference<br />

4.1 Properties<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> properties are divided into six categories and can be modified in a Property<br />

Window of your development environment, or in <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> property pages.<br />

Dcam Connect Category<br />

Camera Returns or sets the index of the currently selected camera<br />

Acquire Enables/disables the continuous acquisition mode<br />

Asynch Enables/disables the asynchronous mode for video acquisition<br />

Timeout Returns or sets the frame acquisition timeout in seconds<br />

Trigger Enables/disables the hardware trigger<br />

TriggerMode Returns or sets the trigger mode<br />

TriggerCounter Returns or sets the trigger counter for trigger operations<br />

TriggerPolarity Returns or sets the trigger polarity<br />

TriggerDelay Returns or sets the raw value of the trigger delay<br />

Dcam Format Category<br />

Mode Returns or sets the currently selected video mode<br />

Rate Returns or sets the current frame rate<br />

PacketSize Returns or sets the number of bytes in an isochronous packet<br />

SizeX Returns or sets the width of the partial scan window<br />

SizeY Returns or sets the height of the partial scan window<br />

StartX Returns or sets the horizontal offset of the partial scan window<br />

StartY Returns or sets the vertical offset of the partial scan window<br />

SwapBytes Enables/disables byte swapping for 16- and 48-bit video modes<br />

BitShift Returns or sets the bit shift for 16- and 48-bit video modes<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

58


<strong>Active</strong>X Reference<br />

Dcam Exposure Category<br />

Brightness Returns or sets the brightness value<br />

BrightnessControl Returns or sets the brightness control mode<br />

Shutter Returns or sets the shutter value<br />

ShutterControl Returns or sets the shutter control mode<br />

Gain Returns or sets the gain value<br />

GainControl Returns or sets the gain control mode<br />

Gamma Returns or sets the gamma value<br />

GammaControl Returns or sets the gamma control mode<br />

Sharpness Returns or sets the sharpness value<br />

SharpnessControl Returns or sets the sharpness control mode<br />

AutoExposure Enables/disables the autoexposure mode<br />

AutoExposureRef Returns or sets the autoexposure reference value<br />

Dcam Color Category<br />

Saturation Returns or sets the saturation value<br />

SaturationControl Returns or sets the saturation control mode<br />

Hue Returns or sets the hue value<br />

HueControl Returns or sets the hue control mode<br />

WhiteBalanceUB Returns or sets the U/B value of the white color<br />

WhiteBalanceVR Returns or sets the V/R value of the white color<br />

WhiteBalanceControl Returns or sets the white balance control mode<br />

Bayer Enables/disables the Bayer conversion mode and selects<br />

conversion method<br />

BayerLayout Returns or sets the pixel layout in the Bayer array<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

59


<strong>Active</strong>X Reference<br />

Dcam Display Category<br />

AntiTearing Enables/disables the anti-tearing feature for the live video<br />

display.<br />

MonitorSync Enables/disables the monitor-synchronization mode<br />

Edge Enables/disables the 3D look of the control window<br />

ScrollBars Enables/disables the scroll bars in the control window<br />

ScrollX Returns or sets the current horizontal scroll position for the live<br />

video<br />

ScrollY Returns or sets the current vertical scroll position for the live<br />

video<br />

Flip Flips the image horizontally or/and vertically<br />

Rotate Rotates the image at the specified angle<br />

Palette Returns or sets the number of the current live video palette<br />

Magnification Returns or sets the magnification factor for the live video display<br />

BkgName Returns or sets the name prefix for background data<br />

BkgCorrect Resturns or sets the background correction mode<br />

Integrate Enables/disables the frame integration operation and selects the<br />

integration mode<br />

IntegrateWnd Returns or sets the number of frames to be used in the Integrate<br />

operation<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

60


<strong>Active</strong>X Reference<br />

Appearance Category<br />

BackColor Returns or sets the background color of the control window<br />

Display Enables/disables automatic live display in the control window.<br />

AntiTearing Enables/disables the anti-tearing feature for the live video<br />

display.<br />

Edge Enables/disables the 3D look of the control window<br />

ScrollBars Enables/disables the scroll bars in the control window<br />

ScrollX Returns or sets the current horizontal scroll position for the live<br />

video<br />

ScrollY Returns or sets the current vertical scroll position for the live<br />

video<br />

Flip Flips the image horizontally or/and vertically<br />

Rotate Rotates the image at the specified angle<br />

Palette Returns or sets the number of the current live video palette<br />

Magnification Returns or sets the magnification factor for the live video display<br />

Font Returns or sets the font for drawing text in the image<br />

Overlay Enables/disables the overlay<br />

OverlayColor Returns or sets the color of the overlay graphics<br />

OverlayFont Returns or sets the font for drawing text in the overlay<br />

BkgName Returns or sets the name prefix for background data<br />

BkgCorrect Resturns or sets the background correction mode<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

61


<strong>Active</strong>X Reference<br />

Acquire<br />

Description<br />

Enables/disables the continuous acquisition mode. If the acquisition mode is enabled and the Display<br />

property is turned on, the live video will be displayed in the control window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Acquire [= Value]<br />

[C/C++]<br />

HRESULT get_Acquire ( bool *pAcquire );<br />

HRESULT put_Acquire( bool Acquire );<br />

Data Type [VB]<br />

Boolean<br />

Parameters [C/C++]<br />

pAcquire [out,retval]<br />

Pointer to the Boolean that is TRUE if the continuous acquisition is enabled, or FALSE otherwise<br />

Acquire [in]<br />

Set to TRUE to enable the continuous acquisition, or set to FALSE otherwise<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example activates the continuous acquisition mode upon clicking the Start button:<br />

Private Sub cmdStart_Click()<br />

On Error GoTo err_cmdStart<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

Exit Sub<br />

err_cmdStart:<br />

MsgBox Err.Description<br />

End Sub<br />

Remarks<br />

If this property is set to TRUE, <strong>AVT</strong><strong>Active</strong>Cam will continuously acquire the video into the internal<br />

image memory. The FrameAcquired event will be generated upon completing each frame. To access<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

62


<strong>Active</strong>X Reference<br />

the content of the image memory, use GetPixel, GetLine, GetImageWindow and GetImageData<br />

methods.<br />

Note that this property works in both the design and run-time modes. If your development environment<br />

doesn't close the design view prior to going to the run-time mode, a conflict will occur between two<br />

<strong>AVT</strong><strong>Active</strong>Cam objects trying to acquire the video from the same camera. In order to prevent this, it is<br />

recommended to keep the Acquire property set to FALSE in the design mode and turn it on by an<br />

explicit command in the program code (see the example above).<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

63


<strong>Active</strong>X Reference<br />

AntiTearing<br />

Description<br />

Enables/disables the anti-tearing feature for the live video display in the control window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.AntiTearing [= Value]<br />

[C/C++]<br />

HRESULT get_AntiTearing ( bool *pAntiTearing );<br />

HRESULT put_AntiTearing( bool AntiTearing );<br />

Data Type [VB]<br />

Boolean<br />

Parameters [C/C++]<br />

pAntiTearing [out,retval]<br />

Pointer to the Boolean that is TRUE if the anti-tearing is enabled, or FALSE otherwise<br />

AntiTearing [in]<br />

Set to TRUE to enable the the anti-tearing, or set to FALSE to disable it<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example enables the anti-tearing feature:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.AntiTearing = True<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.AntiTearing<br />

Remarks<br />

Tearing is a display artifact caused by the difference between the frame rate of the camera and the<br />

refresh rate of the monitor. Tearing can be noticed on the live video as horizontal splits between the<br />

upper and bottom parts of frames with higly dynamic contest. If AntiTearing is set to TRUE, the<br />

display update will be synchronized with the vertical blank period of the monitor thus eliminating tearing<br />

artifacts.<br />

When AntiTearing is enabled, the effective frame rate will be limited by the monitor's refresh rate. You<br />

can also experience a performance drop resulting in an additional CPU load.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

64


<strong>Active</strong>X Reference<br />

Note - some advanced graphic controllers may have the anti-tearing functionality implemented in the<br />

hardware. If your system have such a graphic card, do not enable the AntiTearing property.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

65


<strong>Active</strong>X Reference<br />

Asynch<br />

Description<br />

Enables/disables the asynchronous mode for video acquisition.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Asynch [= Value]<br />

[C/C++]<br />

HRESULT get_Asynch ( bool *pAsynch );<br />

HRESULT put_Asynch( bool Asynch );<br />

Data Type [VB]<br />

Boolean<br />

Parameters [C/C++]<br />

pAsynch [out,retval]<br />

Pointer to the Boolean that is TRUE if the asynchronous acquisition is enabled, or FALSE<br />

otherwise<br />

Asynch [in]<br />

Set to TRUE to enable the asynchronous acquisition, or set to FALSE for synchronous acquisition<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example sets the acquisition in the asynchronous mode:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Asynch = True<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.Asynch<br />

Remarks<br />

If this property is set to TRUE, the camera will continuously transfer pixels into the internal image<br />

memory, allowing your application to perform other tasks while the acquisition of the next frame occurs.<br />

The asynchronous mode provides the fastest and most efficient setup for real-time image processing.<br />

However, if processing occurs at a slower rate than pixels are acquired, using this mode may result in<br />

the decomposition of images and loss of data.<br />

Setting the Asynch property to FALSE will set the board to the synchronous mode. In this mode the<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

66


<strong>Active</strong>X Reference<br />

acquisition of the next frame will be initiated upon calling the Grab method. The synchronous mode is<br />

slower, but it guarantees the wholeness of images during real-time processing.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

67


<strong>Active</strong>X Reference<br />

AutoExposure<br />

Description<br />

Returns or sets the auto exposure control mode. The values from -1 to 2 correspond to the following<br />

modes:<br />

-1 - Off<br />

The auto exposure control is disabled<br />

0 - Manual<br />

The auto exposure reference level is controlled by the value of the AutoExposureRef property<br />

1 - Auto<br />

The camera controls the auto exposure reference level by itself continuously<br />

2 - One push<br />

The camera sets the optimal auto exposure reference level by itself and returns to the manual<br />

mode<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.AutoExposure [= Value]<br />

[C/C++]<br />

HRESULT get_AutoExposure( short *pAutoExposure );<br />

HRESULT put_AutoExposure( short AutoExposure );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pAutoExposure [out, retval]<br />

Pointer to the current auto exposure control mode<br />

AutoExposure [in]<br />

The auto exposure control mode to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The auto exposure control is not available for the selected camera<br />

Example<br />

The following VB example demonstrates the use of a checkbox to activate the auto exposure mode<br />

Private Sub Check1_Click()<br />

If Check1.Value = 1 Then<br />

<strong>AVT</strong><strong>Active</strong>Cam1.AutoExposure = 1<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

68


<strong>Active</strong>X Reference<br />

Else<br />

<strong>AVT</strong><strong>Active</strong>Cam1.AutoExposure = 0<br />

End If<br />

End Sub<br />

Remarks<br />

When the auto exposure mode is activated, the camera will automatically control the exposure by<br />

keeping Shutter, Gain and/or Iris at optimal levels. The property is available only if the currently<br />

selected camera supports auto exposure control. The reference value for auto exposure can be<br />

adjusted by AutoExposureRef.<br />

Note that for some cameras based on older chipsets (IIDC 1.20) the auto exposure feature controls the<br />

shutter speed.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

69


<strong>Active</strong>X Reference<br />

AutoExposureRef<br />

Description<br />

Returns or sets the row value of the autoexposure reference<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.AutoExposureRef [= Value]<br />

[C/C++]<br />

HRESULT get_AutoExposureRef( long *pAutoExposureRef );<br />

HRESULT put_AutoExposureRef( long AutoExposureRef );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pAutoExposureRef [out,retval]<br />

Pointer to the current autoexposure reference value<br />

AutoExposureRef [in]<br />

The autoexposure reference value to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The autoexposure control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following VB example demonstrates the use of a scroll control for real-time adjustment of the<br />

autoexposure reference.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.AutoExposure=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.AutoExposureRef<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetExposureMin<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetExposureMax<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.AutoExposureRef = HScroll1.Value<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

70


<strong>Active</strong>X Reference<br />

Remarks<br />

This property changes the reference level used by the camera circuitry in the AutoExposure mode. The<br />

valid property range is reported by the GetExposureMin and GetExposureMax methods. Note that the<br />

property is available only if the currently selected camera supports the autoexposure control.<br />

Note that for some cameras based on older chipsets (IIDC 1.20) this feature controls the shutter<br />

speed.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

71


<strong>Active</strong>X Reference<br />

BackColor<br />

Description<br />

Returns or sets the background color of the control window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.BackColor [= Color]<br />

[C/C++]<br />

HRESULT get_BackColor(OLE_COLOR& pColor);<br />

HRESULT put_BackColor(OLE_COLOR Color);<br />

Data Type [VB]<br />

RGB color<br />

Parameters [C/C++]<br />

pColor [out,retval]<br />

Pointer to the current background color<br />

Color [in]<br />

The background color to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example sets the background color of the control to light gray:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.BackColor = RGB (192, 192, 192)<br />

Remarks<br />

When the control displays a live video, its background is only visible if the size of the video display in<br />

the horizontal or vertical dimension is less than the size of the control window.<br />

BackColor is an ambient property, therefore its default value is defined by the color of the form on<br />

which the control resides. Changing the background color of the container application will cause an<br />

equivalent change in the BackColor property of <strong>AVT</strong><strong>Active</strong>Cam.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

72


<strong>Active</strong>X Reference<br />

Bayer<br />

Description<br />

Enables/disables the Bayer conversion mode and selects the Bayer conversion method.<br />

For the Guppy cameras GF025C, GF029C, GF038C and GF044C (including the -NIR versions), this<br />

property just controls the conversion mode and not the conversion method since there is only one<br />

method available.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Bayer [= Value]<br />

[C/C++]<br />

HRESULT get_Bayer ( short *pBayer );<br />

HRESULT put_Bayer( short Bayer );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pBayer [out,retval]<br />

Pointer to the ordinal number of the currently selected Bayer filter, zero if Bayer conversion is<br />

disabled.<br />

Bayer [in]<br />

Set to zero to disable Bayer conversion, or set to values from 1 to 3 to select one of the following<br />

Bayer filters:<br />

1 - Nearest Neighbour filter. Missing pixels are substituted with adjacent pixels of the same<br />

color.<br />

2 - Bilinear filter. Calculates the values of missing pixels by performing bilinear interpolation of<br />

the adjacent pixels.<br />

3 - High Quality Linear filter. Calculates the values of missign pixels based on the Malvar, He<br />

and Cutler algorithm.<br />

4 - Chrominance filter. Interpolates the values of missing pixels based on chrominance<br />

gradients.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example activates the bilinear Bayer filter:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Bayer = 2<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

73


<strong>Active</strong>X Reference<br />

Remarks<br />

Bayer images are usually generated by a single-chip CCD camera, which has a color filter mosaic<br />

array (CFA) installed in front of the sensor. The most frequently used Bayer pattern has the following<br />

layout:<br />

G B G B R<br />

R G R G R<br />

G B G B G<br />

R G R G R<br />

Each pixel value in a Bayer image corresponds to the intensity of the pixel behind the corresponding<br />

color filter. The conversion from such a grayscale image to RGB image is typically done on the camera<br />

itself, however some cameras (known as Bayer cameras) output a raw Bayer image unchanged. The<br />

Bayer transforms such an image into RGB image by performing real-time Bayer color reconstruction<br />

(demosaicing). The layout of the Bayer array can be selected with the BayerLayout property.<br />

Note that the higher the ordinal number of the selected Bayer filter is, the higher the quality of the<br />

resulting image is and the higher the CPU load is. If the application speed is critical, consider using the<br />

Nearest Neighbour filter.<br />

Note that this property is available only if the current video Mode is a monochrome one.<br />

Please note that after detecting a new camera, automatic bayer layout recognition is performed and the<br />

bayer conversation method is set to nearest.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

74


<strong>Active</strong>X Reference<br />

BayerLayout<br />

Description<br />

Returns or sets the layout of pixels in the CCD array of a Bayer camera with RGGB color sensor. The<br />

values from 0 to 3 correspond to the following layouts:<br />

0 - GB<br />

G B G B G<br />

R G R G R<br />

1 - GR<br />

G R G R G<br />

B G B G B<br />

2 - BG<br />

B G B G B<br />

G R G R G<br />

3 - RG<br />

R G R G R<br />

G B G B R<br />

For the Guppy cameras GF025C, GF029C, GF038C and GF044C (including the -NIR versions), this<br />

property has no meaning since they use a sensor with mostly complementary colors (Cyan, Yellow,<br />

Magenta and Green).<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.BayerLayout [= Value]<br />

[C/C++]<br />

HRESULT get_BayerLayout( long *pBayerLayout );<br />

HRESULT put_BayerLayout( long BayerLayout );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pBayerLayout [out,retval]<br />

Pointer to the ordinal number of the currently selected layout<br />

BayerLayout [in]<br />

The number of the layout to be selected<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

75


<strong>Active</strong>X Reference<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example demonstrates the use of a combo box for changing the Bayer layout:<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Bayer = True<br />

Combo1.AddItem ("GB")<br />

Combo1.AddItem ("GR")<br />

Combo1.AddItem ("BG")<br />

Combo1.AddItem ("RG")<br />

Combo1.ListIndex = 1<br />

End Sub<br />

Private Sub Combo1_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.BayerLayout = Combo1.ListIndex<br />

End Sub<br />

Remarks<br />

This property works in combination with the Bayer filter. The layout of the CCD array is defined by your<br />

Bayer camera specifications. If you use on of the partial scan (Format 7) video Modes and apply an<br />

offset to the partial scan window (see StartX, StartY), you might need to select a different Bayer layout<br />

depending on the position of the top left corner of the window relative to the CCD mask.<br />

Note that this property is available only if the current video Mode is a monochrome one.<br />

Please note that every time a camera is detected automatic bayer layout recognition is performed.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

76


<strong>Active</strong>X Reference<br />

BitShift<br />

Description<br />

Returns or sets the bit shift value for 16-bit and 48-bit video modes.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.BitShift [= Value]<br />

[C/C++]<br />

HRESULT get_BitShift( long *pShutter );<br />

HRESULT put_BitShift( long Shutter );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pBitShift [out,retval]<br />

Pointer to the current bit shift<br />

BitShift [in]<br />

The bit shift to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The shutter control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following VB example sets the bit shift to 6.<br />

<strong>AVT</strong><strong>Active</strong>Cam1.BitShift=6<br />

Remarks<br />

This property defines the right bit shift to be applied to 16-bit pixel values in the image buffer. When<br />

displaying and saving 16- and 48-bit images, <strong>AVT</strong><strong>Active</strong>Cam assumes that pixel values are mapped to<br />

the whole 16-bit dynamic range (0-65535). Certain cameras however may output data in narrower<br />

dynamic range resulting in dark images, in which case the BitShift property must be used. For<br />

example, if the original pixel values have the dynamic range of 10 bits (0-1023), setting BitShift to 6<br />

will cause the real-time mapping of images to the entire 16-bit scale.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

77


<strong>Active</strong>X Reference<br />

Note that this property is available only in 16- and 48-bit video Modes.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

78


<strong>Active</strong>X Reference<br />

BkgCorrect<br />

Description<br />

Returns or sets the mode for the background correction. The values from 0 to 2 correspond to the<br />

following modes:<br />

0 - None<br />

No background correction is performed.<br />

1 - Dark<br />

The dark field (offset) background correction is applied to each acquired frame.<br />

2 - Flat<br />

The flat field (gain) background correction is applied to each acquired frame.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.BkgCorrect [ = Value ]<br />

[C/C++]<br />

HRESULT get_BkgCorrect( short *pCorrect );<br />

HRESULT put_BkgCorrect( short Correct );<br />

Data Types [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pCorrect [out,retval]<br />

Pointer to the current background correction mode<br />

BitShift [in]<br />

Background correction mode to be set<br />

Return Values<br />

S_OK<br />

Success<br />

Example<br />

The following VB example sets the dark field correction mode:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.BkgCorrect=1<br />

Remarks<br />

The dark field (offset) correction is used to compensate for the pixel-to-pixel difference in the dark<br />

current of the camera sensor. The correction is performed by subtracting background pixel values from<br />

corresponding pixel values of the original image. The dark field correction requires the dark field<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

79


<strong>Active</strong>X Reference<br />

background image for the current video mode to have been stored on the hard drive.<br />

The flat field (gain) correction is used to compensate for the variations in pixel-to-pixel sensitivity as<br />

well as non-uniformity of the illumination. The correction algorithm is based on the following formula:<br />

where<br />

Ix,y is a pixel value of the original image<br />

Bx,y is a pixel value of the dark field image<br />

Wx,y is a pixel value of the bright field image<br />

Wmax is a maximum value of the bright field image<br />

Cx,y is a new pixel value of the corrected image<br />

The flat field correction requires the bright field background image for the current video mode to have<br />

been stored on the hard drive. If the dark field image for the currently selected video mode does not<br />

exist on the hard drive, the value of 0 will be used in place of B.<br />

If corresponding background images are not found on the hard drive, no correction will be performed.<br />

See SaveBkg for more details on preparing and saving background data.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

80


<strong>Active</strong>X Reference<br />

BkgName<br />

Description<br />

Returns or sets the name prefix for the background data files.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.BkgName =[ Value ]<br />

[C/C++]<br />

HRESULT get_BkgName( bstr *pName );<br />

HRESULT put_BkgName( bstr Name );<br />

Data Types [VB]<br />

String<br />

Parameters [C/C++]<br />

pName [out, retval]<br />

Pointer to the string containing the name prefix of the background data files.<br />

Name [in]<br />

The background name prefix to be set.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example assigns the name for background files and stores the current image as a<br />

dark field:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.BkgName="MyBackground"<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SaveBkg (1)<br />

Remarks<br />

Bakground data are stored as raw image files in the Bkgnd subfolder of <strong>AVT</strong><strong>Active</strong>Cam program<br />

directory (typically C:\Program Files\<strong>AVT</strong><strong>Active</strong>Cam\Bkgnd). The full name of a background file is<br />

composed of the BkgName prefix and substrings indicating the camera index, video mode and<br />

background type. E.g., if the background name is assinged as in the example above and the camera<br />

operates in the video mode #3, the bakground image file will be stored under the name<br />

"MyBackground_cam0_mode3_dark.raw"<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

81


<strong>Active</strong>X Reference<br />

Brightness<br />

Description<br />

Returns or sets the row value of the brightness<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Brightness [= Value]<br />

[C/C++]<br />

HRESULT get_Brightness( long *pBrightness );<br />

HRESULT put_Brightness( long Brightness );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pBrightness [out,retval]<br />

Pointer to the current brightness value<br />

Brightness [in]<br />

The brightness value to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The brightness control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following VB example demonstrates the use of a scroll control for real-time adjustment of the<br />

camera's brightness.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Brightness<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetBrightnessMin<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetBrightnessMax<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Brightness = HScroll1.Value<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

82


<strong>Active</strong>X Reference<br />

Remarks<br />

This property changes the black level of the video by adding a constant amount of luminance to each<br />

pixel. The valid property range is reported by the GetBrightnessMin and GetBrightnessMax methods.<br />

Note that the property is available only if the currently selected camera supports software brightness<br />

control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

83


<strong>Active</strong>X Reference<br />

BrightnessControl<br />

Description<br />

Returns or sets the brightness control mode. The values from -1 to 2 correspond to the following<br />

modes:<br />

-1 - Off<br />

The brightness control is disabled<br />

0 - Manual<br />

The brightness level is controlled by the value of the Brightness property<br />

1 - Auto<br />

The camera controls the brightness level by itself continuously<br />

2 - One push<br />

The camera sets the optimal brightness level by itself and returns to the manual mode<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.BrightnessControl [= Value]<br />

[C/C++]<br />

HRESULT get_BrightnessControl( short *pBrightnessControl );<br />

HRESULT put_BrightnessControl( short BrightnessControl );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pBrightnessControl [out, retval]<br />

Pointer to the current brightness control mode<br />

BrightnessControl [in]<br />

The brightness control mode to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The brightness control is not available for the selected camera<br />

Example<br />

The following VB example demonstrates the use of a checkbox to switch between the manual and<br />

automatic brightness control.<br />

Private Sub Check1_Click()<br />

If Check1.Value = 1 Then<br />

<strong>AVT</strong><strong>Active</strong>Cam1.BrightnessControl = 1<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

84


<strong>Active</strong>X Reference<br />

Else<br />

<strong>AVT</strong><strong>Active</strong>Cam1.BrightnessControl = 0<br />

End If<br />

End Sub<br />

Remarks<br />

The property is available only if the currently selected camera supports automatic brightness control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

85


<strong>Active</strong>X Reference<br />

Camera<br />

Description<br />

Returns or sets the index of the currently selected camera. If no <strong>AVT</strong> camera is connected to the<br />

system, the property will return -1.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Camera [= Value]<br />

[C/C++]<br />

HRESULT get_Camera( long *pCamera );<br />

HRESULT put_Camera( long Camera );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pCamera [out, retval]<br />

Pointer to the camera's index<br />

Camera [in]<br />

The index of the camera to be selected<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The selected camera is no <strong>AVT</strong> camera<br />

E_INVALIDARG<br />

The camera's index is out of range.<br />

Example<br />

This VB example initializes a combo box with camera names and uses it to switch between the<br />

cameras:<br />

Private Sub Form_Load()<br />

CamLst = <strong>AVT</strong><strong>Active</strong>Cam1.GetCameraList<br />

For i = 0 To UBound(CamLst)<br />

Combo1.AddItem (CamLst(i))<br />

Next<br />

Combo1.ListIndex = 0<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

End Sub<br />

Private Sub Combo1_Click()<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

86


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Camera = Combo1.ListIndex<br />

End Sub<br />

Remarks<br />

The value of the property is a zero-based index into the list of <strong>AVT</strong>'s 1394 cameras connected to the<br />

system. The list of camera names can be retrieved with GetCameraList. If you use the property<br />

window of your development environment or <strong>AVT</strong><strong>Active</strong>Cam's property pages, the Camera property<br />

field will be presented as a list box containing the indexes and names of all the connected cameras.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

87


<strong>Active</strong>X Reference<br />

Display<br />

Description<br />

Enables/disables live display in the control window. When this property is enabled, each frame will be<br />

automatically displayed upon acquisition.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Display [= Value]<br />

[C/C++]<br />

HRESULT get_Display ( bool *pDisplay );<br />

HRESULT put_Display( bool Display );<br />

Data Type [VB]<br />

Boolean<br />

Parameters [C/C++]<br />

pDisplay [out,retval]<br />

Pointer to the Boolean that is TRUE if the live display is enabled, or FALSE otherwise<br />

Display [in]<br />

Set to TRUE to enable the live display, or set to FALSE to disable it<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example disables the live display and uses the FrameAcquired event to invert pixel value in<br />

the bottom left corner of the current frame and display the processed frame in real time.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Display = False<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

End Sub<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

a = <strong>AVT</strong><strong>Active</strong>Cam1.GetImageData<br />

For x = 0 To 200<br />

For y = 0 To 200<br />

a(x, y) = 255 - a(x, y)<br />

Next<br />

Next<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

88


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Draw<br />

End Sub<br />

Remarks<br />

When you create a new instance of the control, this property is enabled by default. You should disable<br />

the live display when you want to perform real time image processing and display the processed image<br />

in the control window. After the processing is done, the current frame should be displayed by calling the<br />

Draw method.<br />

This property controls the internal conversion to RGB24 format which is required by image data access<br />

and image analysis methods, such as GetImageData, GetComponentData, GetImageLine,<br />

GetImageWindow, GetHistogram, GetImageStat and others. Setting Display to FALSE will disable the<br />

conversion and provide original video formats on the output pin.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

89


<strong>Active</strong>X Reference<br />

Edge<br />

Description<br />

Enables/disables the 3D look (sunken edge) of the control window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Edge [= Value]<br />

[C/C++]<br />

HRESULT get_Edge ( bool *pEdge );<br />

HRESULT put_Edge( bool Edge );<br />

Data Type [VB]<br />

Boolean<br />

Parameters [C/C++]<br />

pEdge [out,retval]<br />

Pointer to the Boolean that is TRUE if the 3D look is enabled, or FALSE otherwise<br />

Edge [in]<br />

Set to TRUE to enable the 3D look, or set to FALSE to disable it<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example enables the 3D look on the control window:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Edge = True<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.Edge<br />

Remarks<br />

If this property is set to TRUE, the sunken edge will appear around the border of the <strong>AVT</strong><strong>Active</strong>Cam<br />

control window.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

90


<strong>Active</strong>X Reference<br />

Flip<br />

Description<br />

Returns or sets the horizontal and vertical flipping of the image. The values from 0 to 3 correspond to<br />

the following flipping conditions:<br />

0 - None<br />

No image flipping is performed.<br />

1 - Horizontal<br />

The image is flipped horizontally.<br />

2 - Vertical<br />

The image is flipped vertically.<br />

3 - Both<br />

The image is flipped horizontally and vertically.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Flip [= Value]<br />

[C/C++]<br />

HRESULT get_Flip( long *pFlip );<br />

HRESULT put_Flip( long Flip );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pFlip [out,retval]<br />

Pointer to the ordinal number of the currently selected flipping condition.<br />

Palette [in]<br />

The flipping condition to be set.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example demonstrates the use of a combo box for flipping the live video:<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

91


<strong>Active</strong>X Reference<br />

Combo1.AddItem ("None")<br />

Combo1.AddItem ("Horizontal")<br />

Combo1.AddItem ("Vertical")<br />

Combo1.AddItem ("Diagonal")<br />

Combo1.ListIndex = 0<br />

End Sub<br />

Private Sub Combo1_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Flip = Combo1.ListIndex<br />

End Sub<br />

Remarks<br />

Flipping affects the way the video is displayed in the control window as well as actual order of pixels in<br />

the image frame. If you apply one of the flipping options, the data returned by GetImageData and other<br />

data access methods will be flipped as well.<br />

Note that the flip operation has precedence over Rotate. If both Flip and Rotate properties are nonzero,<br />

the frame will be flipped first and the resulting image rotated.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

92


<strong>Active</strong>X Reference<br />

Font<br />

Description<br />

Returns or sets the font for DrawText.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Font [= Font]<br />

[C/C++]<br />

HRESULT get_Font(IFontDisp* *pFont);<br />

HRESULT put_Font(IFontDisp* Font);<br />

Data Type [VB]<br />

StdFont<br />

Parameters [C/C++]<br />

pFont [out,retval]<br />

Pointer to the IFontDisp interface object corresponding to the current overlay font<br />

Font [in]<br />

IFontDisp interface object corresponding to the overlay font to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example inserts two string of text in the live video:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

Dim Font1 As New StdFont<br />

Font1.Name = "Arial"<br />

Font1.Size = 30<br />

Font1.Bold = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Font = Font1<br />

<strong>AVT</strong><strong>Active</strong>Cam1.DrawText 10, 100, "<strong>AVT</strong><strong>Active</strong>Cam", 255, 0, 0<br />

Font2.Name = "Arial"<br />

Font2.Size = 20<br />

Font2.Italic = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Font = Font2<br />

<strong>AVT</strong><strong>Active</strong>Cam1.DrawText 10, 200, "The most powerful 1394 SDK", 0, 0, 255<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

93


<strong>Active</strong>X Reference<br />

Remarks<br />

Also see DrawText.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

94


<strong>Active</strong>X Reference<br />

Gain<br />

Description<br />

Returns or sets the row value of the gain<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Gain [= Value]<br />

[C/C++]<br />

HRESULT get_Gain( long *pGain );<br />

HRESULT put_Gain( long Gain );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pGain [out,retval]<br />

Pointer to the current gain value<br />

Gain [in]<br />

The gain value to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The gain control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following VB example demonstrates the use of a scroll control for real-time adjustment of the<br />

camera's gain.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Gain<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetGainMin<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetGainMax<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Gain = HScroll1.Value<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

95


<strong>Active</strong>X Reference<br />

Remarks<br />

This property changes the camera's video signal amplification. The valid property range is reported by<br />

the GetGainMin and GetGainMax methods. Note that the property is available only if the currently<br />

selected camera supports software gain control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

96


<strong>Active</strong>X Reference<br />

GainControl<br />

Description<br />

Returns or sets the gain control mode. The values from -1 to 2 correspond to the following modes:<br />

-1 - Off<br />

The gain control is disabled<br />

0 - Manual<br />

The gain level is controlled by the value of the Gain property<br />

1 - Auto<br />

The camera controls the gain level by itself continuously<br />

2 - One push<br />

The camera sets the optimal gain level by itself and returns to the manual mode<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.GainControl [= Value]<br />

[C/C++]<br />

HRESULT get_GainControl( short *pGainControl );<br />

HRESULT put_GainControl( short GainControl );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pGainControl [out, retval]<br />

Pointer to the current gain control mode<br />

GainControl [in]<br />

The gain control mode to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The gain control is not available for the selected camera<br />

Example<br />

The following VB example demonstrates the use of a checkbox to switch between the manual and<br />

automatic gain control.<br />

Private Sub Check1_Click()<br />

If Check1.Value = 1 Then<br />

<strong>AVT</strong><strong>Active</strong>Cam1.GainControl = 1<br />

Else<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

97


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.GainControl = 0<br />

End If<br />

End Sub<br />

Remarks<br />

The property is available only if the currently selected camera supports automatic gain control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

98


<strong>Active</strong>X Reference<br />

Gamma<br />

Description<br />

Returns or sets the row value of the gamma<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Gamma [= Value]<br />

[C/C++]<br />

HRESULT get_Gamma( long *pGamma );<br />

HRESULT put_Gamma( long Gamma );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pGamma [out,retval]<br />

Pointer to the current gamma value<br />

Gamma [in]<br />

The gamma value to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The gamma control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following VB example demonstrates the use of a scroll control for real-time adjustment of the<br />

camera's gamma value.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Gamma<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetGammaMin<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetGammaMax<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Gamma = HScroll1.Value<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

99


<strong>Active</strong>X Reference<br />

Remarks<br />

This property changes the gamma correction factor of the camera's circuitry. The gamma correction<br />

modifies an image by applying standard, nonlinear gamma curves to the intensity scale. Increasing the<br />

gamma value will lighten the video and increase the contrast in its darker areas. The valid range of the<br />

raw gamma values is reported by the GetGammaMin and GetGammaMax methods. Note that the<br />

property is available only if the currently selected camera supports software gamma control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

100


<strong>Active</strong>X Reference<br />

GammaControl<br />

Description<br />

Returns or sets the gamma control mode. The values from -1 to 2 correspond to the following modes:<br />

-1 - Off<br />

The gamma control is disabled<br />

0 - Manual<br />

The gamma level is controlled by the value of the Gamma property<br />

1 - Auto<br />

The camera controls the gamma level by itself continuously<br />

2 - One push<br />

The camera sets the optimal gamma level by itself and returns to the manual mode<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.GammaControl [= Value]<br />

[C/C++]<br />

HRESULT get_GammaControl( short *pGammaControl );<br />

HRESULT put_GammaControl( short GammaControl );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pGammaControl [out, retval]<br />

Pointer to the current gamma control mode<br />

GammaControl [in]<br />

The gamma control mode to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The gamma control is not available for the selected camera<br />

Example<br />

The following VB example demonstrates the use of a checkbox to switch between the manual and<br />

automatic gamma control.<br />

Private Sub Check1_Click()<br />

If Check1.Value = 1 Then<br />

<strong>AVT</strong><strong>Active</strong>Cam1.GammaControl = 1<br />

Else<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

101


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.GammaControl = 0<br />

End If<br />

End Sub<br />

Remarks<br />

The property is available only if the currently selected camera supports automatic gamma control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

102


<strong>Active</strong>X Reference<br />

Integrate<br />

Description<br />

Enables/disables the frame integration operation and selects the integration mode. The frame<br />

integration allows you to average or add frames "on the fly" without sacrificing the frame rate. Used in<br />

combination with IntegrateWnd.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Integrate [= Value]<br />

[C/C++]<br />

HRESULT get_Integrate ( short *pIntegrate );<br />

HRESULT put_Integrate( short Integrate );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pIntegrate [out,retval]<br />

Pointer to the ordinal number of the currently selected Integrate filter, zero if Integrate conversion is<br />

disabled.<br />

Integrate [in]<br />

0 - Frame integration is disabled.<br />

1 - Running Average mode. Each output frame is the result of averaging a selected number of<br />

previously captured frames.<br />

2 - Running Accumulation mode. Each output frame is the sum of a selected number of<br />

previously captured frame.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example activates the running average mode with a 16-frame window:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.IntegrateWnd=16<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Integrate = 1<br />

Remarks<br />

The frame integration is especially useful for suppressing the noise in the video and increasing its<br />

contrast in a low-light situation.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

103


<strong>Active</strong>X Reference<br />

IntegrateWnd<br />

Description<br />

Returns or sets the number of frames to be used in the Integrate operation.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.IntegrateWnd [= Value]<br />

[C/C++]<br />

HRESULT get_IntegrateWnd( long *pValue );<br />

HRESULT put_IntegrateWnd( long Value );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pValue [out,retval]<br />

Pointer to the currently selected number of frames for the frame integration<br />

Value [in]<br />

The number of frames to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example activates the running average mode with a 16-frame window:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.IntegrateWnd=16<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Integrate = 1<br />

Remarks<br />

The size of the integration windows indicates the number of consecutive frames used for the Running<br />

Average or Running Accumulation operations. Increasing the size of the integration window lowers the<br />

video noise, but increases a motion-related blurring.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

104


<strong>Active</strong>X Reference<br />

Hue<br />

Description<br />

Returns or sets the row value of the hue<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Hue [= Value]<br />

[C/C++]<br />

HRESULT get_Hue( long *pHue );<br />

HRESULT put_Hue( long Hue );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pHue [out,retval]<br />

Pointer to the current hue value<br />

Hue [in]<br />

The hue value to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The hue control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following VB example demonstrates the use of a Scroll control for real-time adjustment of the<br />

camera's hue.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Hue<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetHueMin<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetHueMax<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Hue = HScroll1.Value<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

105


<strong>Active</strong>X Reference<br />

Remarks<br />

This property changes the global shitf of the color tint. The valid property range is reported by the<br />

GetHueMin and GetHueMax methods. Note that the property is available only if the currently selected<br />

camera is a color one and supports software hue control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

106


<strong>Active</strong>X Reference<br />

HueControl<br />

Description<br />

Returns or sets the hue control mode. The values from -1 to 2 correspond to the following modes:<br />

-1 - Off<br />

The hue control is disabled<br />

0 - Manual<br />

The hue level is controlled by the value of the Hue property<br />

1 - Auto<br />

The camera controls the hue level by itself continuously<br />

2 - One push<br />

The camera sets the optimal hue level by itself and returns to the manual mode<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.HueControl [= Value]<br />

[C/C++]<br />

HRESULT get_HueControl( short *pHueControl );<br />

HRESULT put_HueControl( short HueControl );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pHueControl [out, retval]<br />

Pointer to the current hue control mode<br />

HueControl [in]<br />

The hue control mode to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The hue control is not available for the selected camera<br />

Example<br />

The following VB example demonstrates the use of a checkbox to switch between the manual and<br />

automatic hue control.<br />

Private Sub Check1_Click()<br />

If Check1.Value = 1 Then<br />

<strong>AVT</strong><strong>Active</strong>Cam1.HueControl = 1<br />

Else<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

107


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.HueControl = 0<br />

End If<br />

End Sub<br />

Remarks<br />

The property is available only if the currently selected camera supports automatic hue control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

108


<strong>Active</strong>X Reference<br />

LUTMode<br />

Description<br />

Enables/disables the lookup table operation on the video frames. The operation transforms the value<br />

of each pixel based on a corresponding factor in the LUT array.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.LUTMode [= Value]<br />

[C/C++]<br />

HRESULT get_LUTMode ( short *pLUT );<br />

HRESULT put_LUTMode( short LUT );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pLUT [out,retval]<br />

Pointer to the Integer that is 1 if the lookup table operation is enable, or 0 otherwise<br />

LUT [in]<br />

Set to 1 to enable the lookup table operation, or set to 0 to disable it.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example enables the Window/Level operation and sets the minimum and maximum<br />

levels for the histogram scaling to 20% and 70% :<br />

<strong>AVT</strong><strong>Active</strong>Cam1.LUTMode = 1<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetLevels 20, 70<br />

Remarks<br />

This property works in combination with the SetLUT, SetGains and SetLevels methods.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

109


<strong>Active</strong>X Reference<br />

Magnification<br />

Description<br />

Returns or sets the zoom factor for the live video display. The zero value will fit the image to the size of<br />

the control window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Magnification [= Value]<br />

[C/C++]<br />

HRESULT get_Magnification( float *pMagnification );<br />

HRESULT put_Magnification( float Magnification );<br />

Data Type [VB]<br />

Float<br />

Parameters [C/C++]<br />

pMagnification [out,retval]<br />

Pointer to the current zoom factor<br />

Magnification [in]<br />

The zoom factor to be set.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example sets the zoom factor to 0.25:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Magnification = 0.25<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.Magnification<br />

Remarks<br />

This property adjusts the magnification of the life video display. It does not change the content of the<br />

image data, but only its appearance in the <strong>AVT</strong><strong>Active</strong>Cam control window. The valid property values<br />

are from 0 to 100. If the Magnification property is set to zero, the video image will be fit to the size of<br />

the control window. In this case the display might not retain the original proportions of the video frame.<br />

Note that the Acquire and Display properties must be set to TRUE in order for the live video to be<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

110


<strong>Active</strong>X Reference<br />

displayed in the control window.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

111


<strong>Active</strong>X Reference<br />

Mode<br />

Description<br />

Returns or sets the index of the currently selected video mode.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Mode [= Value]<br />

[C/C++]<br />

HRESULT get_Mode( long *pMode );<br />

HRESULT put_Mode( long Mode );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pMode [out,retval]<br />

Pointer to the mode's index<br />

Mode [in]<br />

The index of the mode to be selected<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

The index is out of range<br />

Example<br />

This VB example initializes a combo box with the descriptions of available video modes and uses it to<br />

select a specific mode:<br />

Private Sub Form_Load()<br />

ModeLst = <strong>AVT</strong><strong>Active</strong>Cam1.GetModeList<br />

For i = 0 To UBound(ModeLst)<br />

Combo1.AddItem (ModeLst(i))<br />

Next<br />

Combo1.ListIndex = 0<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

End Sub<br />

Private Sub Combo1_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Mode = Combo1.ListIndex<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

112


<strong>Active</strong>X Reference<br />

End Sub<br />

Remarks<br />

The value of the property is a zero-based index into the list of video modes supported by the currently<br />

selected Camera. The list of modes can be retrieved with GetModeList. If you use the property window<br />

of your development environment or <strong>AVT</strong><strong>Active</strong>Cam's property pages, the Mode property field will be<br />

presented as a list box containing all supported video modes. The mode list is built in the accending<br />

order by browsing through all formats and modes supported by the current camera. For example, the<br />

followings video modes are available for Marlin F145B:<br />

#0 640x480 Mono (8)<br />

#1 640x480 Mono (16)<br />

#2 800x600 Mono (8)<br />

#3 1024x768 Mono (8)<br />

#4 800x600 Mono (16)<br />

#5 1024x768 Mono (16)<br />

#6 1280x960 Mono (8)<br />

#7 1280x960 Mono (16)<br />

#8 1392x1040 Mono (8) Format_7 M0<br />

#9 1392x1040 Mono (16) Format_7 M0<br />

#10 696x1040 Mono (8) Format_7 M1<br />

#11 696x1040 Mono (16) Format_7 M1<br />

#12 1392x520 Mono (8) Format_7 M2<br />

#13 1392x520 Mono (16) Format_7 M2<br />

#14 696x520 Mono (8) Format_7 M3<br />

#15 696x520 Mono (16) Format_7 M3<br />

Those modes referred as "Format_7" are partial scan modes that typically allow for selection of userdefined<br />

frame size (SizeX, SizeY) and PacketSize. Each partial scan mode retains the frame size and<br />

packet size which were previously selected for it. However, selecting the same partial scan mode twice<br />

will reset its parameters to maximum values, thus providing the highest resolution and frame rate<br />

available for the mode.<br />

For more information refer to "IIDC 1394-based Digital Camera Specification, Version 1.30" published<br />

by the 1394 Trade Association.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

113


<strong>Active</strong>X Reference<br />

MonitorSync<br />

Description<br />

Enables/disables the monitor synchronization feature for the live video display in the control window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.MonitorSync [= Value]<br />

[C/C++]<br />

HRESULT get_MonitorSync ( bool *pValue );<br />

HRESULT put_MonitorSync( bool Value );<br />

Data Type [VB]<br />

Boolean<br />

Parameters [C/C++]<br />

pValue [out,retval]<br />

Pointer to the Boolean that is TRUE if the monitor synchronization is enable, or FALSE otherwise<br />

Value [in]<br />

Set to TRUE to enable the monitor synchronization, or set to FALSE to disable it<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example enables the monitor synchronization:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.MonitorSync = True<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.MonitorSync<br />

Remarks<br />

Enabling the monitor synchronization option causes the camera frame rate to exactly match the current<br />

refresh rate of the system monitor thus eleminating all the display artifacts related to the digital image<br />

transfer, such as the display tearing and syncopation. The monitor synchronization algorithm uses a<br />

patent-pending technique from A&B Software. Fore more details refer to<br />

Software overcomes display artifacts in digital image transfer.<br />

Note that this property will be unavailable if the camera does not support the software trigger.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

114


<strong>Active</strong>X Reference<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

115


<strong>Active</strong>X Reference<br />

Overlay<br />

Description<br />

Enables/disables the overlay.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Overlay [= Value]<br />

[C/C++]<br />

HRESULT get_Overlay ( bool *pOverlay );<br />

HRESULT put_Overlay( bool Overlay );<br />

Data Type [VB]<br />

Boolean<br />

Parameters [C/C++]<br />

pOverlay [out,retval]<br />

Pointer to the Boolean that is TRUE if the overlay is enabled, or FALSE otherwise<br />

Overlay [in]<br />

Set to TRUE to enable the overlay, or set to FALSE to disable it.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example overlays a red circle on the live video:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayEllipse 100,100,200,200<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayColor=RGB(255,0,0)<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Overlay= True<br />

Remarks<br />

Overlay feature allows you to display custom graphics and text on the live video image. Setting this<br />

property to true causes <strong>AVT</strong><strong>Active</strong>Cam to show the overlay. Disabling this property hides the overlay.<br />

Note that hiding the overlay does not erase graphics and text from it. To clear the overlay, use<br />

OverlayClear. Also see OverlayColor, OverlayPixel, OverlayLine, OverlayRectangle, OverlayEllipse,<br />

OverlayText.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

116


<strong>Active</strong>X Reference<br />

OverlayColor<br />

Description<br />

Returns or sets the color of the overlay graphics.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.OverlayColor [= Color]<br />

[C/C++]<br />

HRESULT get_OverlayColor(OLE_COLOR& pColor);<br />

HRESULT put_OverlayColor(OLE_COLOR Color);<br />

Data Type [VB]<br />

RGB color<br />

Parameters [C/C++]<br />

pColor [out,retval]<br />

Pointer to the current overlay color<br />

Color [in]<br />

The overlay color to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example overlays a red circle on the live video:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayEllipse 100,100,200,200<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayColor=RGB(255,0,0)<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Overlay= True<br />

Remarks<br />

Overlay feature allows you to display custom graphics and text on the live video image. Also see<br />

OverlayColor, OverlayPixel, OverlayLine, OverlayRectangle, OverlayEllipse, OverlayText.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

117


<strong>Active</strong>X Reference<br />

OverlayFont<br />

Description<br />

Returns or sets the font for OverlayText.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.OverlayFont [= Font]<br />

[C/C++]<br />

HRESULT get_OverlayFont(IFontDisp* *pFont);<br />

HRESULT put_OverlayFont(IFontDisp* Font);<br />

Data Type [VB]<br />

StdFont<br />

Parameters [C/C++]<br />

pFont [out,retval]<br />

Pointer to the IFontDisp interface object corresponding to the current overlay font<br />

Font [in]<br />

IFontDisp interface object corresponding to the overlay font to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example overlays a string of text on the live video:<br />

Dim Font As New StdFont<br />

Font.Name = "Arial"<br />

Font.Size = 18<br />

Font.Bold = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayFont = Font<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayText 10, 100, "<strong>AVT</strong><strong>Active</strong>Cam rules!"<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayColor = RGB(255, 0, 0)<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Overlay = True<br />

Remarks<br />

Also see OverlayColor, OverlayText.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

118


<strong>Active</strong>X Reference<br />

PacketSize<br />

Description<br />

Returns or sets the number of bytes in an isochronous packet<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.PacketSize [= Value]<br />

[C/C++]<br />

HRESULT get_PAcketSize( long *pPacketSize );<br />

HRESULT put_PacketSize( long PacketSize );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pPacketSize [out,retval]<br />

Pointer to the current packet size<br />

pPacketSize [in]<br />

The packet size to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example sets the current packet size to 4096 bytes:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.PacketSize = 4096<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.PacketSize<br />

Remarks<br />

This property is available only for partial scan (Format 7) Modes and related but not necessarily<br />

indicative of the effective frame rate. Only certain values of the packet size can be allowed depending<br />

on the camera. If the property is set to a value which is not supported by the camera, it will be reset to<br />

the nearest allowable packet size.<br />

Note - <strong>AVT</strong><strong>Active</strong>Cam supports large packet sizes which exceed 8192 bytes specified by the 1394<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

119


<strong>Active</strong>X Reference<br />

standard. This provides full compatibility with high speed dual-packet 1394b cameras such as the Pike<br />

cameras. For more information refer to "IIDC 1394-based Digital Camera Specification, Version 1.31"<br />

published by the 1394 Trade Association.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

120


<strong>Active</strong>X Reference<br />

Palette<br />

Description<br />

Returns or sets the ordinal number of the currently selected live video palette. The values from 0 to 7<br />

correspond to the following predefined palettes:<br />

0 - Gray<br />

Applies the standard 256-level grayscale palette. This is a regular mode of viewing a grayscale<br />

video.<br />

1 - Inverse<br />

Applies the inverted 256-level grayscale palette. The video will be displayed in the negative<br />

format.<br />

2 - Saturated<br />

Applies the grayscale palette with colorized upper entries. The saturated palette allows you to<br />

control the dynamic range of the video signal by bringing it slightly below the saturation level of<br />

the video camera or video amplifier. To achieve the maximum dynamic range, adjust the<br />

intensity of the light source and/or the gain and zero level of the video amplifier so that the red<br />

color corresponding to the brightest pixel values just barely shows up.<br />

3 - Rainbow<br />

Applies a color palette where the entries are evenly distributed along the Hue axis. This allows<br />

for assigning different color pigments to different levels of intensity.<br />

4 - Spectra<br />

Applies a color palette where the entries are distributed along the Hue and Luminance axes.<br />

That allows for assigning different color pigments to different levels of intensity while<br />

preserving the luminance scale.<br />

5 - Isodense<br />

Applies the 256-level grayscale palette, each 8-th entry of which is colorized. The isodense<br />

palette allows you to clearly see transitions between different levels of intensities as isolines on<br />

a topographic map.<br />

6 - Multiphase<br />

Applies the multiphase palette. Entries in the multiphase palette are at opposite ends of the<br />

color model so even small changes in gray levels are highlighted.<br />

7 - Random<br />

Applies the random color palette whose entries are filled with random values each time you<br />

select it from the menu.<br />

8 - Threshold<br />

Applies the grayscale palette with colorized luminance range of interest. Works in combination<br />

with SetROI.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Palette [= Value]<br />

[C/C++]<br />

HRESULT get_Palette( long *pPalette );<br />

HRESULT put_Palette( long Palette );<br />

Data Type [VB]<br />

Long<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

121


<strong>Active</strong>X Reference<br />

Parameters [C/C++]<br />

pPalette [out,retval]<br />

Pointer to the ordinal number of the currently selected palette<br />

Palette [in]<br />

The number of the palette to be selected<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example demonstrates the use of a combo box for changing display palettes on the live video:<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

Combo1.AddItem ("Gray")<br />

Combo1.AddItem ("Inverse")<br />

Combo1.AddItem ("Saturated")<br />

Combo1.AddItem ("Rainbow")<br />

Combo1.AddItem ("Spectra")<br />

Combo1.AddItem ("Isodense")<br />

Combo1.AddItem ("Multiphase")<br />

Combo1.AddItem ("Random")<br />

Combo1.ListIndex = 0<br />

End Sub<br />

Private Sub Combo1_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Palette = Combo1.ListIndex<br />

End Sub<br />

Remarks<br />

The Palette property is used for viewing monochrome video in pseudo-colors. The property is only<br />

valid for a monochrome Mode. If you use property pages in your development environment, the<br />

Palette property field will be presented as a list box containing the names of all available palettes.<br />

Note that the Acquire and Display properties must be set to TRUE in order for the live video to be<br />

displayed in the control window.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

122


<strong>Active</strong>X Reference<br />

Rate<br />

Description<br />

Returns or sets the current frame rate.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Rate [= Value]<br />

[C/C++]<br />

HRESULT get_Rate( long *pRate );<br />

HRESULT put_Rate( long Rate );<br />

Data Type [VB]<br />

Float<br />

Parameters [C/C++]<br />

pRate [out,retval]<br />

Pointer to the frame rate value<br />

Rate [in]<br />

The value of the frame rate<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

This VB example sets the current frame rate to 15 fps:<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Rate = 15.<br />

End Sub<br />

Remarks<br />

IIDC-compliant cameras support the following predefined frame rates: 1.875 fps, 3.75 fps, 7.5 fps, 15<br />

fps, 30 fps, 60 fps and 120 fps. Additional frame rates can be provided by the camera manufacturer. A<br />

certain video Mode can only support certain frame rates. The list of rates available for the current video<br />

mode can be retrieved with GetRateList. If you use the property window of your development<br />

environment or <strong>AVT</strong><strong>Active</strong>Cam's property pages, the Rate property field will be presented as a list box<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

123


<strong>Active</strong>X Reference<br />

containing all supported frame rates. If the property is set to a value which is not supported by the<br />

current mode, it will be reset to the nearest allowable frame rate.<br />

Note that the Rate property is available only for the fixed video mode. If the current video mode is a<br />

partial scan one (Format 7), use PacketSize to modify the effective frame rate. For more information<br />

refer to "IIDC 1394-based Digital Camera Specification, Version 1.31" published by the 1394 Trade<br />

Association.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

124


<strong>Active</strong>X Reference<br />

Rotate<br />

Description<br />

Rotates the image at the specified angle. The following angle values are allowed:<br />

Syntax<br />

0 - No image rotation is performed<br />

90 - The image is rotated 90° counterclockwise<br />

180 - The image is rotated 180°<br />

270 - The image is rotated -90° clockwise<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Rotate [= Value]<br />

[C/C++]<br />

HRESULT get_Rotate( long *pRotate );<br />

HRESULT put_Rotate( long Rotate );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pRotate [out,retval]<br />

Pointer to the rotational angle.<br />

Rotate [in]<br />

The rotational angle to be set.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example demonstrates the use of a combo box for rotating the live video:<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

Combo1.AddItem ("0°")<br />

Combo1.AddItem ("90°")<br />

Combo1.AddItem ("180°")<br />

Combo1.AddItem ("270°")<br />

Combo1.ListIndex = 0<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

125


<strong>Active</strong>X Reference<br />

Private Sub Combo1_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Rotate = Combo1.ListIndex<br />

End Sub<br />

Remarks<br />

Image rotation affects the way the video is displayed in the control window as well as actual order of<br />

pixels in the image frame. If the rotation angle is different from zero, the data returned by<br />

GetImageData and other data access methods will be rotated as well.<br />

Note that the Flip operation has precedence over rotation. If both Flip and Rotate properties are nonzero,<br />

the frame will be flipped first and the resulting image rotated.<br />

If the value of the angle is different from 0, 90, 180 and 270, it will be substituted with the nearest<br />

allowable value.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

126


<strong>Active</strong>X Reference<br />

Saturation<br />

Description<br />

Returns or sets the row value of the color saturation<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Saturation [= Value]<br />

[C/C++]<br />

HRESULT get_Saturation( long *pSaturation );<br />

HRESULT put_Saturation( long Saturation );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pSaturation [out,retval]<br />

Pointer to the current saturation value<br />

Saturation [in]<br />

The saturation value to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The saturation control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following VB example demonstrates the use of a scroll control for real-time adjustment of the<br />

camera's saturation.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Saturation<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetSaturationMin<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetSaturationMax<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Saturation = HScroll1.Value<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

127


<strong>Active</strong>X Reference<br />

Remarks<br />

This property changes the color depth of the video. The valid property range is reported by the<br />

GetSaturationMin and GetSaturationMax methods. Note that the property is available only if the<br />

currently selected camera is a color one and supports software saturation control.<br />

If the state of the advanced feature for color correction (Register 0xF10003A0) is "enabled", which is<br />

the default for <strong>AVT</strong> cameras, high values for the saturation may lead to false colors.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

128


<strong>Active</strong>X Reference<br />

SaturationControl<br />

Description<br />

Returns or sets the saturation control mode. The values from -1 to 2 correspond to the following<br />

modes:<br />

-1 - Off<br />

The saturation control is disabled<br />

0 - Manual<br />

The saturation level is controlled by the value of the Saturation property<br />

1 - Auto<br />

The camera controls the saturation level by itself continuously<br />

2 - One push<br />

The camera sets the optimal saturation level by itself and returns to the manual mode<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SaturationControl [= Value]<br />

[C/C++]<br />

HRESULT get_SaturationControl( short *pSaturationControl );<br />

HRESULT put_SaturationControl( short SaturationControl );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pSaturationControl [out, retval]<br />

Pointer to the current saturation control mode<br />

SaturationControl [in]<br />

The saturation control mode to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The saturation control is not available for the selected camera<br />

Example<br />

The following VB example demonstrates the use of a checkbox to switch between the manual and<br />

automatic saturation control.<br />

Private Sub Check1_Click()<br />

If Check1.Value = 1 Then<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SaturationControl = 1<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

129


<strong>Active</strong>X Reference<br />

Else<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SaturationControl = 0<br />

End If<br />

End Sub<br />

Remarks<br />

The property is available only if the currently selected camera supports automatic saturation control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

130


<strong>Active</strong>X Reference<br />

ScrollBars<br />

Description<br />

Enables/disables the scroll bars on the control window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.ScrollBars [= Value]<br />

[C/C++]<br />

HRESULT get_ScrollBars ( bool *pScrollBars );<br />

HRESULT put_ScrollBars( bool ScrollBars );<br />

Data Type [VB]<br />

Boolean<br />

Parameters [C/C++]<br />

pScrollBars [out,retval]<br />

Pointer to the Boolean that is TRUE if the scroll bars are enable, or FALSE otherwise<br />

ScrollBars [in]<br />

Set to TRUE to enable the scroll bars, or set to FALSE otherwise<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example enables scroll bars on the control window:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.ScrollBars = True<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.ScrollBars<br />

Remarks<br />

If this property is set to TRUE and the video width or/and height (see SizeX and SizeY) exceed the size<br />

of the control window, a scroll bar(s) will be displayed on the border of the control window allowing you<br />

to pan the live video. The current position of scroll bars can be retrieved or modified via the ScrollX and<br />

ScrollY properties. When the scroll bars are moved, the Scroll event will be raised.<br />

Note that the Acquire and Display properties must be set to TRUE in order for the live video to be<br />

displayed in the control window.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

131


<strong>Active</strong>X Reference<br />

ScrollX<br />

Description<br />

Returns or sets the current horizontal scroll position for the live video display.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.ScrollX [= Value]<br />

[C/C++]<br />

HRESULT get_ScrollX( long *pScrollX );<br />

HRESULT put_ScrollX( long ScrollX );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pScrollX [out,retval]<br />

Pointer to the current horizontal scroll position.<br />

ScrollX [in]<br />

The horizontal scroll position to be set.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example sets the current horizontal scroll position to 512:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.ScrollX = 512<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.ScrollX<br />

Remarks<br />

The ScrollX property is only valid if the ScrollBars are present in the control window.<br />

Note that the value returned by this property refers to the image coordinate system, not to the screen<br />

coordinates.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

132


<strong>Active</strong>X Reference<br />

ScrollY<br />

Description<br />

Returns or sets the current vertical scroll position for the live video display.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.ScrollY [= Value]<br />

[C/C++]<br />

HRESULT get_ScrollY( long *pScrollY );<br />

HRESULT put_ScrollY( long ScrollY );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pScrollY [out,retval]<br />

Pointer to the current vertical scroll position.<br />

ScrollY [in]<br />

The vertical scroll position to be set.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example sets the current vertical scroll position to 512:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.ScrollY = 512<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.ScrollY<br />

Remarks<br />

The ScrollY property is only valid if the ScrollBars are present in the control window.<br />

Note that the value returned by this property refers to the image coordinate system, not to the screen<br />

coordinates.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

133


<strong>Active</strong>X Reference<br />

Sharpness<br />

Description<br />

Returns or sets the row value of the sharpness<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Sharpness [= Value]<br />

[C/C++]<br />

HRESULT get_Sharpness( long *pSharpness );<br />

HRESULT put_Sharpness( long Sharpness );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pSharpness [out,retval]<br />

Pointer to the current sharpness value<br />

Sharpness [in]<br />

The sharpness value to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The sharpness control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following VB example demonstrates the use of a scroll control for real-time adjustment of the<br />

sharpness value.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Sharpness<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetSharpnessMin<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetSharpnessMax<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Sharpness = HScroll1.Value<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

134


<strong>Active</strong>X Reference<br />

Remarks<br />

This property changes the sharpness of the video by modifying parameters of the camera's differential<br />

circuitry. The valid property range is reported by the GetSharpnessMin and GetSharpnessMax<br />

methods. Note that the property is available only if the currently selected camera supports software<br />

sharpness control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

135


<strong>Active</strong>X Reference<br />

SharpnessControl<br />

Description<br />

Returns or sets the sharpness control mode. The values from -1 to 2 correspond to the following<br />

modes:<br />

-1 - Off<br />

The sharpness control is disabled<br />

0 - Manual<br />

The sharpness level is controlled by the value of the Sharpness property<br />

1 - Auto<br />

The camera controls the sharpness level by itself continuously<br />

2 - One push<br />

The camera sets the optimal sharpness level by itself and returns to the manual mode<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SharpnessControl [= Value]<br />

[C/C++]<br />

HRESULT get_SharpnessControl( short *pSharpnessControl );<br />

HRESULT put_SharpnessControl( short SharpnessControl );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pSharpnessControl [out, retval]<br />

Pointer to the current sharpness control mode<br />

SharpnessControl [in]<br />

The sharpness control mode to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The sharpness control is not available for the selected camera<br />

Example<br />

The following VB example demonstrates the use of a checkbox to switch between the manual and<br />

automatic sharpness control.<br />

Private Sub Check1_Click()<br />

If Check1.Value = 1 Then<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SharpnessControl = 1<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

136


<strong>Active</strong>X Reference<br />

Else<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SharpnessControl = 0<br />

End If<br />

End Sub<br />

Remarks<br />

The property is available only if the currently selected camera supports automatic sharpness control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

137


<strong>Active</strong>X Reference<br />

Shutter<br />

Description<br />

Returns or sets the row value of the shutter<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Shutter [= Value]<br />

[C/C++]<br />

HRESULT get_Shutter( long *pShutter );<br />

HRESULT put_Shutter( long Shutter );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pShutter [out,retval]<br />

Pointer to the current shutter value<br />

Shutter [in]<br />

The shutter value to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The shutter control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following VB example demonstrates the use of a scroll control for real-time adjustment of the<br />

camera's shutter.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Shutter<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetShutterMin<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetShutterMax<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Shutter = HScroll1.Value<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

138


<strong>Active</strong>X Reference<br />

Remarks<br />

This property changes the integration time of the camera's sensor to a sub-value of the frame period.<br />

The valid property range is reported by the GetShutterMin and GetShutterMax methods.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

139


<strong>Active</strong>X Reference<br />

ShutterControl<br />

Description<br />

Returns or sets the shutter control mode. The values from -1 to 2 correspond to the following modes:<br />

-1 - Off<br />

The shutter control is disabled<br />

0 - Manual<br />

The shutter level is controlled by the value of the Shutter property<br />

1 - Auto<br />

The camera controls the shutter level by itself continuously<br />

2 - One push<br />

The camera sets the optimal shutter level by itself and returns to the manual mode<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.ShutterControl [= Value]<br />

[C/C++]<br />

HRESULT get_ShutterControl( short *pShutterControl );<br />

HRESULT put_ShutterControl( short ShutterControl );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pShutterControl [out, retval]<br />

Pointer to the current shutter control mode<br />

ShutterControl [in]<br />

The shutter control mode to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The shutter control is not available for the selected camera<br />

Example<br />

The following VB example demonstrates the use of a checkbox to switch between the manual and<br />

automatic shutter control.<br />

Private Sub Check1_Click()<br />

If Check1.Value = 1 Then<br />

<strong>AVT</strong><strong>Active</strong>Cam1.ShutterControl = 1<br />

Else<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

140


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.ShutterControl = 0<br />

End If<br />

End Sub<br />

Remarks<br />

The property is available only if the currently selected camera supports automatic shutter control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

141


<strong>Active</strong>X Reference<br />

SizeX<br />

Description<br />

Returns or sets the width of the partial scan window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SizeX [= Value]<br />

[C/C++]<br />

HRESULT get_SizeX( long *pSizeX );<br />

HRESULT put_SizeX( long SizeX );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pSizeX [out,retval]<br />

Pointer to the currently selected image width<br />

SizeX [in]<br />

The image width to be selected<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example sets the current image width to 512:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SizeX = 512<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.SizeX<br />

Remarks<br />

Modification of the size of the video frame is available only for partial scan (Format 7) Modes. Only<br />

certain values of the width can be allowed for the partial scan window depending on the camera. If the<br />

property is set to a value which is not supported by the camera, it will be reset to the nearest allowable<br />

width.<br />

If the currently selected video mode represents a fixed format, the SizeX property will be readonly and<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

142


<strong>Active</strong>X Reference<br />

will return the same value as GetWidth.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

143


<strong>Active</strong>X Reference<br />

SizeY<br />

Description<br />

Returns or sets the height of the partial scan window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SizeY [= Value]<br />

[C/C++]<br />

HRESULT get_SizeY( long *pSizeY );<br />

HRESULT put_SizeY( long SizeY );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pSizeY [out,retval]<br />

Pointer to the currently selected image height<br />

SizeY [in]<br />

The image height to be selected<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example sets the current image height to 512:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SizeY = 512<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.SizeY<br />

Remarks<br />

Modification of the size of the video frame is available only for partial scan (Format 7) Modes. Only<br />

certain values of the height can be allowed for the partial scan window depending on the camera. If the<br />

property is set to a value which is not supported by the camera, it will be reset to the nearest allowable<br />

height.<br />

If the currently selected video mode represents a fixed format, the SizeY property will be readonly and<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

144


<strong>Active</strong>X Reference<br />

will return the same value as GetHeight.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

145


<strong>Active</strong>X Reference<br />

StartX<br />

Description<br />

Returns or sets the horizontal offset of the partial scan window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.StartX [= Value]<br />

[C/C++]<br />

HRESULT get_StartX( long *pStartX );<br />

HRESULT put_StartX( long StartX );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pStartX [out,retval]<br />

Pointer to the currently set horizontal offset<br />

SizeX [in]<br />

The horizontal ofset to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example sets the horizontal offset of the video window to 64:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.StartX = 64<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.StartX<br />

Remarks<br />

This property is available only for partial scan (Format 7) Modes and allows you to set the horizontal<br />

offset of the top left corner of the scan window in pixels. Only certain values StartX can be allowed<br />

depending on the camera. If the property is set to a value which is not supported by the camera, it will<br />

be reset to the nearest allowable one.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

146


<strong>Active</strong>X Reference<br />

StartY<br />

Description<br />

Returns or sets the vertical offset of the partial scan window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.StartY [= Value]<br />

[C/C++]<br />

HRESULT get_StartY( long *pStartY );<br />

HRESULT put_StartY( long StartY );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pStartY [out,retval]<br />

Pointer to the currently set vertical offset<br />

StartY [in]<br />

The vertical offset to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example sets the vertical ofset of the video window to 64 pixels:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.StartY = 64<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.StartY<br />

Remarks<br />

This property is available only for partial scan (Format 7) Modes and allows you to set the vertical<br />

offset of the top left corner of the scan window in pixels. Only certain values StartY can be allowed<br />

depending on the camera. If the property is set to a value which is not supported by the camera, it will<br />

be reset to the nearest allowable one.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

147


<strong>Active</strong>X Reference<br />

SwapBytes<br />

Description<br />

Enables/disables swapping of bytes for 16- and 48-bit video modes.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SwapBytes [= Value]<br />

[C/C++]<br />

HRESULT get_SwapBytes ( bool *pSwapBytes );<br />

HRESULT put_SwapBytes( bool SwapBytes );<br />

Data Type [VB]<br />

Boolean<br />

Parameters [C/C++]<br />

pSwapBytes [out,retval]<br />

Pointer to the Boolean that is TRUE if the byte swap is enabled, or FALSE otherwise<br />

SwapBytes [in]<br />

Set to TRUE to enable the byte swap mode, or set to FALSE otherwise<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example activates the byte swap mode:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SwapBytes = True<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.SwapBytes<br />

Remarks<br />

This property defines the way in which 16-bit pixels are arranged in <strong>AVT</strong><strong>Active</strong>Cam image buffer. If<br />

SwapBytes is set to FALSE, the bytes in each pixel will maintain the order in which they are delivered<br />

by the camera. Some cameras however can render the most significan bits of each pixel in the highorder<br />

bytes and the least significant bits in the low-order bytes. If this happens, the live image will<br />

appear scrambled. Setting SwapBytes to TRUE will activate a real-time swap of bytes in incoming<br />

camera frames and restore original pixel values.<br />

Note that this property is availalbe only in 16- and 48-bit video Modes.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

148


<strong>Active</strong>X Reference<br />

Timeout<br />

Description<br />

Returns or sets the current acquisition timeout in seconds.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Timeout [= Value]<br />

[C/C++]<br />

HRESULT get_Timeout( long *pTimeout );<br />

HRESULT put_Timeout( long Timeout );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pTimeout [out,retval]<br />

Pointer to the currently set timeout.<br />

Timeout [in]<br />

The timeout to be set.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example sets the current timeout to 10 sec:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Timeout = 10<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.Timeout<br />

Remarks<br />

The Timeout property lets you set the number of seconds to wait for a frame to be acquired. Typically<br />

used to assign the timeout when the Trigger mode is active. If the timeout expires, the Timeout event<br />

will be raised.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

149


<strong>Active</strong>X Reference<br />

Trigger<br />

Description<br />

Enables/disables the hardware trigger.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Trigger [= Value]<br />

[C/C++]<br />

HRESULT get_Trigger ( bool *pTrigger );<br />

HRESULT put_Trigger( bool Trigger );<br />

Data Type [VB]<br />

Boolean<br />

Parameters [C/C++]<br />

pTrigger [out,retval]<br />

Pointer to the Boolean that is TRUE if the trigger mode is enabled, or FALSE otherwise<br />

Trigger [in]<br />

Set to TRUE to enable the trigger mode, or set to FALSE otherwise<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example activates the trigger mode:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Trigger = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

Remarks<br />

The hardware trigger is typically used with an asynchronously resetable camera. When the Trigger<br />

property is enalbed, the acquisition of a frame will occur upon receiving a signal from an external<br />

hardware trigger. Aslo see TriggerMode and TriggerPolarity.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

150


<strong>Active</strong>X Reference<br />

TriggerCounter<br />

Description<br />

Returns or sets the trigger counter parameter for trigger operations. See TriggerMode for more details.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.TriggerCounter [= Value]<br />

[C/C++]<br />

HRESULT get_TriggerCounter( long *pTriggerCounter );<br />

HRESULT put_TriggerCounter( long TriggerCounter );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pTriggerCounter [out,retval]<br />

Pointer to a positive integer specifying the trigger counter<br />

TriggerCounter [in]<br />

Value of the trigger counter<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example sets the trigger counter to 16<br />

<strong>AVT</strong><strong>Active</strong>Cam1.TriggerCounter = 16<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.TriggerCounter<br />

Remarks<br />

For more information on the IIDC trigger modes refer to "IIDC 1394-based Digital Camera<br />

Specification, Version 1.31" published by the 1394 Trade Association.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

151


<strong>Active</strong>X Reference<br />

TriggerDelay<br />

Description<br />

Returns or sets the raw value of the trigger delay.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.TriggerDelay [= Value]<br />

[C/C++]<br />

HRESULT get_TriggerDelay( long *pTriggerDelay );<br />

HRESULT put_TriggerDelay( long TriggerDelay );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pTriggerDelay [out,retval]<br />

Pointer to the current trigger delay value<br />

TriggerDelay [in]<br />

The trigger delay value to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The trigger delay control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following VB example demonstrates the use of a scroll control for real-time adjustment of the<br />

trigger delay value.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.TriggerDelay<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetTriggerDelayMin<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetTriggerDelayMax<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.TriggerDelay = HScroll1.Value<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

152


<strong>Active</strong>X Reference<br />

Remarks<br />

This property changes the trigger delay which defines the time between the arrival of the trigger signal<br />

and acquisition of the frame.<br />

The valid property range is reported by the GetTriggerDelayMin and GetTriggerDelayMax methods.<br />

Note that the property is available only if the currently selected camera supports software trigger delay<br />

control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

153


<strong>Active</strong>X Reference<br />

TriggerMode<br />

Description<br />

Returns or sets the trigger mode as defined by IIDC 1.31 specifications. The values 0 - 5 and 14 - 15<br />

correspond to the following modes (the TriggerPolarity is assumed to be set to Low <strong>Active</strong>):<br />

0 - Mode 0<br />

Camera starts integration of the incoming light from the external trigger input falling edge.<br />

Integration time is defined by the Shutter option.<br />

1 - Mode 1<br />

Camera starts integration of the incoming light from the external trigger input falling edge.<br />

Integration time is equal to low state time of the external trigger input.<br />

15 - Programmable Mode<br />

The trigger input starts a series of images, be it asynchronously or with a MultiShot. Refer to<br />

the camera documentation for details.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.TriggerMode [= Value]<br />

[C/C++]<br />

HRESULT get_TriggerMode( long *pTriggerMode );<br />

HRESULT put_TriggerMode( long TriggerMode );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pTriggerMode [out,retval]<br />

Pointer to the ordinal number of the currently selected palette<br />

TriggerMode [in]<br />

The number of the palette to be selected<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid property value.<br />

Example<br />

This VB example sets Mode 1 for the trigger input operation.<br />

<strong>AVT</strong><strong>Active</strong>Cam1.TriggerMode = 1<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

154


<strong>Active</strong>X Reference<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.TriggerMode<br />

Remarks<br />

For more information on the IIDC trigger modes refer to "IIDC 1394-based Digital Camera<br />

Specification, Version 1.31" published by the 1394 Trade Association.<br />

Note that only certain trigger modes are available for a specific camera. To retrieve the list of available<br />

trigger modes use GetTriggerInfo.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

155


<strong>Active</strong>X Reference<br />

TriggerPolarity<br />

Description<br />

Returns or sets the polarity of the hardware trigger input.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.TriggerPolarity [= Value]<br />

[C/C++]<br />

HRESULT get_TriggerPolarity ( bool *pTriggerPolarity );<br />

HRESULT put_TriggerPolarity( bool TriggerPolarity );<br />

Data Type [VB]<br />

Boolean<br />

Parameters [C/C++]<br />

pTriggerPolarity [out,retval]<br />

Pointer to the Boolean that is TRUE if the high active trigger input, or FALSE otherwise<br />

TriggerPolarity [in]<br />

Set to TRUE to enable the high active trigger input, or set to FALSE for the low active input<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example sets the trigger input to the high active polarity:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.TriggerPolarity = True<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.TriggerPolarity<br />

Remarks<br />

When the trigger input is set to the low active polarity, the acquisition of the frame will occur upon a<br />

drop of the voltage on the trigger input. For the high active input, the acquisition will occur upon a raise<br />

of the voltage.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

156


<strong>Active</strong>X Reference<br />

WhiteBalanceControl<br />

Description<br />

Returns or sets the white balance control mode. The values from -1 to 2 correspond to the following<br />

modes:<br />

-1 - Off<br />

The white balance control is disabled<br />

0 - Manual<br />

The white balance levels is controlled by the values of the WhiteBalanceUB and<br />

WhiteBalanceVR properties<br />

1 - Auto<br />

The camera controls the white balance levels by itself continuously<br />

2 - One push<br />

The camera sets the optimal white balance levels by itself and returns to the manual mode<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.WhiteBalanceControl [= Value]<br />

[C/C++]<br />

HRESULT get_WhiteBalanceControl( short *pWhiteBalanceControl );<br />

HRESULT put_WhiteBalanceControl( short WhiteBalanceControl );<br />

Data Type [VB]<br />

Integer<br />

Parameters [C/C++]<br />

pWhiteBalanceControl [out, retval]<br />

Pointer to the current white balance control mode<br />

WhiteBalanceControl [in]<br />

The white balance control mode to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The white balance control is not available for the selected camera<br />

Example<br />

The following VB example demonstrates the use of a checkbox to switch between the manual and<br />

automatic white balance control.<br />

Private Sub Check1_Click()<br />

If Check1.Value = 1 Then<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

157


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceControl = 1<br />

Else<br />

<strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceControl = 0<br />

End If<br />

End Sub<br />

Remarks<br />

The property is available only if the currently selected camera supports automatic white balance<br />

control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

158


<strong>Active</strong>X Reference<br />

WhiteBalanceUB<br />

Description<br />

Returns or sets the U or B value of the white color<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.WhiteBalanceUB [= Value]<br />

[C/C++]<br />

HRESULT get_WhiteBalanceUB( long *pWhiteBalanceUB );<br />

HRESULT put_WhiteBalanceUB( long WhiteBalanceUB );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pWhiteBalanceUB [out,retval]<br />

Pointer to the current U/B value<br />

WhiteBalanceUB [in]<br />

The U/B value to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The white balance control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following Visual Basic example demonstrates the use of two scroll controls for real-time<br />

adjustment of the white balance<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceUB<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMin<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMax<br />

HScroll2.Value = <strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceVR<br />

HScroll2.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMin<br />

HScroll2.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMax<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

159


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceUB = HScroll1.Value<br />

End Sub<br />

Private Sub HScroll2_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceVR = HScroll2.Value<br />

End Sub<br />

Remarks<br />

This property changes the tint of the white color along the yellow-blue axis by modifying U component<br />

in the YUV mode or B component in the RGB mode. The valid property range is reported by the<br />

GetWhiteBalanceMin and GetWhiteBalanceMax methods. Note that the property is available only if the<br />

currently selected camera is a color one and supports white balance control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

160


<strong>Active</strong>X Reference<br />

WhiteBalanceVR<br />

Description<br />

Returns or sets the V or R value of the white color<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.WhiteBalanceVR [= Value]<br />

[C/C++]<br />

HRESULT get_WhiteBalanceVR( long *pWhiteBalanceVR );<br />

HRESULT put_WhiteBalanceVR( long WhiteBalanceVR );<br />

Data Type [VB]<br />

Long<br />

Parameters [C/C++]<br />

pWhiteBalanceVR [out,retval]<br />

Pointer to the current V/R value<br />

WhiteBalanceVR [in]<br />

The V/R value to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The white balance control is not available for the selected camera<br />

E_INVALIDARG<br />

The value is out of range<br />

Example<br />

The following Visual Basic example demonstrates the use of two scroll controls for real-time<br />

adjustment of the white balance<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceUB<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMin<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMax<br />

HScroll2.Value = <strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceVR<br />

HScroll2.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMin<br />

HScroll2.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMax<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

161


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceUB = HScroll1.Value<br />

End Sub<br />

Private Sub HScroll2_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceVR = HScroll2.Value<br />

End Sub<br />

Remarks<br />

This property changes the tint of the white color along the cyan-red axis by modifying V component in<br />

the YUV mode or R component in the RGB mode. The valid property range is reported by the<br />

GetWhiteBalanceMin and GetWhiteBalanceMax methods. Note that the property is available only if the<br />

currently selected camera is a color one and supports white balance control.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

162


<strong>Active</strong>X Reference<br />

4.2 Methods<br />

<strong>AVT</strong><strong>Active</strong>Cam control provides the following methods to a container application:<br />

DCAM Acquisition<br />

Grab Grabs a single frame into the internal memory<br />

SoftTrigger Sets/resets the software trigger signal<br />

GetIsoSpeed Returns the camera's isochronous transmission speed<br />

SetIsoSpeed Sets the camera's isochronous transmission speed<br />

DCAM Information<br />

GetCameraList Returns the list of <strong>AVT</strong> cameras connected to the 1394 board<br />

GetModeList Returns the list of video mode supported by the currently<br />

selected camera<br />

GetRateList Returns the list of frame rates supported by the currently<br />

selected video mode<br />

GetWidth Returns the maximum horizontal size of the video frame<br />

GetHeight Returns the maximum vertical size of the video frame<br />

GetBytesPerPixel Returns the number of bytes per pixel in the video<br />

GetBitsPerChannel Return the number of bits per color component of a pixel<br />

GetTriggerInfo Returns the information related to triggering<br />

GetTriggerList Returns the list of supported trigger sources<br />

GetF7Info Returns the information related to Format 7 (partial scan) video<br />

modes<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

163


<strong>Active</strong>X Reference<br />

DCAM Features<br />

GetFeature Returns the value of the specified camera feature<br />

SetFeature Sets the value of the specified camera feature<br />

GetFeatureCapability Checks for available operational modes of the specified camera<br />

feature<br />

GetFeatureControl Returns the status of the specified control mode for the selected<br />

camera feature<br />

SetFeatureControl Sets the specified control mode for the selected camera feature<br />

GetFeatureMin Returns the minimum value allowed for the specified camera<br />

feature<br />

GetFeatureMax Returns the maximum value allowed for the specified camera<br />

feature<br />

GetShutterMin Returns the minimum shutter value<br />

GetShutterMax Returns the maximum shuttervalue<br />

GetGainMin Returns the minimum gain value<br />

GetGainMax Returns the maximum gain value<br />

GetExposureMin Returns the minimum autoexposure reference value<br />

GetExposureMax Returns the maximum autoexposure reference value<br />

GetSaturationMin Returns the minimum saturation value<br />

GetSaturationMax Returns the maximum saturation value<br />

GetHueMin Returns the minimum hue value<br />

GetHueMax Returns the maximum hue value<br />

GetWhiteBalanceMin Returns the minimum white balance value<br />

GetWhiteBalanceMax Returns the maximum white balance value<br />

GetBrightnessMin Returns the minimum brightness value<br />

GetBrightnessMax Returns the maximum brightness value<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

164


<strong>Active</strong>X Reference<br />

GetGammaMin Returns the minimum gamma value<br />

GetGammaMax Returns the maximum gamma value<br />

GetTriggerDelayMin Returns the minimum trigger delay value<br />

GetTriggerDelayMax Returns the maximum trigger delay value<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

165


<strong>Active</strong>X Reference<br />

DCAM Service<br />

ReadRegister Reads a quadlet from a selected camera's register<br />

WriteRegister Writes a quadlet to a selected camera's register<br />

ReadBlock Performs an asynchronous 1394 block transfer from a specified<br />

1394 offset<br />

WriteBlock Performs an asynchronous 1394 block transfer to a specified<br />

1394 offset<br />

LoadChannel Loads previously stored settings from the internal camera's<br />

memory channel<br />

SaveChannel Writes the current settings into the camera's memory channel<br />

GetMaxChannel Returns the maximum index of the camera's memory channel<br />

DCAM I/O<br />

SetSIO Sets the configuration of serial input/output (SIO)<br />

ReadSIO Reads the string of characters from the serial input/output port<br />

(SIO)<br />

WriteSIO Writes the string of characters to the serial input/output port<br />

(SIO)<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

166


<strong>Active</strong>X Reference<br />

Image Access<br />

GetPixel Returns the pixel value at the specified coordinates<br />

GetRGBPixel Returns the array of RGB values at the specified coordinates<br />

GetImageLine Returns the array of pixel values in the specified horizontal line<br />

GetComponentLine Returns the array of pixel values of the color component in the<br />

specified horizontal line<br />

GetImageWindow Returns the 2D array of pixel values in the specified rectangular<br />

area of the current frame<br />

SetImageWindow Copies the 2D array of pixel values to the selected window of the<br />

current frame<br />

GetImageData Returns the two dimensional array of pixel values in the currently<br />

acquired frame<br />

GetComponentData Returns the two dimensional array of pixel values in the specified<br />

color component<br />

GetRawData Returns the 2D array of raw values in the currently acquired data<br />

buffer<br />

GetImagePointer Returns the memory pointer to the specified pixel<br />

GetDIB Returns the handler to a Device Independent Bitmap<br />

GetPicture Returns the Picture object corresponding to the currently<br />

acquired frame<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

167


<strong>Active</strong>X Reference<br />

Image Capture<br />

SaveImage Saves the current frame buffer in the specified image file<br />

LoadImage Loads and displays the image from the specified image file<br />

StartCapture Starts video capture to the specified AVI file or series of image<br />

files<br />

StopCapture Stops video capture<br />

GetCodecList Returns the names of video codecs available in the system<br />

SetCodec Sets the video codec to be used for the AVI capture<br />

GetCodec Returns the name of the current video codec<br />

ShowCodecDlg Shows the configuration dialog of the currently selected video<br />

codec<br />

ShowCompressionDlg Shows the video compression dialog<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

168


<strong>Active</strong>X Reference<br />

Drawing<br />

Draw Displays the current frame in <strong>AVT</strong><strong>Active</strong>Cam window<br />

OverlayClear Clears graphics and text from the overlay<br />

OverlayEllipse Draws an empty or filled ellipse in the overlay<br />

OverlayLine Draws a line in the overlay<br />

OverlayPixel Draws a pixel in the overlay<br />

OverlayRectangle Draws an empty or filled rectangle in the overlay<br />

OverlayText Draws a string of text in the overlay<br />

DrawPixel Draws a pixel in the current image frame<br />

DrawLine Draws a line in the current image frame<br />

DrawRectangle Draws a rectanble in the current image frame<br />

DrawEllipse Draws an ellipse in the current image frame<br />

DrawText Draws a srting of text in the current image frame<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

169


<strong>Active</strong>X Reference<br />

Image Processing<br />

SaveBkg Stores a dark or bright background image on the hard drive<br />

SetROI Sets the rectangular region of interest and luminance range<br />

GetROI Returns the settings of the currently selected ROI<br />

GetImageStat Returns the array containing statistical data of the current image<br />

frame<br />

GetHistogram Returns the histogram of the current image frame<br />

SetLUT Assigns the array of values for the software lookup table<br />

GetLUT Returns the array of values for the software lookup table<br />

SetGains Set the levels for the software gain control<br />

SetLevels Set the minimum and maximum levels for the Window/Level<br />

operation<br />

GetLevels Returns the minimum and maximum levels for the Window/Level<br />

operation<br />

Utilities<br />

GetFPS Returns the actual frame rate of the camera<br />

GetFPSAcquired Returns the acquired (displayed) frame rate of the application<br />

GetTimeStamp Returns the timestamp of the last captured frame<br />

ShowProperties Displays property pages in run-time<br />

LoadSettings Loads previously saved camera settings from the system registry<br />

SaveSettings Stores the camera settings in the system registry<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

170


<strong>Active</strong>X Reference<br />

Draw<br />

Description<br />

Displays the current frame in <strong>AVT</strong><strong>Active</strong>Cam window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Draw<br />

[C/C++]<br />

HRESULT Draw();<br />

Parameters<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the FrameAcquired event to invert pixel value in the bottom left corner of the<br />

current frame and display the processed frame in real time.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Display = False<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

End Sub<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

a = <strong>AVT</strong><strong>Active</strong>Cam1.GetImageData<br />

For x = 0 To 200<br />

For y = 0 To 200<br />

a(x, y) = 255 - a(x, y)<br />

Next<br />

Next<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Draw<br />

End Sub<br />

Remarks<br />

Use this method when the automatic live display is disabled (Display is set to False). This is typically<br />

done when you want to perform real time image processing and display the processed image in the<br />

control window.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

171


<strong>Active</strong>X Reference<br />

DrawEllipse<br />

Description<br />

Draws an empty or filled rectangle in the current image frame.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.DrawElliplse X1, Y1, X2, Y2, Width, Red [,Green, Blue,<br />

Opacity ]<br />

[C/C++]<br />

HRESULT DrawEllipse( short X1, short Y2, short X2, short Y2, short Width,<br />

long Red [,long Green, long Blue, short Opacity ]);<br />

Data Types [VB]<br />

X1, Y1, X2, Y2 : Integer<br />

Width: Integer<br />

Red, Green, Blue: Long<br />

Opacity: Intager<br />

Parameters [C/C++]<br />

X1 [in], Y1 [in]<br />

Coordinates of the top left corner of the ellipse's bounding rectangle relative to the image origin.<br />

X2 [in], Y2 [in]<br />

Coordinates of the bottom right corner of the ellipse's bounding rectangle relative to the image<br />

origin.<br />

Width [in]<br />

Width of the line in pixels. If zero, a filled ellipse will be drawn.<br />

Red [in], Green [in], Blue [in]<br />

Values specifying the color or intensity of the ellipse. If Green and Blue arguments are omitted,<br />

they will be assigned the value of Red.<br />

Opacity [in]<br />

An optional integer between 0 and 100 specifying the percentage of opacity at which the ellipse will<br />

be blended with the underlying pixels in the image. If omitted, default value of 100 is used.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example embeds a semi-transparent filled ellipse into the live video:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

172


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.DrawRectangle 50,100, 300,200, 0, 0, 0, 255, 50<br />

End Sub<br />

Remarks<br />

To draw multiple ellipses, call this method several times.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

173


<strong>Active</strong>X Reference<br />

DrawLine<br />

Description<br />

Draws a line in the current image frame.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.DrawLine X1, Y1, X2, Y2, Width, Red [,Green, Blue, Opacity<br />

]<br />

[C/C++]<br />

HRESULT DrawLine( short X1, short Y2, short X2, short Y2, short Width, long<br />

Red [,long Green, long Blue, short Opacity ]);<br />

Data Types [VB]<br />

X1, Y1, X2, Y2 : Integer<br />

Width: Integer<br />

Red, Green, Blue: Long<br />

Opacity: Intager<br />

Parameters [C/C++]<br />

X1 [in], Y1 [in], X2 [in], Y2 [in]<br />

Coordinates of the starting and ending point of the line relative to the image origin.<br />

Width [in]<br />

Width of the line in pixels.<br />

Red [in], Green [in], Blue [in]<br />

Values specifying the color or intensity of the line. If Green and Blue arguments are omitted, they<br />

will be assigned the value of Red.<br />

Opacity [in]<br />

An optional integer between 0 and 100 specifying the percentage of opacity at which the line will<br />

be blended with the underlying pixels in the image. If omitted, default value of 100 is used.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example embeds a line into the live video:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.DrawLine 50,100, 300,200, 3, 255<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

174


<strong>Active</strong>X Reference<br />

Remarks<br />

To draw multiple lines, call this method several times.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

175


<strong>Active</strong>X Reference<br />

DrawPixel<br />

Description<br />

Draws a pixel in the current image frame.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.DrawPixel X, Y, Red [,Green, Blue, Opacity ]<br />

[C/C++]<br />

HRESULT DrawPixel( short X, short Y, long Red [,long Green, long Blue,<br />

short Opacity ]);<br />

Data Types [VB]<br />

X, Y : Integer<br />

Red, Green, Blue: Long<br />

Opacity: Intager<br />

Parameters [C/C++]<br />

X [in], Y [in]<br />

Coordinates of the pixel relative to the image origin.<br />

Red [in], Green [in], Blue [in]<br />

Values specifying the color or intensity of the pixel. If Green and Blue arguments are omitted, they<br />

will be assigned the value of Red.<br />

Opacity [in]<br />

An optional integer between 0 and 100 specifying the percentage of opacity at which the pixel will<br />

be blended with the underlying pixel in the image. If omitted, default value of 100 is used.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example embeds a pixel into the live video:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.DrawPixel 50,100, 255<br />

End Sub<br />

Remarks<br />

To draw multiple pixels, call this method several times.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

176


<strong>Active</strong>X Reference<br />

DrawRectangle<br />

Description<br />

Draws an empty or filled rectangle in the current image frame.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.DrawRectangle X1, Y1, X2, Y2, Width, Red [,Green, Blue,<br />

Opacity ]<br />

[C/C++]<br />

HRESULT DrawRectangle( short X1, short Y2, short X2, short Y2, short Width,<br />

long Red [,long Green, long Blue, short Opacity ]);<br />

Data Types [VB]<br />

X1, Y1, X2, Y2 : Integer<br />

Width: Integer<br />

Red, Green, Blue: Long<br />

Opacity: Intager<br />

Parameters [C/C++]<br />

X1 [in], Y1 [in]<br />

Coordinates of the top left corner of the rectangle relative to the image origin.<br />

X2 [in], Y2 [in]<br />

Coordinates of the bottom right corner of the rectangle relative to the image origin.<br />

Width [in]<br />

Width of the line in pixels. If zero, a filled rectangle will be drawn.<br />

Red [in], Green [in], Blue [in]<br />

Values specifying the color or intensity of the rectangle. If Green and Blue arguments are omitted,<br />

they will be assigned the value of Red.<br />

Opacity [in]<br />

An optional integer between 0 and 100 specifying the percentage of opacity at which the rectangle<br />

will be blended with the underlying pixels in the image. If omitted, default value of 100 is used.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example embeds a semi-transparent filled rectangle into the live video:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.DrawRectangle 50,100, 300,200, 0, 255, 0, 0, 50<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

177


<strong>Active</strong>X Reference<br />

End Sub<br />

Remarks<br />

To draw multiple rectangles, call this method several times.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

178


<strong>Active</strong>X Reference<br />

DrawText<br />

Description<br />

Embeds a string of text in the current image frame.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.DrawText X, Y, Text, Red [,Green, Blue, Opacity ]<br />

[C/C++]<br />

HRESULT DrawText( short X, short Y, bstr Text, long Red [,long Green, long<br />

Blue, short Opacity ]);<br />

Data Types [VB]<br />

X, Y : Integer<br />

Text: String<br />

Red, Green, Blue: Long<br />

Opacity: Intager<br />

Parameters [C/C++]<br />

X [in], Y [in]<br />

Coordinates of the beginning of the text relative to the image origin.<br />

Text [in]<br />

The string containing the text to be drawn.<br />

Red [in], Green [in], Blue [in]<br />

Values specifying the color or intensity of the text. If Green and Blue arguments are omitted, they<br />

will be assigned the value of Red.<br />

Opacity [in]<br />

An optional integer between 0 and 100 specifying the percentage of opacity at which the text will<br />

be blended with the underlying pixels in the image. If omitted, default value of 100 is used.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example embeds a string of text into the live video:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.DrawText 50,100, "<strong>AVT</strong><strong>Active</strong>Cam SDK for 1394 cameras", 255<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

179


<strong>Active</strong>X Reference<br />

Remarks<br />

To select the font for drawing text strings, use Font. To draw multiple strings, call this method several<br />

times.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

180


<strong>Active</strong>X Reference<br />

GetBitsPerChannel<br />

Description<br />

Returns the number of bits per color component of a pixel.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetBitsPerChannel()<br />

[C/C++]<br />

HRESULT GetBitsPerChannel(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out,retval]<br />

Pointer to the number of bytes per pixel<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure<br />

Example<br />

This VB example reads and displays the pixel depth:<br />

value=<strong>AVT</strong><strong>Active</strong>Cam1.GetBitsPerChannel()<br />

MsgBox value<br />

Remarks<br />

The method returns the pixel depth of the internal image buffer of the <strong>AVT</strong><strong>Active</strong>Cam object after the<br />

unpacking and color interpolation is performed. Depending on the selected format, the following value<br />

will be returned:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

181


<strong>Active</strong>X Reference<br />

Pixel Format Bits per channel<br />

Mono8 8<br />

Mono16+BitShift 6 10<br />

Mono16+BitShift 4 12<br />

Mono16+BitShift 0 16<br />

Raw8+Bayer , RGB(8:8:8), YUV(4:1:1), YUV(4:2:2), YUV(4:4:4) 8<br />

Raw16+Bayer+BitShift 6 10<br />

Raw16+Bayer+BitShift 4 12<br />

Raw16+Bayer+BitShift 0 16<br />

RGB(16:16:16) 16<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

182


<strong>Active</strong>X Reference<br />

GetBrightnessMax<br />

Description<br />

Returns the maximum value of the Brightness property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetBrightnessMax()<br />

[C/C++]<br />

HRESULT GetBrightnessMax(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the maximum brightness value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The brightness control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum brightness values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetBrightnessMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetBrightnessMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Brightness<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software brightness control, the method will generate<br />

an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

183


<strong>Active</strong>X Reference<br />

GetBrightnessMin<br />

Description<br />

Returns the minimum value of the Brightness property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetBrightnessMin()<br />

[C/C++]<br />

HRESULT GetBrightnessMin(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the minimum brightness value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The brightness control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum brightness values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetBrightnessMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetBrightnessMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Brightness<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software brightness control, the method will generate<br />

an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

184


<strong>Active</strong>X Reference<br />

GetBytesPerPixel<br />

Description<br />

Returns the number of bytes per pixel for the current video Format.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetBytesPerPixel()<br />

[C/C++]<br />

HRESULT GetBytesPerPixel(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out,retval]<br />

Pointer to the number of bytes per pixel<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure<br />

Example<br />

This VB example reads and displays the pixel depth:<br />

value=<strong>AVT</strong><strong>Active</strong>Cam1.GetBytesPerPixel()<br />

MsgBox value<br />

Remarks<br />

The method returns the pixel depth of the internal image buffer of <strong>AVT</strong><strong>Active</strong>Cam control which can be<br />

different from the pixel depth of the image ouputed by the camera. For instance, the YUV 4:1:1 and<br />

YUV 4:2:2 images are always converted to the RGB 8:8:8 video, therefore the number of bytes per<br />

pixel reported for these formats will be 3. Also, when the Bayer color conversion is activated for Mono<br />

8 and and Mono 16 formats, the resulting video will have 3 or 6 bytes per pixel accordingly.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

185


<strong>Active</strong>X Reference<br />

GetCameraList<br />

Description<br />

Returns the array of strings containing the names of IIDC cameras connected to the 1394 board.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetCameraList()<br />

[C/C++]<br />

HRESULT GetCameraList( VARIANT* pList );<br />

Data Types [VB]<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

pList [out,retval]<br />

Pointer to the SAFEARRAY containing camera names<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example initializes a combo box with camera names and uses it to switch between the<br />

cameras:<br />

Private Sub Form_Load()<br />

CamLst = <strong>AVT</strong><strong>Active</strong>Cam1.GetCameraList<br />

For i = 0 To UBound(CamLst)<br />

Combo1.AddItem (CamLst(i))<br />

Next<br />

Combo1.ListIndex = 0<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

End Sub<br />

Private Sub Combo1_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Camera = Combo1.ListIndex<br />

End Sub<br />

This MFC example fills out a combo box with camera names:<br />

VARIANT m_CamArray=m_<strong>AVT</strong><strong>Active</strong>Cam.GetCameraList();<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

186


<strong>Active</strong>X Reference<br />

SAFEARRAY *pArray=m_CamArray.parray;<br />

UINT nCam=pArray->rgsabound[0].cElements;<br />

CString strCamera;<br />

CComboBox *pCamera=(CComboBox*)GetDlgItem(IDC_CAMERA);<br />

for(UINT i=0;iAddString(str);<br />

}<br />

int iCam=m_<strong>AVT</strong><strong>Active</strong>Cam.GetCamera();<br />

pCamera->SetCurSel(iCam);<br />

SafeArrayDestroy(pArray);<br />

Remarks<br />

The index of an element in the camera list can be used as an argument of the Camera property to<br />

select a specific camera.<br />

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY<br />

returned by GetCameraList.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

187


<strong>Active</strong>X Reference<br />

GetCodec<br />

Description<br />

Returns the name of the codec (video compressor) selected for the AVI capture.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetCodec<br />

[C/C++]<br />

HRESULT GetCodec ( bstr *pName );<br />

Data Types [VB]<br />

Return value: String<br />

Parameters [C/C++]<br />

pName [out,retval]<br />

String containing the name of the currently selected codec<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example prints the name of the currently selected codec:<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.GetCodec<br />

Remarks<br />

If no compression codec is selected for the AVI capture, SetCodec will return "Full Frames<br />

(Uncompressed)".<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

188


<strong>Active</strong>X Reference<br />

GetCodecList<br />

Description<br />

Returns the array of strings containing the names of AVI codecs (compressors) available in the<br />

system.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetCodecList()<br />

[C/C++]<br />

HRESULT GetCodecList( VARIANT* pList );<br />

Data Types [VB]<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

pList [out,retval]<br />

Pointer to the SAFEARRAY of strings containing available categories<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example initializes a combo box with the list of available codecs:<br />

CodecLst = <strong>AVT</strong><strong>Active</strong>Cam1.GetCodecList<br />

For i = 0 To UBound(CodecLst)<br />

Combo1.AddItem (CodecLst(i))<br />

Next<br />

Combo1.ListIndex = 0<br />

Remarks<br />

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY<br />

returned by GetCodecList.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

189


<strong>Active</strong>X Reference<br />

GetComponentData<br />

Description<br />

Returns the two-dimensional array of pixel values in the specified color component of the current<br />

frame.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetComponentData( Component )<br />

[C/C++]<br />

HRESULT GetComponentData( short Component, VARIANT* pArray );<br />

Data Types [VB]<br />

Component: Integer<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

Component [in]<br />

The index of the selected color component (0 - Red, 1 - Green, 2 - Blue)<br />

pArray [out,retval]<br />

Pointer to the SAFEARRAY containing the pixel values in the frame<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid input argument.<br />

Example<br />

This VB example grabs a frame, retrieves its green component and displays the value of the specified<br />

element of the array.<br />

Dim pix as Long<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Grab<br />

DataArray=<strong>AVT</strong><strong>Active</strong>Cam1.GetComponentData(1)<br />

x=16<br />

y=32<br />

pix=DataArray(x,y)<br />

if pix < 0 then<br />

pix=65535-pix<br />

endif<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

190


<strong>Active</strong>X Reference<br />

Remarks<br />

The array returned by GetComponentData has the dimensions 0 to SizeX - 1, 0 to SizeY - 1. The<br />

type of data in the array depends on the format of the video acquired. For the 24-bit video the method<br />

will return an array of bytes. If the video is of the high-bit depth, the array will contain integer (word)<br />

values.<br />

Note that modifying elements of the array will not change actual pixel values in the frame buffer. The<br />

image data in the array are stored in the standard order from top to bottom, therefore the first element<br />

of the array is first pixel of the top line of the image. This is opposite to the order of raws in the array<br />

returned by GetImageData.<br />

If the video has a grayscale format, the Component parameter will have no effect and the output array<br />

will contain the luminance data.<br />

For integer (word) type of data you can receive negative numbers if pixel values exceed 32767. In C<br />

and C# you can convert signed integers to unsigned ones by using data casting. To get rid of negative<br />

values in VB and Delphi, subract them from 65535 (see the example above).<br />

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY<br />

returned by GetComponentData..<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

191


<strong>Active</strong>X Reference<br />

GetComponentLine<br />

Description<br />

Returns the array of pixel values of the specified color component at the specified horizontal line of the<br />

current frame.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetComponentLine( Y, Component )<br />

[C/C++]<br />

HRESULT GetComponentLine( short Y, short Component, VARIANT* pArray );<br />

Data Types [VB]<br />

Y: Integer<br />

Component: Integer<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

Y [in]<br />

The y-coordinate of the line in the image<br />

Component [in]<br />

The index of the selected color component (0 - Red, 1 - Green, 2 - Blue)<br />

pArray [out,retval]<br />

Pointer to the SAFEARRAY containing the pixel values in the line<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid input argument.<br />

Example<br />

This VB example grabs a frame, retrieves the 32th row of green pixels and displays the value of 10th<br />

pixel in the row.<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Grab<br />

Line=<strong>AVT</strong><strong>Active</strong>Cam1.GetComponentLine(32,2)<br />

MsgBox Line(10)<br />

Remarks<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

192


<strong>Active</strong>X Reference<br />

The array returned by GetComponentLine has the dimension range from 0 to SizeX - 1. The type of<br />

data in the array depends on the format of the video acquired. For the 24-bit video the method will<br />

return an array of bytes. If the video is of the high-bit depth, the array will contain integer (word) values.<br />

If the video has a grayscale format, the Component parameter will have no effect and the output array<br />

will contain the luminance data (see GetLine).<br />

Note that modifying elements of the array will not change actual pixel values in the frame buffer.<br />

The value of the y coordinate must not exceed the height of the video frame, or the error will occur.<br />

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY<br />

returned by GetComponentLine.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

193


<strong>Active</strong>X Reference<br />

GetDIB<br />

Description<br />

Returns the handler to a Device Independent Bitmap.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetDIB()<br />

[C/C++]<br />

HRESULT GetDIB(HGLOBAL* pDib);<br />

Data Types [VB]<br />

Return value: long<br />

Parameters [C/C++]<br />

X [in]<br />

The x-coordinate of the pixel<br />

Y [in]<br />

The y-coordinate of the pixel<br />

pDib<br />

Pointer to the handler to <strong>AVT</strong><strong>Active</strong>Cam's display DIB<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This C example demonstrates how to retrieve and display <strong>AVT</strong><strong>Active</strong>Cam's DIB<br />

BITMAPINFO *pDIB;<br />

p<strong>AVT</strong><strong>Active</strong>Cam->GetDIB((ULONG*)&pDIB);<br />

RECT rect; long sx,sy;<br />

GetWindowRect(hWnd,&rect);<br />

p<strong>AVT</strong><strong>Active</strong>Cam->GetWidth(&sx);<br />

p<strong>AVT</strong><strong>Active</strong>Cam->GetHeight(&sy);<br />

BYTE* pData=(BYTE*)pDIB+sizeof(BITMAPINFOHEADER) + pDIB-<br />

>bmiHeader.biClrUsed * sizeof(RGBQUAD);<br />

SetDIBitsToDevice(hDC, 0, 0, sx, sy, 0, 0, 0, sy, pData, pDIB,<br />

DIB_RGB_COLORS);<br />

Remarks<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

194


<strong>Active</strong>X Reference<br />

The GetDIB method provides the most efficient way to display the internal image buffer when you do<br />

not want to use <strong>AVT</strong><strong>Active</strong>Cam's live display. <strong>AVT</strong><strong>Active</strong>Cam uses packed DIBs, the pixel data<br />

immediately following the BITMAPINFO structure. The method returns a GlobalAlloc handler which<br />

contains the pointer to a DIB. The application must not free the global handler after using the DIB data.<br />

Note that a DIB contains only 8- and 24-bit pixel values, even if the current video mode is a 16- or 48bit<br />

one. To access the actual pixel data, use the GetImageData or GetPointer methods.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

195


<strong>Active</strong>X Reference<br />

GetExposureMax<br />

Description<br />

Returns the maximum value of the AutoExposureRef property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetExposureMax()<br />

[C/C++]<br />

HRESULT GetExposureMax(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the maximum auto exposure reference value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The auto exposure control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum auto exposure reference values to initialize the<br />

slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetExposureMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetExposureMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.AutoExposureRef<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support auto exposure control, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

196


<strong>Active</strong>X Reference<br />

GetExposureMin<br />

Description<br />

Returns the minimum value of the AutoExposureRef property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetExposureMin()<br />

[C/C++]<br />

HRESULT GetExposureMin(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the minimum auto exposure reference value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The auto exposure control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum auto exposure reference values to initialize the<br />

slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetExposureMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetExposureMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.AutoExposureRef<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support auto exposure control, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

197


<strong>Active</strong>X Reference<br />

GetF7Info<br />

Description<br />

Returns the array of long values containing the information releated to Format 7 (partial scan) video<br />

modes .<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetF7Info()<br />

[C/C++]<br />

HRESULT GetF7Info( VARIANT* pInfo );<br />

Data Types [VB]<br />

Return value: Variant (Array)<br />

Parameters [C/C++]<br />

pInfo [out,retval]<br />

Pointer to the SAFEARRAY containing the following long values in the listed order:<br />

- maximum height of the partial scan in pixels<br />

- maximum width of the partial scan in pixels<br />

- minimum interval at which partial scan size can be changed horizontally<br />

- minimum interval at which partial scan size can be changed vertically<br />

- minimum interval at which the offset of partial scan can be changed horizontally<br />

- minimum interval at which the offset of partial scan can be changed vertically<br />

- maximum number of bytes per isochronous packet that can be set<br />

- minimum number of bytes per isochronous packet and minimum interval at which it can be<br />

changed<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example retrieves a packet size information for the current F7 mode and initializes a scroll bar<br />

to conrol the packet size:<br />

Private Sub Form_Load()<br />

F7Info=<strong>AVT</strong><strong>Active</strong>Cam1.GetF7Info<br />

HScroll1.Min = F7Info(6)<br />

HScroll1.Max = F7Info(7)<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

198


<strong>Active</strong>X Reference<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.PacketSize = HScroll1.Value<br />

End Sub<br />

Remarks<br />

Use this method to implement custom controls for partial scan size, offset and packet size.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

199


<strong>Active</strong>X Reference<br />

GetFeature<br />

Description<br />

Returns the value of the specified camera feature.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetFeature( Name )<br />

[C/C++]<br />

HRESULT GetFeature(bstr Name, float* pValue );<br />

Data Types [VB]<br />

Name: String<br />

Return value: Single<br />

Parameters [C/C++]<br />

Name [in]<br />

String specifying the name of the feature. In accordance with IIDC 1.31, one of the following<br />

names can be used:<br />

"Brightness", "Exposure", "Sharpness", "WhiteBalanceVR", "WhiteBalanceUB", "Hue",<br />

"Saturation", "Gamma", "Shutter", "Gain", "TriggerDelay".<br />

pValue [out, retval]<br />

Pointer to the value of the feature<br />

Return Values<br />

S_OK<br />

Success<br />

E_INVALIDARG<br />

Feature does not exist<br />

E_FAIL<br />

Failed to read the feature<br />

Example<br />

The following VB example demonstrates the use of a scroll control for real-time adjustment of the<br />

"Brightness" feature:<br />

Private Sub Form_Load()<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeature("Brightness")<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeatureMin("Brightness")<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeatureMax("Brightness")<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

200


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeature("Brightness", HScroll1.Value)<br />

End Sub<br />

The following VB example displays the absolute value of the shutter:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeatureControl "Shutter", "Absolute", True<br />

MsgBox <strong>AVT</strong><strong>Active</strong>Cam1.GetFeature "Shutter"<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeatureControl "Shutter", "Absolute", False<br />

Remarks<br />

Depending on the absolute feature control being enabled or disabled, this method will return the value<br />

of the feature in absolute or relative units.<br />

If the currently selected camera does not support the specified feature, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

201


<strong>Active</strong>X Reference<br />

GetFeatureCapability<br />

Description<br />

Checks for available operational modes of the specified camera feature.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetFeatureCapability ( Name, Inquiry )<br />

[C/C++]<br />

HRESULT GetFeatureCapability ( bstr Name, bstr Inquiry, BOOL pValue );<br />

Data Types [VB]<br />

Name: String<br />

Inquiry: String<br />

Return value: Boolean<br />

Parameters [C/C++]<br />

Name [in]<br />

String specifying the name of the feature. In accordance with IIDC 1.31, one of the following<br />

names can be used:<br />

"Brightness", "Exposure", "Sharpness", "WhiteBalanceVR", "WhiteBalanceUB", "Hue",<br />

"Saturation", "Gamma", "Shutter", "Gain", "TriggerDelay".<br />

Name [in]<br />

String specifying the mode to inquire. Use one of the following inquiries:<br />

"Present" - to check if the feature is implemented<br />

"OnOff" - to check if the feature can be turned on/off<br />

"Absolute" - to check if the feature can be controlled with an absolute value<br />

"Manual" - to check if the feature can be controlled manually<br />

"Auto" - to check if the feature can be controlled continuously by the camera<br />

"OnePush" - to check if the feature can be set automatically by the camera as a result of one<br />

action<br />

"Readout" - to check if the value of the feature can be read out<br />

pValue [out, retval]<br />

Pointer to the boolean value which is TRUE if the mode is available and FALSE otherwise<br />

Return Values<br />

S_OK<br />

Success<br />

E_INVALIDARG<br />

Feature or inquiry does not exist<br />

E_FAIL<br />

Failure<br />

Example<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

202


<strong>Active</strong>X Reference<br />

This VB example checks on the availability of the auto-control of the gain feature and, if available, sets<br />

the gain to the automatic mode:<br />

if <strong>AVT</strong><strong>Active</strong>Cam1.GetFeatureCapability("Gain", "Auto") then<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeatureControl "Gain","Auto"<br />

endif<br />

Remarks<br />

If the currently selected camera does not support the specified feature or inquiry, the method will<br />

generate an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

203


<strong>Active</strong>X Reference<br />

GetFeatureControl<br />

Description<br />

Returns the status of the specified control mode for the selected camera feature.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetFeatureControl ( Name, Control )<br />

[C/C++]<br />

HRESULT GetFeatureControl ( bstr Name, bstr Control, BOOL pValue );<br />

Data Types [VB]<br />

Name: String<br />

Control: String<br />

Return value: Boolean<br />

Parameters [C/C++]<br />

Name [in]<br />

String specifying the name of the feature. In accordance with IIDC 1.31, one of the following<br />

names can be used:<br />

"Brightness", "Exposure", "Sharpness", "WhiteBalanceVR", "WhiteBalanceUB", "Hue",<br />

"Saturation", "Gamma", "Shutter", "Gain", "TriggerDelay".<br />

Control [in]<br />

String specifying the control mode. Use one of the following inquiries:<br />

"OnOff" - to check if the feature is turned on<br />

"Absolute" - to check if the absolute control of the feature is turned on<br />

"Auto" - to check if the auto-control of the feature is turned on<br />

"OnePush" - to check if the one-push operation for the feature is in progress<br />

pValue [out, retval]<br />

Pointer to the boolean value which is TRUE if the control mode is enabled and FALSE otherwise<br />

Return Values<br />

S_OK<br />

Success<br />

E_INVALIDARG<br />

Feature or inquiry does not exist<br />

E_FAIL<br />

Failure<br />

Example<br />

This VB example sets implements a one-push white balance control and then waits for the operation to<br />

complete:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

204


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeatureControl "WhiteBalance","OnePush"<br />

Do While (x = True)<br />

x = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeatureControl("WhiteBalance", "OnePush")<br />

Loop<br />

Remarks<br />

If the currently selected camera does not support the specified feature or inquiry, the method will<br />

generate an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

205


<strong>Active</strong>X Reference<br />

GetFeatureMin<br />

Description<br />

Returns the minimum value allowed for the specified camera feature.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetFeatureMin ( Name )<br />

[C/C++]<br />

HRESULT GetFeatureMin( bstr Name, float* pValue );<br />

Data Types [VB]<br />

Name: String<br />

Return value: Single<br />

Parameters [C/C++]<br />

Name [in]<br />

String specifying the name of the feature. In accordance with IIDC 1.31, one of the following<br />

names can be used:<br />

"Brightness", "Exposure", "Sharpness", "WhiteBalanceVR", "WhiteBalanceUB", "Hue",<br />

"Saturation", "Gamma", "Shutter", "Gain", "TriggerDelay".<br />

pValue [out, retval]<br />

Pointer to the minimum value of the feature<br />

Return Values<br />

S_OK<br />

Success<br />

E_INVALIDARG<br />

Feature does not exist<br />

E_FAIL<br />

The gain control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum gain values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeatureMin("Brightness")<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeatureMax("Brightness")<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeature("Brightness")<br />

End Sub<br />

Remarks<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

206


<strong>Active</strong>X Reference<br />

Depending on the absolute feature control being enabled or disabled, this method will return the<br />

minimum value of the feature in absolute or relative units.<br />

If the currently selected camera does not support the specified feature, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

207


<strong>Active</strong>X Reference<br />

GetFeatureMax<br />

Description<br />

Returns the maximum value allowed for the specified camera feature.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetFeatureMax ( Name )<br />

[C/C++]<br />

HRESULT GetFeatureMax( bstr Name, float* pValue );<br />

Data Types [VB]<br />

Name: String<br />

Return value: Single<br />

Parameters [C/C++]<br />

Name [in]<br />

String specifying the name of the feature. In accordance with IIDC 1.31, one of the following<br />

names can be used:<br />

"Brightness", "Exposure", "Sharpness", "WhiteBalanceVR", "WhiteBalanceUB", "Hue",<br />

"Saturation", "Gamma", "Shutter", "Gain", "TriggerDelay".<br />

pValue [out, retval]<br />

Pointer to the maximum value of the feature<br />

Return Values<br />

S_OK<br />

Success<br />

E_INVALIDARG<br />

Feature does not exist<br />

E_FAIL<br />

The gain control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum gain values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeatureMin("Brightness")<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeatureMax("Brightness")<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeature("Brightness")<br />

End Sub<br />

Remarks<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

208


<strong>Active</strong>X Reference<br />

Depending on the absolute feature control being enabled or disabled, this method will return the<br />

maximum value of the feature in absolute or relative units.<br />

If the currently selected camera does not support the specified feature, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

209


<strong>Active</strong>X Reference<br />

GetFPS<br />

Description<br />

Returns the current frame rate of the camera in frames per second.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetFPS<br />

[C/C++]<br />

HRESULT GetFPS(float* pValue);<br />

Data Types [VB]<br />

Return value: Single<br />

Parameters [C/C++]<br />

pValue [out,retval]<br />

Pointer to the fps value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example displays the actual frame rate of the camera.<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

Label1.Caption = <strong>AVT</strong><strong>Active</strong>Cam1.GetFPS<br />

End Sub<br />

Remarks<br />

This method measures the frame rate based on the arrival of frames into the system memory. The<br />

IEEE-1394 bus is using DMA (Direct Memory Access) for the data transfer which delivers the frames<br />

into RAM without the CPU involvement. However, a heavy CPU and data load on the system bus can<br />

theoretically disrupt the DMA or time measurements and cause the fps value measured by GetFPS to<br />

deviate from the actual camera frame rate.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

210


<strong>Active</strong>X Reference<br />

GetFPSAcquired<br />

Description<br />

Returns the acquired (displayed) frame rate in frames per second.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetFPSAcquired<br />

[C/C++]<br />

HRESULT GetFPSAcquired(float* pValue);<br />

Data Types [VB]<br />

Return value: Single<br />

Parameters [C/C++]<br />

pValue [out,retval]<br />

Pointer to the fps value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example displays the acquired frame rate.<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

Label1.Caption = <strong>AVT</strong><strong>Active</strong>Cam1.GetFPSAcquired<br />

End Sub<br />

Remarks<br />

This method returns the frame rate based on the arrival of the video frames into the application buffer.<br />

The acquired frame rate depends on the CPU power, performance of the graphic card, color<br />

conversion required for a given video mode and custom image processing performed on each frame.<br />

The acquired frame rate is equal to the frequency at which the FrameAcquired event is called in your<br />

application. When the acquired frame rate is lower than camera frame rate, <strong>AVT</strong><strong>Active</strong>Cam will fire the<br />

FrameDropped events.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

211


<strong>Active</strong>X Reference<br />

GetGainMax<br />

Description<br />

Returns the maximum value of the Gain property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetGainMax()<br />

[C/C++]<br />

HRESULT GetGainMax(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the maximum gain value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The gain control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum gain values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetGainMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetGainMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Gain<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software gain control, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

212


<strong>Active</strong>X Reference<br />

GetGainMin<br />

Description<br />

Returns the minimum value of the Gain property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetGainMin()<br />

[C/C++]<br />

HRESULT GetGainMin(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the minimum gain value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The gain control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum gain values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetGainMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetGainMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Gain<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software gain control, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

213


<strong>Active</strong>X Reference<br />

GetGammaMax<br />

Description<br />

Returns the maximum value of the Gamma property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetGammaMax()<br />

[C/C++]<br />

HRESULT GetGammaMax(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the maximum gamma value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The gamma control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum gamma values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetGammaMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetGammaMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Gamma<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software gamma control, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

214


<strong>Active</strong>X Reference<br />

GetGammaMin<br />

Description<br />

Returns the minimum value of the Gamma property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetGammaMin()<br />

[C/C++]<br />

HRESULT GetGammaMin(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the minimum gamma value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The gamma control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum gamma values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetGammaMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetGammaMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Gamma<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software gamma control, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

215


<strong>Active</strong>X Reference<br />

GetHeight<br />

Description<br />

Returns the maximum vertical size of the video frame for the currently selected Format.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetHeight()<br />

[C/C++]<br />

HRESULT GetHeight(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the maximum vertical size of the video frame<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure<br />

Example<br />

This VB example uses the minimum video width and height to initialize slider controls:<br />

Private Sub Form_Load()<br />

Slider1.Min = 0<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetWidth<br />

Slider2.Min = 0<br />

Slider2.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetHeight<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.SizeX<br />

Slider2.Value = <strong>AVT</strong><strong>Active</strong>Cam1.SizeY<br />

End Sub<br />

Remarks<br />

This method allows you to determine the maximum size of the video frame in a user-defined format. If<br />

the currently selected format is a fixed one, the value returned by the method will be identical to the<br />

value returned by the SizeY property. See Format for more details.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

216


<strong>Active</strong>X Reference<br />

GetHistogram<br />

Description<br />

Returns the histogram of the current image frame over a selected ROI .<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetHistogram(Component [,Bins, Step ])<br />

[C/C++]<br />

HRESULT GetHistogram( VARIANT* pHistogram, short Component [, long<br />

Bins=256, short Step=1 ]);<br />

Data Types [VB]<br />

Component : Integer<br />

Bins : Long<br />

Step : Integer<br />

Return value: Variant (Array)<br />

Parameters [C/C++]<br />

Component [in]<br />

Enumerated integer specifying the color component for which the histogram data are obtained.<br />

This parameter is disregarded for grayscale images. Must be one of the following values:<br />

0 - collects the histogram of the luminance of the image<br />

1 - collects the histogram of the red component of the image<br />

2 - collects the histogram of the green component of the image<br />

3 - collects the histogram of the blue component of the image<br />

Bins [in]<br />

Number of intervals used for histogram collection. It is recommended to set this parameter to a<br />

number of possible intensity levels in the image or to an integer fraction of that value, otherwise<br />

some precision will be lost due to averaging that occurs within the consolidated bins. A typical<br />

number of histogram bins for 8-bit and 16=bit images will be 256.<br />

Step [in]<br />

An optional integer between 1 and 16 specifying the sampling step, which is used to collect pixel<br />

values for the histogram calculations. If this number is 1, every pixel is taking into consideration. If<br />

the number is 2, every second pixel in a row will be skipped, as well as every second row in the<br />

image, etc. Increasing the sampling step raises the speed of the histogram calculations, but<br />

sacrifices some accuracy.<br />

pHistogram [out,retval]<br />

Pointer to the SAFEARRAY containing the histogram values.<br />

Return Values<br />

S_OK<br />

Success<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

217


<strong>Active</strong>X Reference<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example retrieves the histogram of the red component per each frame acquired:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetROI 100,100,500, 400<br />

HistArray=<strong>AVT</strong><strong>Active</strong>Cam1.GetHistogram (1, 256)<br />

End Sub<br />

Remarks<br />

The histogram is calculated over the rectangular region of interest defined by SetROI. The luminance<br />

thresholds of the current ROI are disregarded. If the ROI is not set, the whole image frame will be<br />

used.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

218


<strong>Active</strong>X Reference<br />

GetHueMax<br />

Description<br />

Returns the maximum value of the Hue property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetHueMax()<br />

[C/C++]<br />

HRESULT GetHueMax(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the maximum hue value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The hue control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum hue values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetHueMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetHueMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Hue<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software hue control, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

219


<strong>Active</strong>X Reference<br />

GetHueMin<br />

Description<br />

Returns the minimum value of the Hue property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetHueMin()<br />

[C/C++]<br />

HRESULT GetHueMin(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the minimum hue value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The hue control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum hue values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetHueMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetHueMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Hue<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software hue control, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

220


<strong>Active</strong>X Reference<br />

GetImageData<br />

Description<br />

Returns the two-dimensional array of pixel values in the currently acquired frame.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetImageData<br />

[C/C++]<br />

HRESULT GetImageData( VARIANT* pArray );<br />

Data Types [VB]<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

pArray [out,retval]<br />

Pointer to the SAFEARRAY containing the pixel values in the frame<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the FrameAcquired event to invert pixel value in the bottom left corner of the<br />

current frame and display the processed frame in real time.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Display = False<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

End Sub<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

a = <strong>AVT</strong><strong>Active</strong>Cam1.GetImageData<br />

For x = 0 To 200<br />

For y = 0 To 200<br />

a(x, y) = 255 - a(x, y)<br />

Next<br />

Next<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Draw<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

221


<strong>Active</strong>X Reference<br />

Remarks<br />

GetImageData does not copy the image data, so the array returned contains the actual image buffer of<br />

the currently acquired frame. Modifying elements of the array will change actual pixel values in the<br />

image buffer. This can be used to perform custom image processing and display a processed image in<br />

real time. Note that this feature cannot be used in .NET as its framework creates a copy of the array<br />

returned. For direct access to <strong>AVT</strong><strong>Active</strong>Cam's image frame in VB.NET and C# use GetImagePointer.<br />

Image in <strong>AVT</strong><strong>Active</strong>Cam are stored bottom up, therefore the first element of the array is first pixel of<br />

the bottom line of the image.The type of data and dimensions of the array returned by GetImageData<br />

depends on the output format of the video, its horizontal width SizeX and the number of lines acquired,<br />

as specified in the following table:<br />

Camera Pixel Format Output Format Data type Dimensions<br />

Mono8 8-bit monochrome Byte 0 to SizeX -1, 0 to Lines -<br />

1<br />

Mono10, Mono12, Mono16 16-bit gray monochrome Integer (word) 0 to SizeX -1, 0 to Lines -<br />

YUV411, YUV422, YUV444, 24-bit RGB Byte 0 to SizeX * 3 - 1, 0 to<br />

RGB24, Raw8 (Bayer on)<br />

Lines - 1<br />

RGB48, Raw16 (Bayer on) 48-bit RGB Integer (word) 0 to SizeX * 3 - 1, 0 to<br />

Lines - 1<br />

Note that <strong>AVT</strong><strong>Active</strong>Cam automatically converts YUV video outputed by a camera to 24-bit RGB.<br />

For integer (word) type of data you can receive negative numbers if pixel values exceed 32767. In C<br />

and C# you can convert signed integers to unsigned ones by using data casting. To get rid of negative<br />

values in VB and Delphi, subract them from 65535.<br />

GetImageData may not work in some development environments such as Delphi or Matlab. In such a<br />

case use GetImageWindow instead.<br />

1<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

222


<strong>Active</strong>X Reference<br />

GetImageLine<br />

Description<br />

Returns the array of pixel values at the specified horizontal line of the currently acquired frame.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetImageLine( Y )<br />

[C/C++]<br />

HRESULT GetImageLine( short Y, VARIANT* pArray );<br />

Data Types [VB]<br />

Y: Integer<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

Y [in]<br />

The y-coordinate of the line in the image<br />

pArray [out,retval]<br />

Pointer to the SAFEARRAY containing the pixel values in the line<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid input argument.<br />

Example<br />

This VB example grabs a frame, retrieves the 33th row of pixels and displays the value of 11th pixel in<br />

the row.<br />

Dim pix as Long<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Grab<br />

Line=<strong>AVT</strong><strong>Active</strong>Cam1.GetImageLine(32)<br />

pix=Line(10)<br />

if pix < 0 then<br />

pix=65535-pix<br />

endif<br />

MsgBox Line(10)<br />

Remarks<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

223


<strong>Active</strong>X Reference<br />

The array returned by GetImageLine is a copy of the actual raw of pixels. Modifying elements of the<br />

array will not change actual pixel values in the frame buffer. The type of data and dimension of the<br />

array returned by GetImageLine depends on the output format of the video as specified in the<br />

following table:<br />

Camera Pixel Format Output Format Data type Dimension<br />

Mono8 8-bit monochrome Byte 0 to SizeX -1<br />

Mono10, Mono12, Mono16 16-bit gray monochrome Integer (word) 0 to SizeX -1<br />

YUV411, YUV422, YUV444,<br />

RGB24, Raw8 (Bayer on)<br />

24-bit RGB Byte 0 to SizeX * 3 - 1<br />

RGB48, Raw16 (Bayer on) 48-bit RGB Integer (word) 0 to SizeX * 3 - 1<br />

Note that <strong>AVT</strong><strong>Active</strong>Cam automatically converts YUV video outputed by a camera to 24-bit RGB.<br />

The value of the y coordinate must not exceed the height of the video frame, or the error will occur. For<br />

integer (word) type of data you can receive negative numbers if pixel values exceed 32767. In C and<br />

C# you can convert signed integers to unsigned ones by using data casting. To get rid of negative<br />

values in VB and Delphi, subract them from 65535 (see example above).<br />

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY<br />

returned by GetImageLine.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

224


<strong>Active</strong>X Reference<br />

GetImagePointer<br />

Description<br />

Returns the pointer to the pixel at the specified coordinates of the current frame.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetImagePointer( X, Y )<br />

[C/C++]<br />

HRESULT GetImagePointer( short X, short Y, VARIANT* pValue );<br />

Data Types [VB]<br />

X: Integer<br />

Y: Integer<br />

Return value: Variant (pointer)<br />

Parameters [C/C++]<br />

X [in]<br />

The x-coordinate of the pixel<br />

Y [in]<br />

The y-coordinate of the pixel<br />

pValue [out,retval]<br />

Pointer to the variant contating the pointer to the specified memory location<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid input arguments.<br />

Example<br />

This C++ example grabs a frame, retrieves a pointer to the 32th line in the frame memory and copies<br />

the pixels values into a byte array . A wrapper class C<strong>AVT</strong><strong>Active</strong>Cam is used to access the<br />

<strong>AVT</strong><strong>Active</strong>Cam control:<br />

BYTE line[4096];<br />

int iWidth=m_<strong>AVT</strong><strong>Active</strong>Cam.GetSizeX;<br />

int iHeight=m_<strong>AVT</strong><strong>Active</strong>Cam.GetSizeY;<br />

m_<strong>AVT</strong><strong>Active</strong>Cam.Grab()<br />

VARIANT v=m_<strong>AVT</strong><strong>Active</strong>Cam.GetImagePointer(0,32);<br />

BYTE* ptr=<strong>AVT</strong><strong>Active</strong>Cam1.GetImagePointer(0,32);<br />

memcpy(&line,v.pcVal,iWidth);<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

225


<strong>Active</strong>X Reference<br />

This C# example uses the FrameAcquired event to retrieve a pointer to the 32th line in the frame<br />

memory and change pixel values in the line to zeros:<br />

private void ax<strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired(object sender,<br />

Ax<strong>AVT</strong>ACTIVECAMLib._I<strong>AVT</strong><strong>Active</strong>CamEvents_FrameAcquiredEvent e)<br />

{<br />

int sx=ax<strong>AVT</strong><strong>Active</strong>Cam1.SizeX;<br />

object obj=ax<strong>AVT</strong><strong>Active</strong>Cam1.GetImagePointer(0, iHeight-1-32);<br />

int a = (int)obj;<br />

byte* ptr= (byte*)a;<br />

for (int x=0; x


<strong>Active</strong>X Reference<br />

GetImageStat<br />

Description<br />

Returns the array containing statistical data of the current image frame over a selected ROI.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetImageStat( Component [,Step] )<br />

[C/C++]<br />

HRESULT GetImageStat( VARIANT* pStat, short Component, short Step=1 );<br />

Data Types [VB]<br />

Component : Integer<br />

Step : Integer<br />

Return value: Variant (Array)<br />

Parameters [C/C++]<br />

Component [in]<br />

Enumerated integer specifying the color component for which the image statistics is obtained. This<br />

parameter is disregarded for grayscale images. Must be one of the following values:<br />

0 - collects the statistics of the luminance of the image<br />

1 - collects the statistics of the red component of the image<br />

2 - collects the statistics of the green component of the image<br />

3 - collects the statistics of the blue component of the image<br />

Step [in]<br />

An optional integer between 1 and 16 specifying the sampling step, which is used to collect pixel<br />

values for the calculations. If this number is 1, every pixel is taking into consideration. If the number<br />

is 2, every second pixel in a row will be skipped, as well as every second row in the image, etc.<br />

Increasing the sampling step raises the speed of the image statistics collection, but sacrifices some<br />

accuracy.<br />

pStat [out,retval]<br />

Pointer to the SAFEARRAY containing the image statistics. The statistics is written to the array as<br />

follows:<br />

Stat [0] – Mean value<br />

Stat [1] – Standard deviation<br />

Stat [2] – Pixel count<br />

Stat [3] – Minimum<br />

Stat [4] – Maximum<br />

Stat [5] – Median<br />

Stat [6] – Skewness<br />

Stat [7] – Kurtosis<br />

Return Values<br />

S_OK<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

227


<strong>Active</strong>X Reference<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example displays the mean value and standard deviation of the red component per each<br />

frame acquired:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetROI 100,100,500, 400<br />

StatArray=<strong>AVT</strong><strong>Active</strong>Cam1.GetImageStat 1<br />

LabelMean.Caption=StatArray[0]<br />

LabelStd.Caption=StatArray[1]<br />

End Sub<br />

Remarks<br />

The image statistics is calculated over the rectangular region of interest and luminance range defined<br />

by SetROI. If the ROI is not set, the whole size and luminance range of the image will be used.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

228


<strong>Active</strong>X Reference<br />

GetImageWindow<br />

Description<br />

Returns the two-dimensional array of pixel values corresponding to the selected window in the currently<br />

acquired frame.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetImageWindow (X, Y, Width, Height)<br />

[C/C++]<br />

HRESULT GetImageWindow( short X, short Y, short Width, short Height,<br />

VARIANT* pArray );<br />

Data Types [VB]<br />

X,Y, Width, Height: Integer<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

X [in], Y[in]<br />

The x- and y-coordinates of the top left pixel of the window in the entire frame<br />

Width [in], Height [in]<br />

The horizontal and vertical size of the window in pixels.<br />

pArray [out,retval]<br />

Pointer to the SAFEARRAY containing the pixel values in the frame<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the FrameAcquired event to increase the brightness in the central area of the<br />

live image:<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Display = False<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

End Sub<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

xc = <strong>AVT</strong><strong>Active</strong>Cam1.SizeX / 2<br />

yc = <strong>AVT</strong><strong>Active</strong>Cam1.SizeY / 2<br />

w = <strong>AVT</strong><strong>Active</strong>Cam1.GetImageWindow(xc - 70, yc - 50, 140, 100)<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

229


<strong>Active</strong>X Reference<br />

For y = 0 To UBound(w, 2)<br />

For x = 0 To UBound(w, 1)<br />

pix = w(x, y) + 50<br />

If pix > 255 Then<br />

pix = 255<br />

End If<br />

w(x, y) = pix<br />

Next<br />

Next<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetImageWindow xc - 70, yc - 50, w<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Draw<br />

End Sub<br />

Remarks<br />

The image data in the array are stored in the standard order from top to bottom, therefore the first<br />

element of the array is the top left pixel of the window. This is opposite to the order of raws in the<br />

arrays returned by GetImageData. The type of data and dimensions of the array returned by<br />

GetImageWindow depends on the output format of the video, the width and height of the window and<br />

the number of lines acquired, as specified in the following table:<br />

Format Data type Dimensions<br />

8-bit monochrome Byte 0 to Width -1, 0 to Height - 1<br />

16-bit gray monochrome Integer (word) 0 to Width-1, 0 to Height - 1<br />

24-bit RGB Byte 0 to Width * 3 - 1, 0 to Height - 1<br />

48-bit RGB Integer (word) 0 to Width * 3 - 1, 0 to Height - 1<br />

If the dimensions of the window are too large to accomodate the frame size, they will be clipped to the<br />

frame boundaries.<br />

For integer (word) type of data you can receive negative numbers if pixel values exceed 32767. In C<br />

and C# you can convert signed integers to unsigned ones by using data casting. To get rid of negative<br />

values in VB and Delphi, subract them from 65535.<br />

Note that modifying elements of the array will not change actual pixel values in the frame buffer. Use<br />

SetImageWindow to transfer pixel values into <strong>AVT</strong><strong>Active</strong>Cam.<br />

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY<br />

returned by GetImageWindow.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

230


<strong>Active</strong>X Reference<br />

GetIsoSpeed<br />

Description<br />

Returns the camera's isochronous transmission speed in Mbps/sec.<br />

Syntax<br />

[VB]<br />

value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetIsoSpeed<br />

[C/C++]<br />

HRESULT GetIsoSpeed( short* pSpeed );<br />

Data Types [VB]<br />

Return value: Integer<br />

Parameters [C/C++]<br />

pSpeed [in]<br />

Pointer to the isochronous transmission speed.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example displays the transmission speed of the camera:<br />

speed=<strong>AVT</strong><strong>Active</strong>Cam1.GetIsoSpeed<br />

MsgBox speed<br />

Remarks<br />

Possible return values for this method are 100, 200, 400 and 800.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

231


<strong>Active</strong>X Reference<br />

GetLevels<br />

Description<br />

Returns the array containing the current levels for the Window/Level operation.<br />

Syntax<br />

[VB]<br />

value = obj<strong>AVT</strong><strong>Active</strong>Cam.GetLevels<br />

[C/C++]<br />

HRESULT SetROI( VARIANT* pLevels );<br />

Data Types [VB]<br />

Return value: Variant (Array)<br />

Parameters [C/C++]<br />

pLevels [out,retval]<br />

Pointer to the SAFEARRAY containing the current levels for the Window/Level operation:<br />

ROI [0] - current minR level<br />

ROI [1] - current maxR level<br />

ROI [2] - current minG level<br />

ROI [3] - current maxG level<br />

ROI [4] - current minB level<br />

ROI [5] - current maxB level<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example displays the currently selected levels for a monochrome image:<br />

Levels=<strong>AVT</strong><strong>Active</strong>Cam1.GetLevels<br />

MsgBox "Min: ", Levels[0], "Max: ", Levels[1]<br />

Remarks<br />

For more information on the Window/Level parameters see SetLevels.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

232


<strong>Active</strong>X Reference<br />

GetLUT<br />

Description<br />

Returns the array containing the current lookup table.<br />

Syntax<br />

[VB]<br />

value = obj<strong>AVT</strong><strong>Active</strong>Cam.GetLUT<br />

[C/C++]<br />

HRESULT GetLUT( VARIANT* pLUT );<br />

Data Types [VB]<br />

Return value: Variant (Array)<br />

Parameters [C/C++]<br />

pLUT [out,retval]<br />

Pointer to the SAFEARRAY of floating point values containing the current lookup table.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example displays several elements of the current lookup table:<br />

LUT=<strong>AVT</strong><strong>Active</strong>Cam1.GetLUT<br />

MsgBox "LUT(100): ", LUT(100), "LUT(101): ", LUT(101), "LUT(102): ", LUT<br />

(102)<br />

Remarks<br />

For more information on the lookup table refer to SetLUT<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

233


<strong>Active</strong>X Reference<br />

GetMaxChannel<br />

Description<br />

Returns the maximum index of the memory channels available for the current camera.<br />

Syntax<br />

[VB]<br />

value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetMaxChannel<br />

[C/C++]<br />

HRESULT GetMaxChannel( short* pChannel );<br />

Data Types [VB]<br />

Return value: Integer<br />

Parameters [C/C++]<br />

pChannel [in]<br />

Pointer to the maximum index of the memory channels.<br />

Example<br />

This VB example retrieves the number of memory channels:<br />

channels=<strong>AVT</strong><strong>Active</strong>Cam1.GetMaxChannel<br />

Remarks<br />

If this method returns zero, then user's memory channels are not supported for the current camera. For<br />

more details see LoadChannel and SaveChannel.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

234


<strong>Active</strong>X Reference<br />

GetModeList<br />

Description<br />

Returns the array of strings containing the descriptions of video modes supported by the currently<br />

selected camera.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetModeList()<br />

[C/C++]<br />

HRESULT GetModeList( VARIANT* pList );<br />

Data Types [VB]<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

pList [out,retval]<br />

Pointer to the SAFEARRAY containing available modes<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example initializes a combo box with the descriptions of available video modes and uses it to<br />

select a specific mode:<br />

Private Sub Form_Load()<br />

ModeLst = <strong>AVT</strong><strong>Active</strong>Cam1.GetModeList<br />

For i = 0 To UBound(ModeLst)<br />

Combo1.AddItem (ModeLst(i))<br />

Next<br />

Combo1.ListIndex = 0<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

End Sub<br />

Private Sub Combo1_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Mode = Combo1.ListIndex<br />

End Sub<br />

This MFC example fills out a combo box with available video modes:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

235


<strong>Active</strong>X Reference<br />

VARIANT m_ModeArray=m_<strong>AVT</strong><strong>Active</strong>Cam.GetModeList();<br />

SAFEARRAY *pArray=m_ModeArray.parray;<br />

UINT nModes=pArray->rgsabound[0].cElements;<br />

CString strMode;<br />

CComboBox *pMode=(CComboBox*)GetDlgItem(IDC_MODE);<br />

for(UINT i=0;iAddString(strMode);<br />

}<br />

int iMode=m_<strong>AVT</strong><strong>Active</strong>Cam.GetMode();<br />

pMode->SetCurSel(iMode);<br />

SafeArrayDestroy(pArray);<br />

Remarks<br />

The index of an element in the mode list can be used as an argument of the Mode property to select a<br />

specific video mode.<br />

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY<br />

returned by GetModeList.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

236


<strong>Active</strong>X Reference<br />

GetPicture<br />

Description<br />

Returns a Picture object created from the currently acquired frame.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetPicture()<br />

[C/C++]<br />

HRESULT GetPicture(IPictureDisp* *pPicture);<br />

Data Types [VB]<br />

Return value: Picture<br />

Parameters [C/C++]<br />

pPicture<br />

Pointer to the IPictureDisp interface object<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the FrameAcquired event to display a live video in a PictureBox:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired(ByVal Lines As Integer)<br />

Picture1.Picture=<strong>AVT</strong><strong>Active</strong>Cam1.GetPicture<br />

End Sub<br />

This VB.NET example shows how to display a live video in a PictureBox:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquiredX(ByVal sender As System.Object,<br />

ByVal e As System.EventArgs) Handles <strong>AVT</strong><strong>Active</strong>Cam1.FrameAcquiredX<br />

If Not (PictureBox1.Image Is Nothing) Then PictureBox1.Image.Dispose()<br />

PictureBox1.Image = <strong>AVT</strong><strong>Active</strong>Cam1.GetPicture<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

237


<strong>Active</strong>X Reference<br />

GetPixel<br />

Description<br />

Returns the pixel value at the specified coordinates.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetPixel( X, Y )<br />

[C/C++]<br />

HRESULT GetPixel( short X, short Y, long* pValue );<br />

Data Types [VB]<br />

X: Integer<br />

Y: Integer<br />

Return value: Long<br />

Parameters [C/C++]<br />

X [in]<br />

The x-coordinate of the pixel<br />

Y [in]<br />

The y-coordinate of the pixel<br />

pValue [out,retval]<br />

Pointer to the pixel's value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid input arguments.<br />

Example<br />

This VB example grabs a frame and displays the value of the pixel at the specified coordinates.<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Grab<br />

value=<strong>AVT</strong><strong>Active</strong>Cam1.GetPixel(64,32)<br />

MsgBox value<br />

Remarks<br />

The value returned by GetPixel depends on the format of the video acquired. For monochrome video<br />

the method will retrieve the data from the internal image memory. For the color video the RGB data in<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

238


<strong>Active</strong>X Reference<br />

the specified coordinates will be converted to the luminance using the formula: L=(R+G+B) / 3.<br />

The values of the x and y coordinates must not exceed the width and height of the video frame, or the<br />

error will occur.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

239


<strong>Active</strong>X Reference<br />

GetRateList<br />

Description<br />

Returns the array of floating point values containing the frame rates available for the current video<br />

mode.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetRateList()<br />

[C/C++]<br />

HRESULT GetRateList( VARIANT* pList );<br />

Data Types [VB]<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

pList [out,retval]<br />

Pointer to the SAFEARRAY containing available frame rates<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example initializes a combo box with the available frame rates and uses it to select a specific<br />

rate:<br />

Private Sub Form_Load()<br />

RateLst = <strong>AVT</strong><strong>Active</strong>Cam1.GetRateList<br />

For i = 0 To UBound(RateLst)<br />

Combo1.AddItem (RateLst(i))<br />

Next<br />

Combo1.ListIndex = 0<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

End Sub<br />

Private Sub Combo1_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Rate = Combo1.ListIndex<br />

End Sub<br />

Remarks<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

240


<strong>Active</strong>X Reference<br />

IIDC compliant cameras support the following predefined frame rates: 1.875 fps, 3.75 fps, 7.5 fps, 15<br />

fps, 30 fps, 60 fps. Additional frame rates can be provided by the camera manufacturer. See Rate for<br />

more details.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

241


<strong>Active</strong>X Reference<br />

GetRawData<br />

Description<br />

Returns the two-dimensional array of values in the currently acquired data buffer or pointer to this<br />

buffer.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetRawData ([isPointer=False])<br />

[C/C++]<br />

HRESULT GetRawData( bool isPointer, VARIANT* pArray );<br />

Data Types [VB]<br />

isPointer: Boolean<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

isPointer [in]<br />

If false returns the array of raw data, otherwise returns pointer to data.<br />

pArray [out,retval]<br />

Pointer to the SAFEARRAY containing the raw data buffer.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example grabs a frame, retrieves the raw data array and displays the value of the specified<br />

element of the array.<br />

Dim pix as Long<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Grab<br />

RawData=<strong>AVT</strong><strong>Active</strong>Cam1.GetRawData<br />

x=16<br />

y=32<br />

pix=RawData(x,y)<br />

if pix < 0 then<br />

pix=65535-pix<br />

endif<br />

MsgBox RawData(x,y)<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

242


<strong>Active</strong>X Reference<br />

Remarks<br />

This function returns the frame data as they arrive from the camera (before being converted to an RGB<br />

image). GetRawData does not copy the image data, so the array returned contains the actual image<br />

buffer of the currently acquired frame. Modifying elements of the array will change actual pixel values in<br />

the image buffer. This can be used to perform custom image processing and display a processed<br />

image in real time. Note that this feature cannot be used in .NET as its framework creates a copy of<br />

the array returned. For direct access to raw data in C# set isPointer to True and use the poitner instead<br />

of an array.<br />

Raw image data are stored in the standard order from top to bottom, therefore the first element of the<br />

array is first pixel of the top line of the image. The type of data and dimensions of the array returned by<br />

GetRawData depends on the ouput format of the video, its horizontal width SizeX and the number of<br />

lines acquired, as specified in the following table:<br />

Format Data type Dimensions<br />

Mono (8) Byte 0 to SizeX -1, 0 to Lines - 1<br />

Raw Color (8) Byte 0 to SizeX -1, 0 to Lines - 1<br />

YUV (4:1:1) Byte 0 to SizeX*3/2 -1, 0 to Lines - 1<br />

YUV (4:2:2) Integer (word) 0 to SizeX -1, 0 to Lines - 1<br />

YUV (4:4:4) Integer (word) 0 to SizeX -1, 0 to Lines - 1<br />

Mono (16) Integer (word) 0 to SizeX -1, 0 to Lines - 1<br />

Raw Color (16) Integer (word) 0 to SizeX -1, 0 to Lines - 1<br />

RGB (8:8:8) Byte 0 to SizeX * 3 - 1, 0 to Lines - 1<br />

RGB (16:16:16) Integer (word) 0 to SizeX * 3 - 1, 0 to Lines - 1<br />

Note that <strong>AVT</strong><strong>Active</strong>Cam automatically converts YUV video outputed by a camera to 24-bit RGB.<br />

For integer (word) type of data you can receive negative numbers if pixel values exceed 32767. In C<br />

and C# you can convert signed integers to unsigned ones by using data casting. To get rid of negative<br />

values in VB and Delphi, subract them from 65535 (see the example above).<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

243


<strong>Active</strong>X Reference<br />

GetRGBPixel<br />

Description<br />

Returns the array of RGB values at the specified coordinates.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetRGBPixel( X, Y )<br />

[C/C++]<br />

HRESULT GetRGBPixel( short X, short Y, VARIANT* pArray );<br />

Data Types [VB]<br />

X, Y: Integer<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

X [in]<br />

The x-coordinate of the pixel<br />

Y [in]<br />

The y-coordinate of the pixel<br />

pArray [out,retval]<br />

Pointer to the SAFEARRAY of the dimension of 3 containing long R, G and B values of the current<br />

pixel<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid input arguments.<br />

Example<br />

This VB example grabs a frame and displays the value of the G-value of the pixel at the specified<br />

coordinates.<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Grab<br />

RGB=<strong>AVT</strong><strong>Active</strong>Cam1.GetRGBPixel(64,32)<br />

MsgBox RGB(1)<br />

Remarks<br />

The values returned by GetRGBPixel depend on the format of the video acquired. For 24-bit video the<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

244


<strong>Active</strong>X Reference<br />

method will retrieve the data from the internal image memory. For the grayscale video the R, G, and B<br />

values will be the same and equal to the luminance value in the specified coordinates.<br />

The values of the x and y coordinates must not exceed the width and height of the video frame, or the<br />

error will occur.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

245


<strong>Active</strong>X Reference<br />

GetROI<br />

Description<br />

Returns the array containing the current ROI settings.<br />

Syntax<br />

[VB]<br />

value = obj<strong>AVT</strong><strong>Active</strong>Cam.GetROI<br />

[C/C++]<br />

HRESULT GetROI( VARIANT* pROI );<br />

Data Types [VB]<br />

Return value: Variant (Array)<br />

Parameters [C/C++]<br />

pROI [out,retval]<br />

Pointer to the SAFEARRAY containing the current ROI settings as follows:<br />

ROI [0] - horizontal coordinate of the top left corner of the ROI, relative to the image origin<br />

ROI [1] - vertical coordinate of the top left corner of the ROI, relative to the image origin.<br />

ROI [2] - horizontal coordinate of the bottom right corner of the ROI, relative to the image origin.<br />

ROI [3] - vertical coordinate of the bottom right corner of the ROI, relative to the image origin.<br />

ROI [4] - lower threshold of the luminance range for image statistics calculations<br />

ROI [5] - higher threshold of the luminance range for image statistics calculations<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example displays the settings of the current ROI:<br />

ROI=<strong>AVT</strong><strong>Active</strong>Cam1.GetROI<br />

MsgBox "X1: ", ROI[0], "Y1: ", ROI[1], "X2: ", ROI [2], "Y2: ", ROI [3]<br />

Remarks<br />

For more information on the region of interest see SetROI, GetImageStat, GetHistogram.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

246


<strong>Active</strong>X Reference<br />

GetSaturationMax<br />

Description<br />

Returns the maximum value of the Saturation property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetSaturationMax()<br />

[C/C++]<br />

HRESULT GetSaturationMax(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the maximum saturation value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The saturation control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum saturation values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetSaturationMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetSaturationMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Saturation<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software saturation control, the method will generate<br />

an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

247


<strong>Active</strong>X Reference<br />

GetSaturationMin<br />

Description<br />

Returns the minimum value of the Saturation property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetSaturationMin()<br />

[C/C++]<br />

HRESULT GetSaturationMin(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the minimum saturation value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The saturation control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum saturation values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetSaturationMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetSaturationMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Saturation<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software saturation control, the method will generate<br />

an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

248


<strong>Active</strong>X Reference<br />

GetSharpnessMax<br />

Description<br />

Returns the maximum value of the Sharpness property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetSharpnessMax()<br />

[C/C++]<br />

HRESULT GetSharpnessMax(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the maximum sharpness value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The sharpness control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum sharpness values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetSharpnessMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetSharpnessMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Sharpness<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software sharpness control, the method will generate<br />

an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

249


<strong>Active</strong>X Reference<br />

GetSharpnessMin<br />

Description<br />

Returns the minimum value of the Sharpness property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetSharpnessMin()<br />

[C/C++]<br />

HRESULT GetSharpnessMin(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the minimum sharpness value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The sharpness control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum sharpness values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetSharpnessMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetSharpnessMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Sharpness<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software sharpness control, the method will generate<br />

an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

250


<strong>Active</strong>X Reference<br />

GetShutterMax<br />

Description<br />

Returns the maximum value of the Shutter property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetShutterMax()<br />

[C/C++]<br />

HRESULT GetShutterMax(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out,retval]<br />

Pointer to the maximum shutter value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The shutter control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum shutter values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetShutterMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetShutterMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Shutter<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software shutter control, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

251


<strong>Active</strong>X Reference<br />

GetShutterMin<br />

Description<br />

Returns the minimum value of the Shutter property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetShutterMin()<br />

[C/C++]<br />

HRESULT GetShutterMin(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out,retval]<br />

Pointer to the minimum shutter value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The shutter control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum shutter values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetShutterMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetShutterMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.Shutter<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software shutter control, the method will generate an<br />

error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

252


<strong>Active</strong>X Reference<br />

GetTimeStamp<br />

Description<br />

Returns the timestamp of the last acquired frame in seconds passed since the reboot of your system.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetTimestamp<br />

[C/C++]<br />

HRESULT GetTimestamp(double* pValue);<br />

Data Types [VB]<br />

Return value: Double<br />

Parameters [C/C++]<br />

pValue [out,retval]<br />

Pointer to the timestamp value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example displays the timestamp value of each frame in a text box.<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

Label1.Caption = <strong>AVT</strong><strong>Active</strong>Cam1.GetTimestamp<br />

End Sub<br />

Remarks<br />

The timestamp of a frame is measured upon the arrival of the frame into the system memory. The<br />

precision of timestamps depends on the settings of your sysem clock. It is recommended to use a time<br />

synchronization software to synchronize your system clock with public time servers.<br />

Timestamps can be used to imprint a text with the timeline information into images during the AVI<br />

capture.<br />

If this method is used in the FrameAcquired event handler, it must be called immediately after the<br />

event has been received. This will guarantee that the value of the timestamp will not be taken from the<br />

next frame while the current frame is being processed.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

253


<strong>Active</strong>X Reference<br />

GetTriggerDelayMax<br />

Description<br />

Returns the maximum value of the TriggerDelay property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetTriggerDelayMax()<br />

[C/C++]<br />

HRESULT GetTriggerDelayMax(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the maximum trigger delay value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The trigger delay control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum trigger delay values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetTriggerDelayMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetTriggerDelayMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.TriggerDelay<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software trigger delay control, the method will generate<br />

an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

254


<strong>Active</strong>X Reference<br />

GetTriggerDelayMin<br />

Description<br />

Returns the minimum value of the TriggerDelay property.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetTriggerDelayMin()<br />

[C/C++]<br />

HRESULT GetTriggerDelayMin(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the minimum trigger delay value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The trigger delay control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum trigger delay values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetTriggerDelayMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetTriggerDelayMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.TriggerDelay<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software trigger delay control, the method will generate<br />

an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

255


<strong>Active</strong>X Reference<br />

GetTriggerInfo<br />

Description<br />

Returns the array of long values containing the information releated to triggering.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetTriggerInfo()<br />

[C/C++]<br />

HRESULT GetTriggerInfo( VARIANT* pInfo );<br />

Data Types [VB]<br />

Return value: Variant (Array)<br />

Parameters [C/C++]<br />

pInfo [out,retval]<br />

Pointer to the SAFEARRAY containing the following long values in the listed order:<br />

- presence of the trigger feature (1 - available, 0 - unavailable)<br />

- supported Trigger Modes (most significant bit 0 indicates presence of mode 0, bit 1 - mode 1<br />

etc.)<br />

- presense of the trigger polarity control (1 - polarity control is available, 0 - unavailable)<br />

- number of hardware trigger sources (see TriggerSource)<br />

- presence of the software trigger (1 - available, 0 - unavailable)<br />

- presence of the TriggerDelay control (1 - available, 0 - unavailable)<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example retrieves the available trigger modes and initializes a corresponding combo box:<br />

Private Sub Form_Load()<br />

TriggerInfo = <strong>AVT</strong><strong>Active</strong>Cam1.GetTriggerInfo<br />

Modes=TriggerInfo(1)<br />

k=1<br />

For i = 0 To 15<br />

if Modes And k then<br />

Combo1.AddItem ("Mode " + cstr(i))<br />

endif<br />

k=k*2<br />

Next<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

256


<strong>Active</strong>X Reference<br />

Combo1.ListIndex = 0<br />

End Sub<br />

Private Sub Combo1_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.TriggerMode = Combo1.ListIndex<br />

End Sub<br />

Remarks<br />

Use this method to implement custom trigger-related controls.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

257


<strong>Active</strong>X Reference<br />

GetTriggerList<br />

Description<br />

Returns the array of strings containing the trigger sources supported by the currently selected camera.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetTriggerList()<br />

[C/C++]<br />

HRESULT GetTriggerList( VARIANT* pList );<br />

Data Types [VB]<br />

Return value: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

pList [out,retval]<br />

Pointer to the SAFEARRAY containing available trigger sources<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example initializes a combo box with the descriptions of available trigger sources and uses it<br />

to select a specific hardware source:<br />

Private Sub Form_Load()<br />

ModeLst = <strong>AVT</strong><strong>Active</strong>Cam1.GetTriggerList<br />

For i = 0 To UBound(TriggerLst)<br />

Combo1.AddItem (TriggerLst(i))<br />

Next<br />

Combo1.ListIndex = 0<br />

End Sub<br />

Private Sub Combo1_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.TriggerSource = Combo1.ListIndex<br />

End Sub<br />

Remarks<br />

The index of an element in the mode list can be used as an argument of the TriggerSource except for<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

258


<strong>Active</strong>X Reference<br />

the Software source which is equivalent to trigger source #7<br />

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY<br />

returned by GetTriggerList.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

259


<strong>Active</strong>X Reference<br />

GetWhiteBalanceMax<br />

Description<br />

Returns the maximum value of the WhiteBalanceUB and WhiteBalanceVR properties.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetWhiteBalanceMax()<br />

[C/C++]<br />

HRESULT GetWhiteBalanceMax(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the maximum white balance value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The white balance control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum white balance values to initialize the slider control:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceUB<br />

Slider2.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMin<br />

Slider2.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMax<br />

Slider2.Value = <strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceVR<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software white balance control, the method will<br />

generate an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

260


<strong>Active</strong>X Reference<br />

GetWhiteBalanceMin<br />

Description<br />

Returns the minimum value of the WhiteBalanceUB and WhiteBalanceVR properties.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetWhiteBalanceMin()<br />

[C/C++]<br />

HRESULT GetWhiteBalanceMin(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the minimum white balance value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

The white balance control is not available for the selected camera<br />

Example<br />

This VB example uses the minimum and maximum white balance values to initialize slider controls:<br />

Private Sub Form_Load()<br />

Slider1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMin<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMax<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceUB<br />

Slider2.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMin<br />

Slider2.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetWhiteBalanceMax<br />

Slider2.Value = <strong>AVT</strong><strong>Active</strong>Cam1.WhiteBalanceVR<br />

End Sub<br />

Remarks<br />

If the currently selected camera doesn't support software white balance control, the method will<br />

generate an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

261


<strong>Active</strong>X Reference<br />

GetWidth<br />

Description<br />

Returns the maximum horizontal size of the video frame for the currently selected Format.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetWidth()<br />

[C/C++]<br />

HRESULT GetWidth(long* pValue );<br />

Data Types [VB]<br />

Return value: Long<br />

Parameters [C/C++]<br />

pValue [out, retval]<br />

Pointer to the maximum horizontal size of the video frame<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure<br />

Example<br />

This VB example uses the minimum video width and height to initialize slider controls:<br />

Private Sub Form_Load()<br />

Slider1.Min = 0<br />

Slider1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetWidth<br />

Slider2.Min = 0<br />

Slider2.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetHeight<br />

Slider1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.SizeX<br />

Slider2.Value = <strong>AVT</strong><strong>Active</strong>Cam1.SizeY<br />

End Sub<br />

Remarks<br />

This method allows you to determine the maximum size of the video frame in a partial scan mode<br />

(Format_7). If the currently selected video mode represents a fixed format, the value returned by the<br />

method will be identical to the value returned by the SizeX property. See Mode for more details.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

262


<strong>Active</strong>X Reference<br />

Grab<br />

Description<br />

Grabs a single frame into the internal memory. If the Display property is enabled, the frame will be<br />

automatically displayed in the control window.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.Grab<br />

[C/C++]<br />

HRESULT Grab();<br />

Parameters<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example grabs a frame and saves it as a tiff file<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Grab<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SaveImage "image1.tif"<br />

Remarks<br />

If the Asynch property is set to TRUE, the Grab method will initiate the continuous acquisition and<br />

return after the first frame is acquired to the memory. Subsequent calls to the Grab method will return<br />

when the most recent frame is acquired to the memory.<br />

If the Asynch property is set to FALSE, the method will initiate a single frame acquisition (One Shot<br />

mode) and return after the frame is acquired to the memory.<br />

The FrameAcquired event will be raised after the Grab call is completed.<br />

Note that the use of the Grab method is incompatible with the Acquire property set to TRUE. Make<br />

sure to set Acquire to FALSE when using Grab.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

263


<strong>Active</strong>X Reference<br />

LoadChannel<br />

Description<br />

Loads a group of previously stored settings from form the selected channel of the camera's internal<br />

EEPROM.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.LoadChannel( Channel )<br />

[C/C++]<br />

HRESULT LoadChannel( short Channel );<br />

Data Types [VB]<br />

Channel: Integer<br />

Return value: None<br />

Parameters [C/C++]<br />

Channel [in]<br />

The index of the camera's memory channel (0-7). Channel 0 corresponds to the factory default<br />

settings.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example restores the default factory camera settings:.<br />

Private Sub FactoryButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.LoadChannel (0)<br />

End Sub<br />

Remarks<br />

The number of memory channels available for the current camera is returned by GetMaxChannel.<br />

Note that some cameras might not support memory channels.<br />

Calling this method with "-1" argument will refresh <strong>AVT</strong><strong>Active</strong>Cam properties synchronizing them with<br />

the current camera settings. This is a recommended operation if the camera settings has been<br />

changed by hardware controls or by direct writes to 1394 registers via WriteRegister.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

264


<strong>Active</strong>X Reference<br />

LoadImage<br />

Description<br />

Loads the image from the specified file into the internal frame buffer and displays it in <strong>AVT</strong><strong>Active</strong>Cam<br />

window. The method supports BMP, TIFF and JPEG formats.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.LoadImage File<br />

[C/C++]<br />

HRESULT LoadImage( bstr File );<br />

Data Types [VB]<br />

File: String<br />

Parameters [C/C++]<br />

File [in]<br />

The string containing the file name and path<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid file name.<br />

Example<br />

This VB example shows how to load an image file.<br />

<strong>AVT</strong><strong>Active</strong>Cam1.LoadImage "C:\\myframe.jpg"<br />

Remarks<br />

When the image has been loaded into the internal buffer, the FrameLoaded event will be fired.<br />

The image format is defined by the file extension indicated in the File argument. Use "bmp" for a BMP<br />

file, "tif" for TIFF, and "jpg" for JPEG. If none of these extensions are found in the File string, an error<br />

will occur.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

265


<strong>Active</strong>X Reference<br />

LoadSequence<br />

Description<br />

Loads a fragment of the specified AVI or TIFF file into the memory sequence.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.LoadSequence File [,Start, End ]<br />

[C/C++]<br />

HRESULT LoadSequence( bstr File, long Start, long End );<br />

Data Types [VB]<br />

File: String<br />

Start: Long<br />

End: Long<br />

Parameters [C/C++]<br />

File [in]<br />

The string containing the file name and path. The extension of the file must be "avi" or "tif".<br />

Start [in]<br />

The zero-based index of the first frame of the video fragment to be loaded. If omitted, frame 0 will<br />

be used.<br />

End [in]<br />

The zero-based index of the last frame of the video fragment to be loaded. If omitted, the last<br />

frame will be used.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid file name or file not found.<br />

Example<br />

This VB example loads a video sequence from a TIFF file into the memory and plays it.<br />

<strong>AVT</strong><strong>Active</strong>Cam1.LoadSequence "video1.tif"<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OpenVideo "ram"<br />

<strong>AVT</strong><strong>Active</strong>Cam1.PlayVideo<br />

Remarks<br />

If the system memory doesn't have enough capacity to accommodate the specified video fragment, the<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

266


<strong>Active</strong>X Reference<br />

video will be truncated to fit the maximum memory size available for the application.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

267


<strong>Active</strong>X Reference<br />

LoadSettings<br />

Description<br />

Loads a group of previously stored camera settings from the system registry.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.LoadSettings( Profile )<br />

[C/C++]<br />

HRESULT LoadSettings( BSTR Profile );<br />

Data Types [VB]<br />

Profile: String<br />

Return value: None<br />

Parameters [C/C++]<br />

Profile [in]<br />

The name of the registry key in which the settings are saved.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example restores previously saved camera settings:<br />

Private Sub LoadSettings_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.LoadSettings ("FluorescentHighRes")<br />

End Sub<br />

Remarks<br />

This method verifies if the currently selected camera model coincides with the model for which the<br />

settings were saved. If the model is different, the function will return an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

268


<strong>Active</strong>X Reference<br />

OverlayClear<br />

Description<br />

Clears graphics and text from the overlay.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.OverlayClear<br />

[C/C++]<br />

HRESULT OverlayClear();<br />

Parameters<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example moves a red rectangle over the live image by repeatedly erasing and<br />

drawing it:<br />

Private Sub Form_Load()<br />

x = 0<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayColor = RGB(255, 0, 0)<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Overlay = True<br />

End Sub<br />

Dim x As Integer<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayClear<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayRectangle x, 10, x + 50, 80, 3<br />

x = x + 2<br />

If x = <strong>AVT</strong><strong>Active</strong>Cam1.SizeX Then<br />

x = 0<br />

End If<br />

End Sub<br />

Remarks<br />

To create animation effects, use this method in combination with OverlayColor, OverlayPixel,<br />

OverlayLine, OverlayRectangle, OverlayEllipse, OverlayText.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

269


<strong>Active</strong>X Reference<br />

OverlayEllipse<br />

Description<br />

Draws an empty or filled ellipse in the overlay.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.OverlayEllipse StartX, StartY, EndX, EndY [,Width = 1]<br />

[C/C++]<br />

HRESULT OverlayEllipse( short StartX, short StartY, short EndX, short EndY,<br />

short Width );<br />

Data Types [VB]<br />

StartX, StartY, EndX, EndY: Integer<br />

Width: Integer (optional)<br />

Parameters [C/C++]<br />

StartX [in], StartY [in]<br />

Pixel coordinates of the top left corner of the ellipse's bounding rectangle, relative to the image<br />

origin.<br />

EndX [in], EndY [in]<br />

Pixel coordinates of the bottom right corner of the ellipse's bounding rectangle, relative to the<br />

image origin.<br />

Width [in]<br />

Width of the outline of the ellipse in pixels. If zero, a filled ellipse is drawn.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example overlays a filled red ellipse on the live video:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayEllipse 100,100,200,200,0<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayColor=RGB(255,0,0)<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Overlay= True<br />

Remarks<br />

To draw a filled ellipse, use Width=0. Also see OverlayColor, OverlayClear.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

270


<strong>Active</strong>X Reference<br />

OverlayLine<br />

Description<br />

Draws a line in the overlay.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.OverlayLine StartX, StartY, EndX, EndY [,Width = 1]<br />

[C/C++]<br />

HRESULT OverlayLine( short StartX, short StartY, short EndX, short EndY,<br />

short Width);<br />

Data Types [VB]<br />

StartX, StartY, EndX, EndY: Integer<br />

Width: Integer (optional)<br />

Parameters [C/C++]<br />

StartX [in], StartY [in]<br />

Pixel coordinates of the starting point of the line, relative to the image origin.<br />

EndX [in], EndY [in]<br />

Pixel coordinates of the end point of the line, relative to the image origin.<br />

Width [in]<br />

Width of the line in pixels.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example overlays a filled red line of width 3 on the live video:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayLine 100,100,200,200,3<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayColor=RGB(255,0,0)<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Overlay= True<br />

Remarks<br />

To draw multiple lines, call this method several times. Also see OverlayColor, OverlayClear.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

271


<strong>Active</strong>X Reference<br />

OverlayPixel<br />

Description<br />

Draws a pixel in the overlay.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.OverlayPixel X, Y<br />

[C/C++]<br />

HRESULT OverlayPixel( short X, short Y );<br />

Data Types [VB]<br />

X, Y : Integer<br />

Parameters [C/C++]<br />

X [in], Y [in]<br />

Coordinates of the pixel relative to the image origin.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example overlays four red pixels on the live video:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayPixel 100,100<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayPixel 100,200<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayPixel 200,100<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayPixel 200,200<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayColor=RGB(255,0,0)<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Overlay= True<br />

Remarks<br />

To draw custom shapes, call this method multiple times. Also see OverlayColor, OverlayClear.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

272


<strong>Active</strong>X Reference<br />

OverlayRectangle<br />

Description<br />

Draws an empty or filled rectangle in the overlay.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.OverlayRectangle StartX, StartY, EndX, EndY [,Width = 1]<br />

[C/C++]<br />

HRESULT OverlayRectangle( short StartX, short StartY, short EndX, short<br />

EndY, short Width);<br />

Data Types [VB]<br />

StartX, StartY, EndX, EndY: Integer<br />

Width: Integer (optional)<br />

Parameters [C/C++]<br />

StartX [in], StartY [in]<br />

Pixel coordinates of the top left corner of the rectangle, relative to the image origin.<br />

EndX [in], EndY [in]<br />

Pixel coordinates of the bottom right corner of the rectangle, relative to the image origin.<br />

Width [in]<br />

Width of the outline of the rectangle in pixels. If zero, a filled rectangle is drawn.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example overlays a filled red rectangle on the live video:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayRectangle 100,100,200,200,0<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayColor=RGB(255,0,0)<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Overlay= True<br />

Remarks<br />

To draw a filled rectangle, use Width=0. To draw multiple rectangles, call this method several times.<br />

Also see OverlayColor, OverlayClear.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

273


<strong>Active</strong>X Reference<br />

OverlayText<br />

Description<br />

Draws a string of text in the overlay.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.OverlayText X, Y, Text<br />

[C/C++]<br />

HRESULT OverlayText( short X, short Y, bstr Text );<br />

Data Types [VB]<br />

X, Y : Integer<br />

Text: String<br />

Parameters [C/C++]<br />

X [in], Y [in]<br />

Coordinates of the text relative to the image origin.<br />

Text [in]<br />

The string containing the text to be drawn.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example overlays a string of text on the live video:<br />

Dim Font As New StdFont<br />

Font.Name = "Arial"<br />

Font.Size = 18<br />

Font.Bold = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayFont = Font<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayText 10, 100, "<strong>AVT</strong><strong>Active</strong>Cam rules!"<br />

<strong>AVT</strong><strong>Active</strong>Cam1.OverlayColor = RGB(255, 0, 0)<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Overlay = True<br />

Remarks<br />

To select the font for drawing text strings, use OverlayFont. To draw multiple strings, call this method<br />

several times. Also see OverlayColor, OverlayClear.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

274


<strong>Active</strong>X Reference<br />

ReadBlock<br />

Description<br />

Performs an asynchronous 1394 block transfer from a specified 1394 offset<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.ReadBlock Offset, pBuffer, nBytes<br />

[C/C++]<br />

HRESULT ReadBlock( long Offset, long pBuffer, long nBytes );<br />

Data Types [VB]<br />

Offset: Long<br />

pBuffer: Long<br />

nBytes: Long<br />

Parameters [C/C++]<br />

Reg [in]<br />

The 32-bit offset into the 1394 base address FFFF 0000 0000 h at which a 1394 asynchronous<br />

read will be performed.<br />

pBuffer<br />

Pointer to a buffer that will receive the data read from the specified camera offset<br />

nBytes<br />

The number of bytes to read from the specified offset<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This C++ example reads a block of 128 bytes from a specified offset in the camera address space:<br />

unsigned char buffer[128]<br />

<strong>AVT</strong><strong>Active</strong>Cam.ReadBlock(0xF4000000,(long)buffer,128);<br />

Remarks<br />

Offsets starting with F (least four significant bits are on) will be treated as 32-bit offsets to the 1394<br />

base adress FFFF 0000 0000 h. Other addresses will be treated as offsets into the Camera Control<br />

and Status register, which usually starts with FFFF F0F0 0000 h.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

275


<strong>Active</strong>X Reference<br />

For more information on the IIDC command registers refer to "IIDC 1394-based Digital Camera<br />

Specification, Version 1.31" published by the 1394 Trade Association.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

276


<strong>Active</strong>X Reference<br />

ReadRegister<br />

Description<br />

Reads a quadlet from the selected 1394 register of the current camera.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.ReadRegister( Reg )<br />

[C/C++]<br />

HRESULT ReadRegister( long Reg, long* pValue );<br />

Data Types [VB]<br />

Reg: Long<br />

Return value: Long<br />

Parameters [C/C++]<br />

Reg [in]<br />

The 32-bit offset of the register into the 1394 base address FFFF 0000 0000 h or the offset of the<br />

register into the Camera Control and Status Register FFFF F0F0 0000 h.<br />

pValue [out,retval]<br />

Pointer to the registers's 32-bit value<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Examples<br />

This C++ example reads the value of the hue inquiry register using the absolute register offset:<br />

value=<strong>AVT</strong><strong>Active</strong>Cam.ReadRegister(0xF0F00510);<br />

This VB example reads the value of the hue inquiry register using the relative register offset:<br />

value=<strong>AVT</strong><strong>Active</strong>Cam.ReadRegister(&H510)<br />

Remarks<br />

Addresses starting with F (least four significant bits are on) will be treated as 32-bit offsets to the 1394<br />

base adress FFFF 0000 0000 h. Other addresses will be treated as offsets into the Camera Control<br />

and Status register, which usually starts with FFFF F0F0 0000 h.<br />

For more information on the IIDC command registers refer to "IIDC 1394-based Digital Camera<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

277


<strong>Active</strong>X Reference<br />

Specification, Version 1.31" published by the 1394 Trade Association.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

278


<strong>Active</strong>X Reference<br />

ReadSIO<br />

Description<br />

Reads the specified number of characters from the serial input/output port (SIO). The function will wait<br />

for the specified number of milliseconds for data in the receive buffer.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.ReadSIO (Count [, Timeout ])<br />

[C/C++]<br />

HRESULT ReadSIO( long Count, long Timeout, bstr* pInput );<br />

Data Types [VB]<br />

Count: Long<br />

Timeout: Long (optional)<br />

Return value: String<br />

Parameters [C/C++]<br />

Count [in]<br />

The number of characters to read. If the amount of characters in the receive buffer is less than this<br />

parameter, <strong>AVT</strong><strong>Active</strong>Cam will keep checking the buffer until the timeout occurs.<br />

Timeout [in]<br />

The maximum time to wait for data in the receive buffer, in milliseconds. If this parameter is<br />

omitted, the method will return immediately.<br />

pInput [out,retval]<br />

String containing the data from the receive buffer. If the timeout occurs, the string will be empty.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid input argument.<br />

Example<br />

The following VB example configures the SIO, sends a command string to an external device and<br />

displays a 2-character response. The expected response time is less than 2000 ms:<br />

Dim Str As String<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Settings "9600,N,8,1"<br />

<strong>AVT</strong><strong>Active</strong>Cam1.WriteSIO "move 1200,3600\r"<br />

Str=<strong>AVT</strong><strong>Active</strong>Cam1.ReadSIO(2,2000)<br />

MsgBox Str<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

279


<strong>Active</strong>X Reference<br />

Remarks<br />

This method is available only for cameras that have the SIO feature compliant with IIDC 1.31<br />

specifications.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

280


<strong>Active</strong>X Reference<br />

SaveBkg<br />

Description<br />

Stores a dark or bright background image on the hard drive. The background image is produced as a<br />

result of temporal frame averaging.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SaveBkg Type [, Frames = 8 ]<br />

[C/C++]<br />

HRESULT SaveBkg( short Type, short Frames );<br />

Data Types [VB]<br />

Type: Integer<br />

Frames: Integer<br />

Parameters [C/C++]<br />

Type [in]<br />

Enumerated integer indicating the type of background to be saved: 1 - Dark Field, 2 - Bright Field<br />

Frames [in]<br />

Number of consecutive frames to be averaged for background calculation.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example uses two buttons to save dark and bright background images:<br />

Private Sub SaveDark_Click<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SaveBkg (1)<br />

End Sub<br />

Private Sub SaveBright_Click<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SaveBkg (2)<br />

End Sub<br />

Remarks<br />

In general, to perform the background correction you have to prepare two auxiliary images: dark field<br />

and bright field. Dark field is a background image captured with no light transmitted through the<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

281


<strong>Active</strong>X Reference<br />

camera lens; it is a measure of the dark current in the CCD. The bright field is a background image<br />

captured with the maximum light transmitted and no objects in the filed of view; it is a measure of the<br />

difference in pixel-to-pixel sensitivity as well as the uniformity of illumination While capturing the bright<br />

field image you should adjust the light intensity so that it stays just below the saturation level of the<br />

camera. That will provide the maximum dynamic range for the image acquisition. To control the<br />

saturation for monochrome cameras, use the Saturated Palette. For more information on the<br />

background correction see BkgCorrect.<br />

When the background saving is complete, the FrameRecorded event is fired.<br />

Background data are stored as raw image files in the Bkgnd subfolder of <strong>AVT</strong><strong>Active</strong>Cam program<br />

directory. See BkgName for more details.<br />

Note that this function will only work if the Acquire property is set to True or the Grab method is<br />

repeatedly called.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

282


<strong>Active</strong>X Reference<br />

SaveImage<br />

Description<br />

Saves the current frame buffer in the specified image file. The method supports BMP, TIFF and JPEG<br />

formats with a selectable compression.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SaveImage File [, Compression]<br />

[C/C++]<br />

HRESULT SaveImage( bstr File, long Compression );<br />

Data Types [VB]<br />

File: String<br />

Compression: Integer (optional)<br />

Parameters [C/C++]<br />

File [in]<br />

The string containing the file name and path<br />

Compression [in]<br />

The file compression ratio<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid file name.<br />

Example<br />

This VB example saves the current frame in a JPEG file with the specified compression quality.<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SaveImage "C:\\myframe.jpg", 75<br />

Remarks<br />

The image file format in which the frame will be saved is defined by the file extension indicated in the<br />

File argument. Use "bmp" for a BMP file, "tif" for TIFF, and "jpg" for JPEG. If none of these extensions<br />

are found in the File string, an error will occur.<br />

When the image saving is complete, the FrameRecorded event is fired.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

283


<strong>Active</strong>X Reference<br />

The way the Compression argument is treated depends on the file format.<br />

BMP files:<br />

Compression = 0 - no compression<br />

Compression = 1 - RLE compression (not implemented in this version)<br />

TIFF files:<br />

Compression = 0 - no compression<br />

Compression = 1 - LZW compression<br />

Compression = 2 - PackBits compression<br />

JPEG files:<br />

Compression is an integer value in the range 0-100 specifying the quality of the image. Lower<br />

values correspond to a lower quality with a higher compression, while higher values correspond to<br />

a higher quality with a lower compression.<br />

If Compression parameter is omitted, BMP and TIFF files will be recorded with no compression, while<br />

JPEG files will be recorded with quality of 75.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

284


<strong>Active</strong>X Reference<br />

SaveChannel<br />

Description<br />

Writes the current settings to the selected channel of the camera's internal EEPROM.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SaveChannel Channel<br />

[C/C++]<br />

HRESULT SaveChannel( short Channel );<br />

Data Types [VB]<br />

Channel: Integer<br />

Return value: None<br />

Parameters [C/C++]<br />

Channel [in]<br />

The index of the camera's memory channel (1-7).<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example saves the current camera settings in memory channel 1.<br />

Private Sub SaveSettingsButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SaveChannel (1)<br />

End Sub<br />

Remarks<br />

The number of memory channels available for the current camera is returned by GetMaxChannel.<br />

Channel 0 corresponds to the factory default settings and cannot be overwritten. Note that some<br />

cameras might not support memory channels.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

285


<strong>Active</strong>X Reference<br />

SaveSettings<br />

Description<br />

Stores the current camera settings in the system registry.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SaveSettings( Profile )<br />

[C/C++]<br />

HRESULT SaveSettings( BSTR Profile );<br />

Data Types [VB]<br />

Profile: String<br />

Return value: None<br />

Parameters [C/C++]<br />

Profile [in]<br />

The name of the registry key in which the settings will be saved.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example saves the current camera settings in the registry:<br />

Private Sub SaveSettings_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SaveSettings ("FluorescentHighRes")<br />

End Sub<br />

Remarks<br />

Also see LoadSettings.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

286


<strong>Active</strong>X Reference<br />

SetCodec<br />

Description<br />

Sets the name of the codec (video compressor) to be used during the AVI capture.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SetCodec Name [, Quality, Datarate, Keyframe ])<br />

[C/C++]<br />

HRESULT SetCodec(bstr Name [, long Quality = 0, long Datarate = 0, long<br />

Keyframe = 0 ]);<br />

Data Types [VB]<br />

Name: String<br />

Quality: Integer<br />

Datarate: Integer<br />

Keyframe: Integer<br />

Parameters [C/C++]<br />

Name [in]<br />

String specifying the name of the feature<br />

Quality [out, retval]<br />

Numerical value of the quality parameter used by the codec, if supported.<br />

Datarate [out, retval]<br />

Datarate in kb/sec used by the codec, if supported.<br />

Keyframe [out, retval]<br />

The amount of frames after which a key frame is recorded, if supported.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure to set the codec<br />

Example<br />

The following VB example demonstrates the use of the DivX codec:<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetCodec "DivX 5.0.2 Codec"<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

End Sub<br />

Private Sub StartButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.StartCapture "c:\mycapture.avi"<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

287


<strong>Active</strong>X Reference<br />

End Sub<br />

Private Sub StopButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.StopCapture<br />

End Sub<br />

The following VB example demonstrates how to set up a codec by its index in the system:<br />

CodecList=<strong>AVT</strong><strong>Active</strong>Cam1.GetCodecList<br />

CodecName=CodecList(9)<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetCodec CodecName<br />

Remarks<br />

This method allows you to set only the basic compression parameters which may not be supported by<br />

certain codecs. To adjust the internal parameters of a codec, use ShowCodecDlg.<br />

The name of the codec must be precise in order for SetCodec to work. An extra space in the name of<br />

the codec may cause this function to fail. To avoid errors, It is recommended to use an index of the<br />

codec rather than its name, as shown in the second example above.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

288


<strong>Active</strong>X Reference<br />

SetFeature<br />

Description<br />

Sets the value of the specified camera feature.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SetFeature Name, Value<br />

[C/C++]<br />

HRESULT SetFeature(bstr Name, float Value );<br />

Data Types [VB]<br />

Name: String<br />

Value: Single<br />

Parameters [C/C++]<br />

Name [in]<br />

String specifying the name of the feature. In accordance with IIDC 1.31, one of the following<br />

names can be used:<br />

"Brightness", "Exposure", "Sharpness", "WhiteBalanceVR", "WhiteBalanceUB", "Hue",<br />

"Saturation", "Gamma", "Shutter", "Gain", "TriggerDelay".<br />

Value [out, retval]<br />

Value of the feature to be set<br />

Return Values<br />

S_OK<br />

Success<br />

E_INVALIDARG<br />

Feature does not exist<br />

E_OUTOFMEMORY<br />

Value is out of range<br />

E_FAIL<br />

Failure to set the feature<br />

Example<br />

The following VB example demonstrates the use of a scroll control for real-time adjustment of the<br />

brigthness feature.<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Value = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeature("Brightness")<br />

HScroll1.Min = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeatureMin("Brightness")<br />

HScroll1.Max = <strong>AVT</strong><strong>Active</strong>Cam1.GetFeatureMax("Brightness")<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

289


<strong>Active</strong>X Reference<br />

Private Sub HScroll1_Scroll()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeature("Brightness", HScroll1.Value)<br />

End Sub<br />

The following VB example demonstrates the use of the absolute control of the shutter:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeatureControl "Shutter", "Absolute", True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeature "Shutter", 0.025<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeatureControl "Shutter", "Absolute", False<br />

Remarks<br />

Depending on the absolute feature control being enabled or disabled, this method will set the value of<br />

the feature in absolute or relative units.<br />

If the currently selected camera does not support the specified feature or if the feature is read-only, the<br />

method will generate an error.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

290


<strong>Active</strong>X Reference<br />

SetFeatureControl<br />

Description<br />

Sets the specified control mode for the selected camera feature.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.GetFeatureControl ( Name, Control, Value )<br />

[C/C++]<br />

HRESULT GetFeatureControl ( bstr Name, bstr Control, BOOL Value );<br />

Data Types [VB]<br />

Name: String<br />

Control: String<br />

Value: Boolean<br />

Parameters [C/C++]<br />

Name [in]<br />

String specifying the name of the feature. In accordance with IIDC 1.31, one of the following<br />

names can be used:<br />

"Brightness", "Exposure", "Sharpness", "WhiteBalanceVR", "WhiteBalanceUB", "Hue",<br />

"Saturation", "Gamma", "Shutter", "Gain", "TriggerDelay".<br />

Control [in]<br />

String specifying the control mode to set. Use one of the following inquiries:<br />

"OnOff" - to turn the feature on or off<br />

"Absolute" - to enable or disable the absolute control of the feature<br />

"Auto" - to enable or disable the auto-control of the feature<br />

"OnePush" - to initiate the one-push operation<br />

pValue [out, retval]<br />

TRUE if the control mode has to be enabled and FALSE otherwise<br />

Return Values<br />

S_OK<br />

Success<br />

E_INVALIDARG<br />

Feature or inquiry does not exist<br />

E_FAIL<br />

Failure<br />

Example<br />

The following VB example demonstrates the use of the absolute control of the shutter and switch it<br />

back to the ralative mode:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

291


<strong>Active</strong>X Reference<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeatureControl "Shutter", "Absolute", True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeature "Shutter", 0.025<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetFeatureControl "Shutter", "Absolute", False<br />

Remarks<br />

If the currently selected camera does not support the specified feature or inquiry, the method will<br />

generate an error.<br />

If the absolute control of the featue is disabled, the feature will be controlled in relative units.<br />

If the auto-control mode is disabled, the feature will be controlled manually (e.g. via SetFeature).<br />

For the one-push control mode only TRUE can be used as a value.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

292


<strong>Active</strong>X Reference<br />

SetGains<br />

Description<br />

Sets the levels for the software gain control. If the LUTMode property is enabled, this operation<br />

multiplies the value of each pixel by a given floating point factor thus changing the contrast of the video<br />

or its color components.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SetGains fR [, fG, fB, fGb]<br />

[C/C++]<br />

HRESULT SetGains (fR , fG, fB, fGb)<br />

Data Types [VB]<br />

fR, fG, fB, fGb: Single<br />

Parameters [C/C++]<br />

fR [in]<br />

Gain factor for the red channel. If the rest of arguments are -1 or omitted, this factor will be applied<br />

to all color channels in the video.<br />

fG [in]<br />

Gain factor for the green channel. If four arguments are used, this factor will be applied to Gr pixels<br />

of the raw Bayer image.<br />

fR [in]<br />

Gain factor for the blue channel.<br />

fGb [in]<br />

Gain factor for the Gb pixels of the raw Bayer image. If -1 or omitted, fGb=fG.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example uses three sliders to increase the gain for R, G and B channels up to the<br />

factor of 10:<br />

Private Sub Form_Load()<br />

<strong>Active</strong>BF1.Acquire=True<br />

HScroll1.Min = 1<br />

HScroll1.Max = 10<br />

HScroll2.Min = 1<br />

HScroll2.Max = 10<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

293


<strong>Active</strong>X Reference<br />

HScroll3.Min = 1<br />

HScroll3.Max = 10<br />

<strong>AVT</strong><strong>Active</strong>Cam1.LUTMode=True<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

L1 = HScroll1.Value<br />

L2 = HScroll2.Value<br />

L3 = HScroll3.Value<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetGains L1, L2, L3<br />

End Sub<br />

Private Sub HScroll2_Scroll()<br />

L1 = HScroll1.Value<br />

L2 = HScroll2.Value<br />

L3 = HScroll3.Value<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetGains L1, L2, L3<br />

End Sub<br />

Remarks<br />

The gain adjustment will be applied to the video only when LUTMode is enabled. Otherwise the original<br />

pixel values will remain intact.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

294


<strong>Active</strong>X Reference<br />

SetImageWindow<br />

Description<br />

Copies pixel values from the two-dimensional array into the selected window of the current frame.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SetImageWindow X, Y, A<br />

[C/C++]<br />

HRESULT SetImageWindow( short X, short Y, VARIANT* pArray );<br />

Data Types [VB]<br />

X,Y: Integer<br />

A: Variant (SAFEARRAY)<br />

Parameters [C/C++]<br />

X [in], Y[in]<br />

The x- and y- frame coordinates at which the top left corner of the window will be copied.<br />

pArray [out,retval]<br />

Pointer to the SAFEARRAY containing the pixel values to be copied.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure<br />

E_INVALIDARG<br />

Input array has wrong data type<br />

Example<br />

This VB example uses the FrameAcquired event to increase the brightness in the central area of the<br />

live image:<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Display = False<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

End Sub<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

xc = <strong>AVT</strong><strong>Active</strong>Cam1.SizeX / 2<br />

yc = <strong>AVT</strong><strong>Active</strong>Cam1.SizeY / 2<br />

w = <strong>AVT</strong><strong>Active</strong>Cam1.GetImageWindow(xc - 70, yc - 50, 140, 100)<br />

For y = 0 To UBound(w, 2)<br />

For x = 0 To UBound(w, 1)<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

295


<strong>Active</strong>X Reference<br />

pix = w(x, y) + 50<br />

If pix > 255 Then<br />

pix = 255<br />

End If<br />

w(x, y) = pix<br />

Next<br />

Next<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetImageWindow xc - 70, yc - 50, w<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Draw<br />

End Sub<br />

Remarks<br />

The array submitted to SetImageWindow must have the type and dimensions corresponding of those<br />

of the frame buffer, as specified in the following table:<br />

Format Data type Horizontal Dimension<br />

8-bit monochrome Byte Width<br />

16-bit gray monochrome Integer (word) Width<br />

24-bit RGB Byte Width*3<br />

48-bit RGB Integer (word) Width*3<br />

where Width is the intended horizontal size of the window in in pixels. If the dimensions of the window<br />

are too large to accomodate the frame size, they will be clipped to the frame boundaries.<br />

For real-time image processing SetImageWindow should be used in conjunction with the Draw<br />

method.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

296


<strong>Active</strong>X Reference<br />

SetIsoSpeed<br />

Description<br />

Sets the camera's isochronous transmission speed in Mbps/sec.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SetIsoSpeed Speed<br />

[C/C++]<br />

HRESULT SetIsoSpeed( short Speed );<br />

Data Types [VB]<br />

Speed: Integer<br />

Return value: None<br />

Parameters [C/C++]<br />

Speed [in]<br />

Isochronous transmission speed to be set. If zero, the camera will adjust its transmission speed for<br />

the maximum available bandwidth.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example sets the transmission speed of the camera to 200 Mbps:<br />

speed=<strong>AVT</strong><strong>Active</strong>Cam1.SetIsoSpeed (200)<br />

MsgBox speed<br />

Remarks<br />

Possible values of the Speed parameter are 0, 100, 200, 400 for 1394a cameras and 0, 100, 200, 400,<br />

800 for 1394b cameras. By default the transmission speed is set to the maximum value available for<br />

the current 1394 configuration. Reducing the transmission speed can be useful in multiple cameras<br />

situation in order to limit the bandwidth available to each camera.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

297


<strong>Active</strong>X Reference<br />

SetLevels<br />

Description<br />

Sets the levels for the Window/Level operation. If the LUTMode property is enabled, the operation<br />

performs a linear scaling of the histogram of each video frame thus optimizing the contrast, brightness<br />

and color of the video.<br />

The lower limit indicates the darkest pixel value that will be mapped to the black (zero) level of the<br />

image or its color component. The upper limit indicates the brightest pixel value that will be mapped to<br />

the maximum pixel value of the image or its color component. Increasing the lower limit will make the<br />

shadows of the image darker. Decreasing the upper limit will make the highlights of the image<br />

brighter.<br />

This method also allows you to assign the limits automatically by selecting the Auto Fit or/and Auto<br />

White Balance options. The Auto Fit optimizes the values of the lower and upper limits by providing the<br />

maximum contrast between the brightest and darkest pixel in the image. The Auto White Balance<br />

optimizes the values of the limits of each color component so that the average color of the image (or<br />

selected ROI) becomes gray.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SetLevels minR, maxR [, minB, maxG, minB , maxB]<br />

[C/C++]<br />

HRESULT SetLevels(short minR, short maxR, short minG, short maxG, short<br />

minB, short maxB);<br />

Data Types [VB]<br />

minR, maxR: Integer<br />

minG, maxG, minB, maxB: Integer (optional)<br />

Parameters [C/C++]<br />

minR [in], maxR [in]<br />

Lower and upper limits for a monochrome image or for the red channel of a color image. The<br />

values are given in percents of the maximum pixel value for the currently selected image format.<br />

If minR is set to -1, all the limits will be set automatically based on the Auto Fit algorithm.<br />

If maxR is set to -1, all the limits will be adjusted automatically based on the Auto White Balance<br />

algorithm.<br />

minB [in], maxB [in], minG [in], maxG [in]<br />

Lower and upper limits for the green and blue channels. If these parameters are omitted or set to<br />

zero, the green and blue channels are scaled proportionally with the red channel thus preserving<br />

the colors on the image. These parameters are ignored for a monochrome video.<br />

Return Values<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

298


<strong>Active</strong>X Reference<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example uses a slider to adjust the brightness and contrast of the video without<br />

changing its color:<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

HScroll1.Min = 0<br />

HScroll1.Max = 100<br />

HScroll2.Min = 0<br />

HScroll2.Max = 100<br />

<strong>AVT</strong><strong>Active</strong>Cam1.LUTMode=True<br />

End Sub<br />

Private Sub HScroll1_Scroll()<br />

L1 = HScroll1.Value<br />

L2 = HScroll2.Value<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetLevels L1, L2<br />

End Sub<br />

Private Sub HScroll2_Scroll()<br />

L1 = HScroll1.Value<br />

L2 = HScroll2.Value<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetLevels L1, L2<br />

End Sub<br />

Remarks<br />

The limits for the Window/Level operation are given in percents of the maximum pixel value for the<br />

currently selected image format.<br />

The Auto Fit and Auto White Balance algorithms work on the currently selected SetROI. When<br />

applying the Auto White Balance, make sure to select the ROI corresponding to the gray area in the<br />

image.<br />

To retrieve the values of the limits assigned by SetLevels, use the GetLevels method.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

299


<strong>Active</strong>X Reference<br />

SetLUT<br />

Description<br />

Assigns the array of values for the software lookup table. If the LUTMode is active, the pixel values in<br />

the incoming frames will be transformed based on a corresponding factor in the LUT array.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SetLUT LUT, Channels<br />

[C/C++]<br />

HRESULT SetLUT(VARIANT LUT, short Channels);<br />

Data Types [VB]<br />

LUT: Variant (Array)<br />

Channels: Integer<br />

Parameters [C/C++]<br />

LUT<br />

SAFEARRAY of floating point factors to be used in the lookup table. The value of 1.0 corresponds<br />

to the maximum pixel value in the currently selected video format.<br />

Channels<br />

Number of color channels in the submitted array. Can be one of the following values:<br />

1 - the array contains a one-channel LUT which will be used for all color components<br />

3 - the array contains a three-channel LUT where the first 1/3 of elements represent the red<br />

channel, the second 1/3 of elements - green channel and the last 1/3 of elements - blue channel.<br />

4 - the array contains a four-channel LUT used for the operation on a raw Bayer video. The first<br />

1/4 of elements represent the R channel, the second 1/4 of elements - Gr channel, the third 1/4<br />

of elements - B channel and the last 1/4 of elements - Gb channel.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

The following VB example prepares a 3-channel linear LUT with an amplified green channel and<br />

applies it to the video:<br />

Dim LUT(256 * 3) As Single<br />

For i = 0 To 255<br />

LUT(i) = i/255.<br />

Next<br />

For i = 256 To 511<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

300


<strong>Active</strong>X Reference<br />

LUT(i) = (i-256)*2/255.<br />

Next<br />

For i = 512 To 767<br />

LUT(i) = (i-512)/255.<br />

Next<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetLUT A, 3<br />

Remarks<br />

The LUT processing in <strong>AVT</strong><strong>Active</strong>Cam works in two stages. An array submitted by SetLUT and<br />

containing coefficients in the range 0 - 1.0 is converted to the internal LUT array with the number of<br />

elements and their values corresponding to the actual range of pixels in the currently selected format.<br />

This guarantees that the input LUT will have an identical effect on images of different types and pixel<br />

depths.<br />

For example, if a submitted array has 256 elements with values gradually increasing from 0 to 0.5 and<br />

the currently selected format is Mono12 (for which the maximum pixel value is 4095), it will be<br />

converted to the internal LUT with 4096 elements and values gradually increasing from 0 to 2047. If the<br />

format is changed to Mono8, the internal LUT will automatically shrink to 256 elements with values<br />

gradually increasing from 0 to 255. If LUTMode is active, the value of each pixel will be mapped to the<br />

value of a corresponding element in the internal LUT.<br />

For a single-channel LUT the input value of a pixel is used directly as an index in the LUT array. Multichannel<br />

LUTs are logically divided into several subsequent LUTs starting from the red channel array.<br />

Therefore, if a submitted lookup table contains 768 elements and 3 channels, the first 256 elements<br />

will be used to index and remap red pixels, the second 256 elements - green pixels, and the last 256<br />

elements - blue pixels.<br />

To obtain the values of the current lookup table, use the GetLUT method.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

301


<strong>Active</strong>X Reference<br />

SetROI<br />

Description<br />

Sets the rectangular region of interest and luminance range for the histogram and image statistics<br />

calculations.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SetROI X1, Y1, X2, Y2 [,L1 , L2]<br />

[C/C++]<br />

HRESULT SetROI( long X1, long Y1, long X2, long Y2, long L1, long L2);<br />

Data Types [VB]<br />

X1, Y1, X2, Y2: Long<br />

L1, L2: Long (optional)<br />

Parameters [C/C++]<br />

X1 [in], Y1 [in]<br />

Pixel coordinates of the top left corner of the ROI, relative to the image origin.<br />

X2 [in], Y2 [in]<br />

Pixel coordinates of the bottom right corner of the ROI, relative to the image origin.<br />

L1 [in], L2 [in]<br />

Optional threshold values specifying the luminance range for image statistics calculations. The<br />

luminance range of interest is defined as follows:<br />

L1


<strong>Active</strong>X Reference<br />

Y1 = 0<br />

X2 = <strong>AVT</strong><strong>Active</strong>Cam1.SizeX<br />

Y2 = <strong>AVT</strong><strong>Active</strong>Cam1.SizeY<br />

L1 = 0<br />

L2 = 255<br />

End Sub<br />

Private Sub HScrollThreshold1_Scroll()<br />

L1 = HScrollThreshold1.Value<br />

LabelThreshold1.Caption = L1<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetROI X1, Y1, X2, Y2, L1, L2<br />

End Sub<br />

Remarks<br />

To draw a filled rectangle, use Width=0. To draw multiple rectangles, call this method several times.<br />

Also see OverlayColor, OverlayClear.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

303


<strong>Active</strong>X Reference<br />

SetSIO<br />

Description<br />

Sets the configuration of serial input/output (SIO).<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SetSIO [Settings]<br />

[C/C++]<br />

HRESULT SetSIO([bstr* Setting ]);<br />

Data Types [VB]<br />

Settings: String (optional)<br />

Return value: Integer<br />

Parameters [C/C++]<br />

Settings [in]<br />

String specifying the serial device's baud rate, parity, data bit, and stop bit attributes. It is<br />

composed of four settings and has the following format: "BBBB,P,D,S", where BBBB is the baud<br />

rate, P is the parity, D is the number of data bits, and S is the number of stop bits. If this parameter<br />

is an empty string or omitted, the following settings will be used: "9600, N, 8, 1".<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid input arguments.<br />

Example<br />

The following VB example opens the serial port on the board, writes a command to it and closes the<br />

port.<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetSIO 0,"9600,N,8,1"<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SerialWrite "ssf 10000\n",1000<br />

Remarks<br />

This method is available only for cameras that have the SIO feature compliant with IIDC 1.31<br />

specifications.<br />

The valid baud rates are: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

304


<strong>Active</strong>X Reference<br />

The valid parity values are: E (Even), N (None), O (Odd).<br />

The valid data bit values are: 7, 8<br />

The valid stop bit values are: 1, 1.5, 2<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

305


<strong>Active</strong>X Reference<br />

ShowCodecDlg<br />

Description<br />

Displays the configuration dialog for the currently selected codec. The dialog is provided by the codec's<br />

manufacturer.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.ShowCodecDlg<br />

[C/C++]<br />

HRESULT ShowCodecDlg( );<br />

Parameters<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure<br />

Example<br />

This VB example displays the configuration dialog for the DivX codec:<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SetCodec "DivX 5.0.2 Codec"<br />

<strong>AVT</strong><strong>Active</strong>Cam1.ShowCodecDlg<br />

Remarks<br />

The settings selected in the codec configuration dialog will be remembered as long as the<br />

corresponding <strong>AVT</strong><strong>Active</strong>Cam control remains in the memory.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

306


<strong>Active</strong>X Reference<br />

ShowCompressionDlg<br />

Description<br />

Displays the compression dialog for the AVI recording. The dialog allows you to select a desired codec<br />

and adjust its parameters.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.ShowCompressionDlg<br />

[C/C++]<br />

HRESULT ShowCompressionDlg( );<br />

Parameters<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure<br />

Example<br />

This VB example demonstrates a simple video recording application<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire=True<br />

End Sub<br />

Private Sub CompressionButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.ShowCompressionDlg<br />

End Sub<br />

Private Sub StartButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.StartCapture "c:\mycapture.avi"<br />

End Sub<br />

Private Sub StopButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.StopCapture<br />

End Sub<br />

Remarks<br />

The settings selected in the compression dialog are remembered as long as the corresponding<br />

<strong>AVT</strong><strong>Active</strong>Cam control remains in the memory.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

307


<strong>Active</strong>X Reference<br />

ShowProperties<br />

Description<br />

Displays <strong>AVT</strong><strong>Active</strong>Cam property pages in runtime mode.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.ShowProperties [ EnableCamList, Page ]<br />

[C/C++]<br />

HRESULT ShowProperties( bool bEnableCamList, short iPage );<br />

Data Types<br />

EnableCamList: Boolean<br />

Page: Integer<br />

Parameters [C/C++]<br />

bEnableCamList [in]<br />

Set to TRUE to enable the camera selection box in the Source property page, or set to FALSE to<br />

disable it<br />

Page [in]<br />

Index of the property page to be activated. Use one of the following values to activate a specific<br />

property page:<br />

0 or omitted - the property page which was active last time the property pages were used<br />

1 - the Source page<br />

2 - the Format page<br />

3 - the Exposure page<br />

4 - the Color page<br />

5 - the Advanced page<br />

6 - the Display page<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure<br />

Example<br />

This VB example demonstrates how to display the property pages in runtime mode.<br />

Private Sub Properties_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.ShowProperties False<br />

End Sub<br />

Remarks<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

308


<strong>Active</strong>X Reference<br />

Setting the EnableCamList parameter to False allows you to disable the camera selection box in the<br />

Source property page thus preventing a user from switching to another camera. This is a<br />

recommended scenario in case your application uses several <strong>AVT</strong><strong>Active</strong>Cam objects configured for<br />

different cameras. See PropertyPages for more information.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

309


<strong>Active</strong>X Reference<br />

SoftTrigger<br />

Description<br />

Sets/resets the software trigger signal.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.SoftTrigger State<br />

[C/C++]<br />

HRESULT SoftTrigger( bool State);<br />

Parameters<br />

State: Boolean<br />

Parameters [C/C++]<br />

State [in]<br />

Set to TRUE to set the software trigger, or set to FALSE to reset it<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example demonstrates the use of the software trigger:<br />

Private Sub Form_Load()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Asynch = False<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Acquire = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.Trigger = True<br />

<strong>AVT</strong><strong>Active</strong>Cam1.TriggerSource = 7<br />

End Sub<br />

Private Sub SoftTrig_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.SoftTrigger (True)<br />

End Sub<br />

Remarks<br />

Use SoftTrigger to generate the software trigger signal. Note that this method will only have effect if<br />

Trigger is enabled and TriggerSource is set to 7 (software trigger) . The trigger signal will typically<br />

initiate an acquisition of a single frame. Note that for TriggerModes 0, 2 and 4 you don't need to reset<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

310


<strong>Active</strong>X Reference<br />

the software trigger, as the trigger will clear itself.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

311


<strong>Active</strong>X Reference<br />

StartCapture<br />

Description<br />

Starts time-lapse video capture to the specified AVI file or series of image files (bmp, tif or jpg). Use<br />

StopCapture to end video capture.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.StartCapture File [, Timelapse = 0, Playrate = 0 ]<br />

[C/C++]<br />

HRESULT StartCapture( bstr File, float Timelapse, float Playrate );<br />

Data Types [VB]<br />

File : String<br />

Timelapse : Single (optional)<br />

Playrate : Single (optional)<br />

Parameters [C/C++]<br />

File [in]<br />

The string containing the path to the avi file or image file (bmp, tif or jpg).<br />

Timelapse [in]<br />

The interval between consecutive frames in seconds<br />

Playrate [in]<br />

The frame rate at which <strong>AVT</strong> file will be played in frames per second<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid file name.<br />

Example<br />

This VB example demonstrates how to capture the video to an AVI file at the current frame rate:.<br />

Private Sub StartButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.StartCapture "c:\mycapture.avi"<br />

End Sub<br />

Private Sub StopButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.StopCapture<br />

End Sub<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

312


<strong>Active</strong>X Reference<br />

This C# example demonstrates how to capture a series of TIFF images at 0.5 sec interval:<br />

private void startbutton_Click(object sender, System.EventArgs e)<br />

{<br />

ax<strong>AVT</strong><strong>Active</strong>Cam1.StartCapture("c:\\images\\myframe.tif", 0.5, 0.);<br />

}<br />

private void stopbutton_Click(object sender, System.EventArgs e)<br />

{<br />

ax<strong>AVT</strong><strong>Active</strong>Cam1.StopCapture();<br />

}<br />

Remarks<br />

To record compressed AVI files, use ShowCompressionDlg, SetCodec and ShowCodecDlg. If no<br />

codec has been selected, <strong>AVT</strong><strong>Active</strong>Cam will record AVI files in the uncompressed format, 8- or 24bits<br />

per pixel.<br />

If bmp, tif or jpg extension is specified for the file path, the file name is used as a template to which the<br />

ordinal number of the frame captured is appended. In the C# example above consecutive frames will<br />

be stored to files "myframe00001.tif", myframe00002.tif" and so on. Note that TIF format can store 16and<br />

48-bit per pixel images.<br />

If Timelapse is not specified, the video will be recorded at the maximum frame rate defined by the<br />

camera and system throughput.<br />

If Playrate is not specified, the video will be played back at the same rate it was captured.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

313


<strong>Active</strong>X Reference<br />

StopCapture<br />

Description<br />

Stops video capture to an AVI file or series of images.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.StopCapture<br />

[C/C++]<br />

HRESULT StopCapture();<br />

Parameters<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure<br />

Example<br />

This VB example demonstrates how to capture the video to an AVI file with 0.5 sec time lapse between<br />

the frames.<br />

Private Sub StartButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.StartCapture "c:\mycapture.avi", 0.5<br />

End Sub<br />

Private Sub StopButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.StopCapture<br />

End Sub<br />

Remarks<br />

Use this method to end the video capture initiated by StartCapture.<br />

When the video capture is complete, the CaptureCompleted event is fired.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

314


<strong>Active</strong>X Reference<br />

WriteBlock<br />

Description<br />

Performs an asynchronous 1394 block transfer to a specified 1394 offset.<br />

Syntax<br />

[VB]<br />

Value=obj<strong>AVT</strong><strong>Active</strong>Cam.WriteBlock( Offset, pBuffer, nBytes )<br />

[C/C++]<br />

HRESULT WriteBlock( long Offset, long pBuffer, long nBytes );<br />

Data Types [VB]<br />

Offset: Long<br />

pBuffer: Long<br />

nBytes: Long<br />

Return value: Long<br />

Parameters [C/C++]<br />

Reg [in]<br />

The 32-bit offset into the 1394 base address FFFF 0000 0000 h at which a 1394 asynchronous<br />

write will be performed.<br />

pBuffer<br />

Pointer to a buffer that contains the to be written at the specified camera offset<br />

nBytes<br />

The number of bytes to be written at the specified offset<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This C++ example writes a block of 16 bytes at a specified offset in the camera address space:<br />

unsigned char<br />

buffer[16]={1,1,1,1,2,2,2,2,0x10,0x10,0x10,0x10,0xf0,0xf0,0xf0,0xf0};<br />

<strong>AVT</strong><strong>Active</strong>Cam.WriteBlock(0xF4000000,(long)buffer,16);<br />

Remarks<br />

Offsets starting with F (least four significant bits are on) will be treated as 32-bit offsets to the 1394<br />

base adress FFFF 0000 0000 h. Other addresses will be treated as offsets into the Camera Control<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

315


<strong>Active</strong>X Reference<br />

and Status register, which usually starts with FFFF F0F0 0000 h.<br />

For more information on the IIDC command registers refer to "IIDC 1394-based Digital Camera<br />

Specification, Version 1.31" published by the 1394 Trade Association.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

316


<strong>Active</strong>X Reference<br />

WriteRegister<br />

Description<br />

Writes a quadlet to the selected 1394 register of the current camera.<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.WriteRegister Reg, Value<br />

[C/C++]<br />

HRESULT WriteRegister( long Reg, long Value );<br />

Data Types [VB]<br />

Reg: Long<br />

Parameters [C/C++]<br />

Reg [in]<br />

The 32-bit offset of the register into the 1394 base address FFFF 0000 0000 h or the offset of the<br />

register into the Camera Control and Status Register FFFF F0F0 0000 h.<br />

Value [in]<br />

The value to be written in the register<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This C++ example writes a value to the gain register using the absolute register offset.<br />

value=<strong>AVT</strong><strong>Active</strong>Cam.WriteRegister(0xF0F0088C,0x10);<br />

This VB example writes a value to the gain register using the relative register offset.<br />

value=<strong>AVT</strong><strong>Active</strong>Cam.WriteRegister(&H820,&H10)<br />

Remarks<br />

Addresses starting with F (least four significant bits are on) will be treated as 32-bit offsets to the 1394<br />

base adress FFFF 0000 0000 h. Other addresses will be treated as offsets into the Camera Control<br />

and Status register, which usually starts with FFFF F0F0 0000 h.<br />

For more information on the IIDC command registers refer to "IIDC 1394-based Digital Camera<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

317


<strong>Active</strong>X Reference<br />

Specification, Version 1.30" published by the 1394 Trade Association.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

318


<strong>Active</strong>X Reference<br />

WriteSIO<br />

Description<br />

Writes the string of characters to the serial input/output port (SIO).<br />

Syntax<br />

[VB]<br />

obj<strong>AVT</strong><strong>Active</strong>Cam.WriteSIO Output [, Timeout ]<br />

[C/C++]<br />

HRESULT WriteSIO( bstr strOutput, long Timeout );<br />

Data Types [VB]<br />

Output: String<br />

Timeout: Long (optional)<br />

Parameters [C/C++]<br />

pOutput [in]<br />

The output string<br />

Timeout [in]<br />

The timeout in milliseconds. The function will try to write the data to the serial device for the<br />

specified period of time. If the data could not be written within that time, the timeout error flag will<br />

be raised. If this parameter is omitted, the timeout will never occur.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

E_INVALIDARG<br />

Invalid input argument.<br />

Example<br />

The following VB example configures the SIO and sends a string of characters to an external device.<br />

<strong>AVT</strong><strong>Active</strong>Cam.Settings "9600,N,8,1"<br />

<strong>AVT</strong><strong>Active</strong>Cam.WriteSIO "<strong>AVT</strong><strong>Active</strong>Cam is the most flexible 1394 SDK\r",1000<br />

Remarks<br />

This method is available only for cameras that have the SIO feature compliant with IIDC 1.31<br />

specifications.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

319


<strong>Active</strong>X Reference<br />

4.3 Events<br />

The following events are generated by <strong>AVT</strong><strong>Active</strong>Cam control:<br />

FrameAcquired Called after a frame has been acquired into the internal memory<br />

FrameAcquiredX Called after a frame has been acquired into the internal memory<br />

(multithreaded version)<br />

RawFrameAcquired Called after a raw frame has arrived from the camera<br />

FrameReady Called if a decoded frame is submitted for display<br />

FrameDropped Called if a frame is dropped during the video acquisition<br />

Timeout Called if the acquisition timeout has expired<br />

FormatChanged Called if the video size or pixel format has changed<br />

FrameRecorded Called when a frame is added to a video file, image file or<br />

memory sequence<br />

FrameLoaded Called when a frame is loaded from a video file, image file or<br />

memory sequence<br />

CaptureCompleted Called when the capture into a video file or memory sequence is<br />

stopped<br />

CameraPlugged Called if a camera gets connected to the 1394 bus<br />

CameraUnplugged Called if a camera gets disconnected from the 1394 bus<br />

MouseDown Called when the mouse button is pressed inside the control<br />

window<br />

MouseUp Called when the mouse button is released inside the control<br />

window<br />

MouseDblClick Called when the mouse button is double-clicked inside the<br />

control window<br />

MouseMove Called when the mouse button has moved inside the control<br />

window<br />

Scroll Called when the live video display has been scrolled<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

320


<strong>Active</strong>X Reference<br />

CameraPlugged<br />

Description<br />

This event is fired each time a camera gets connected to the 1394 bus.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_CameraPlugged(ByVal Camera As Integer)<br />

[C/C++]<br />

HRESULT Fire_CameraPlugged(SHORT Camera);<br />

Data Types [VB]<br />

Camera: Integer<br />

Parameters [C/C++]<br />

Camera<br />

The index of the camera that has been connected.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the CameraPlugged and CameraUnplugged events to detect changes on the<br />

1394 bus:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_CameraPlugged(ByVal Camera As Integer)<br />

Dim Msg As String<br />

Msg = "Camera #" + Str(Camera) + " has been connected"<br />

MsgBox Msg<br />

End Sub<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_CameraUnplugged(ByVal Camera As Integer)<br />

Dim Msg As String<br />

Msg = "Camera #" + Str(Camera) + " has been disconnected"<br />

MsgBox Msg<br />

End Sub<br />

Remarks<br />

The CameraPlugged event will only be raised, if <strong>AVT</strong><strong>Active</strong>Cam Driver is installed for the camera<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

321


<strong>Active</strong>X Reference<br />

being connected. See Driver Setup for more details.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

322


<strong>Active</strong>X Reference<br />

CameraUnplugged<br />

Description<br />

This event is fired each time a camera gets disconnected from the 1394 bus.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_CameraUnplugged(ByVal Camera As Integer)<br />

[C/C++]<br />

HRESULT Fire_CameraUnplugged(SHORT Camera);<br />

Data Types [VB]<br />

Camera: Integer<br />

Parameters [C/C++]<br />

Camera<br />

The index of the camera that has been disconnected.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the CameraUnplugged to detect when the currently selected camera is<br />

unplugged:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_CameraUnplugged(ByVal Camera As Integer)<br />

If <strong>AVT</strong><strong>Active</strong>Cam1.Camera = Camera Then<br />

MsgBox "Currently selected camera has been disconnected"<br />

End IfEnd Sub<br />

Remarks<br />

The CameraUnplugged event will only be raised, if <strong>AVT</strong><strong>Active</strong>Cam Driver is installed for the camera<br />

being connected. See Driver Setup for more details.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

323


<strong>Active</strong>X Reference<br />

CaptureCompleted<br />

Description<br />

This event is fired when the capture into the memory sequence or video file is stopped.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_CaptureCompleted(ByVal Frames As Long)<br />

[C/C++]<br />

HRESULT Fire_CaptureCompleted(long Frames);<br />

Data Types [VB]<br />

Frames: long<br />

Parameters [C/C++]<br />

Frames<br />

The number of frames recorded.<br />

Example<br />

This VB example records 1000 frames into the memory sequence and uses the CaptureCompleted<br />

event to save it in an AVI file.<br />

Private Sub StartButton_Click()<br />

<strong>AVT</strong><strong>Active</strong>Cam1.StartSequenceCapture 1000<br />

End Sub<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_CaptureCompleted(ByVal Frames As Long)<br />

SaveSequence "C:\\video.avi"<br />

End Sub<br />

Remarks<br />

One of the following conditions must be met, before the CaptureCompleted event will be fired:<br />

Capture has stopped automatically, because the specified number of frames has been acquired.<br />

Capture to a file has stopped automatically because the device is full.<br />

Capture has been stopped explicitly by calling the StopCapture method.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

324


<strong>Active</strong>X Reference<br />

FormatChanged<br />

Description<br />

This event is fired each time the frame size or pixel format of the camera changes.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_FormatChanged()<br />

[C/C++]<br />

HRESULT Fire_FormatChanged();<br />

Parameters [C/C++]<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the FormatChanged event to generate a sound signal:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FormatChanged()<br />

Beep<br />

End Sub<br />

Remarks<br />

The FrameDropped event is raised when the frame size or pixel format of the camera changes. Your<br />

application may use this event to perform certain actions when the video format is changed through the<br />

Property Pages of <strong>AVT</strong><strong>Active</strong>Cam. See ShowProperties for more details.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

325


<strong>Active</strong>X Reference<br />

FrameAcquired<br />

Description<br />

This event is fired each time a frame has been acquired and decoded.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_FrameAcquired()<br />

[C/C++]<br />

HRESULT Fire_FrameAcquired();<br />

Parameters [C/C++]<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the FrameAcquired event to access and display a pixel value in real time:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired()<br />

Label1.Caption = <strong>AVT</strong><strong>Active</strong>Cam1.GetPixel(16, 32)<br />

End Sub<br />

Remarks<br />

One of the following conditions must be met, before the FrameAcquired event will be fired:<br />

The Acquire property has been set to TRUE<br />

The Grab method has been called.<br />

The FrameAcquired event is fired from the interface thread to provide compatibility with all types of<br />

<strong>Active</strong>X containers. For applications created in VB.NET, C# and C++ it is recommended to use the<br />

FrameAcquiredX event.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

326


<strong>Active</strong>X Reference<br />

FrameAcquiredX<br />

Description<br />

This event is fired each time a frame has been acquired and decoded. Unlike FrameAcquired event it<br />

is fired from a processing thread providing a higher efficiency. Might not work in certain containers.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_FrameAcquiredX()<br />

[C/C++]<br />

HRESULT Fire_FrameAcquiredX();<br />

Parameters [C/C++]<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB.NET example uses the FrameAcquiredX event to access and display a pixel value in real<br />

time:<br />

Private Sub Ax<strong>AVT</strong><strong>Active</strong>Cam1_FrameAcquired(ByVal sender As System.Object, ByVal e As<br />

Ax<strong>AVT</strong>ACTIVECAMLib._I<strong>AVT</strong><strong>Active</strong>CamEvents_FrameAcquiredEvent)<br />

Label1.Text = Ax<strong>AVT</strong><strong>Active</strong>Cam1.GetPixel(16, 32)<br />

End Sub<br />

Remarks<br />

This event is provided for applications that can process events fired from a processing thread<br />

(VB.NET, C#, C++). For applications created in VB6, VBA, Delphi and Matlab use FrameAcquired<br />

event instead.<br />

One of the following conditions must be met, before the FrameAcquiredX event will be fired:<br />

The Acquire property has been set to TRUE<br />

The Grab method has been called.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

327


<strong>Active</strong>X Reference<br />

FrameDropped<br />

Description<br />

This event is fired each time a frame is dropped during the video acquisition.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_FrameDropped()<br />

[C/C++]<br />

HRESULT Fire_FrameDropped();<br />

Parameters [C/C++]<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the FrameDropped event to generate a sound signal:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameDropped()<br />

Beep<br />

End Sub<br />

Remarks<br />

The FrameDropped event is raised if a video FIFO overflow occurs during the acquisition of a frame<br />

resulting in a frame drop. The most common reasons for this are low bandwidth (several cameras<br />

connected to the 1394 board) or CPU overload.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

328


<strong>Active</strong>X Reference<br />

FrameLoaded<br />

Description<br />

This event is fired each time a frame has been loaded from an image file (LoadImage).<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_FrameLoaded(ByVal Frame As Long)<br />

[C/C++]<br />

HRESULT Fire_FrameLoaded();<br />

Data Types [VB]<br />

Frame: long<br />

Parameters [C/C++]<br />

Frame<br />

The zero-based index of the last loaded frame.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the FrameLoaded event to update a sequence frame counter:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameLoaded((ByVal Frame As Long))<br />

Label1.Caption = Frame<br />

End Sub<br />

Remarks<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

329


<strong>Active</strong>X Reference<br />

FrameReady<br />

Description<br />

This event is fired each time a decoded frame is submitted for display.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_FrameReady()<br />

[C/C++]<br />

HRESULT Fire_FrameReady();<br />

Parameters [C/C++]<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This MFC fragment uses the FrameReady event to perform a post-processing of the color video:<br />

....<br />

m_<strong>AVT</strong><strong>Active</strong>Cam.SetDisplay(FALSE)<br />

....<br />

void CGcamProDlg::OnFrameReady<strong>AVT</strong><strong>Active</strong>Cam1()<br />

{<br />

BYTE *ptr=m_<strong>AVT</strong><strong>Active</strong>Cam.GetImagePointer(0,<br />

m_<strong>AVT</strong><strong>Active</strong>Cam.GetSizeY()-1);<br />

int nSize=m_<strong>AVT</strong><strong>Active</strong>Cam.GetSizeX()*m_<strong>AVT</strong><strong>Active</strong>Cam.GetSizeY();<br />

int max=255;<br />

for(int y=0;y


<strong>Active</strong>X Reference<br />

In order to synchronize the post-processing with image display, the Display property should be set to<br />

False and Draw method used in the end of the event handler.<br />

One of the following conditions must be met, before the FrameReady event will be fired:<br />

The Acquire property has been set to TRUE<br />

The Grab method has been called.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

331


<strong>Active</strong>X Reference<br />

FrameRecorded<br />

Description<br />

This event is fired each time a frame has been added to a video file (StartCapture). It is also fired when<br />

an image file has been saved (SaveImage, SaveBkg).<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_FrameRecorded(ByVal Frame As Long)<br />

[C/C++]<br />

HRESULT Fire_FrameRecorded();<br />

Data Types [VB]<br />

Frame: long<br />

Parameters [C/C++]<br />

Frame<br />

The zero-based index of the last recorded frame.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the FrameRecorded event to update a sequence frame counter:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_FrameRecorded(ByVal Frame As Long)<br />

Label1.Caption = Frame<br />

End Sub<br />

Remarks<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

332


<strong>Active</strong>X Reference<br />

MouseDblClick<br />

Description<br />

This event is fired each time the mouse button is double-clicked inside the control window. Returns the<br />

coordinates of a pixel pointed by the cursor.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_MouseDblClick( ByVal X As Integer, ByVal Y As<br />

Integer )<br />

[C/C++]<br />

HRESULT Fire_MouseDblClick( SHORT X, SHORT Y );<br />

Data Types [VB]<br />

X: Integer<br />

Y: Integer<br />

Parameters [C/C++]<br />

X [in]<br />

The X-coordinate of the pixel pointed by the cursor.<br />

Y [in]<br />

The Y-coordinate of the pixel pointed by the cursor.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the MouseDblClick event to open the Properties dialog:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_MouseDblClick(ByVal X As Integer, ByVal Y As<br />

Integer)<br />

Dim Value As Integer<br />

Value = <strong>AVT</strong><strong>Active</strong>Cam1.ShowProperties<br />

End Sub<br />

Remarks<br />

Note that the coordinates returned by this event refer to the image coordinate system, not to the screen<br />

coordinates.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

333


<strong>Active</strong>X Reference<br />

Set the Acquire and ScrollBars properties to TRUE in order to display a scrollable live video and get a<br />

visual access to all parts of the image.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

334


<strong>Active</strong>X Reference<br />

MouseDown<br />

Description<br />

This event is fired each time the mouse button is pressed inside the control window. Returns the<br />

coordinates of a pixel pointed by the cursor.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_MouseDown( ByVal X As Integer, ByVal Y As<br />

Integer )<br />

[C/C++]<br />

HRESULT Fire_MouseDown( SHORT X, SHORT Y );<br />

Data Types [VB]<br />

X: Integer<br />

Y: Integer<br />

Parameters [C/C++]<br />

X [in]<br />

The X-coordinate of the pixel pointed by the cursor.<br />

Y [in]<br />

The Y-coordinate of the pixel pointed by the cursor.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the MouseDown event to display the value of the pixel pointed by the cursor:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_MouseDown(ByVal X As Integer, ByVal Y As<br />

Integer)<br />

Dim Value As Integer<br />

Value = <strong>AVT</strong><strong>Active</strong>Cam1.GetPixel(X, Y)<br />

MsgBox Value<br />

End Sub<br />

Remarks<br />

Note that the coordinates returned by this event refer to the image coordinate system, not to the screen<br />

coordinates.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

335


<strong>Active</strong>X Reference<br />

Set the Acquire and ScrollBars properties to TRUE in order to display a scrollable live video and get a<br />

visual access to all parts of the image.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

336


<strong>Active</strong>X Reference<br />

MouseMove<br />

Description<br />

This event is fired each time the mouse has moved inside the control window. Returns the coordinates<br />

of a pixel pointed by the cursor.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_MouseMove( ByVal X As Integer, ByVal Y As<br />

Integer )<br />

[C/C++]<br />

HRESULT Fire_MouseMove( SHORT X, SHORT Y );<br />

Data Types [VB]<br />

X: Integer<br />

Y: Integer<br />

Parameters [C/C++]<br />

X [in]<br />

The X-coordinate of the pixel pointed by the cursor.<br />

Y [in]<br />

The Y-coordinate of the pixel pointed by the cursor.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the MouseMove event to display the value of the pixel pointed by the cursor:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_MouseMove(ByVal X As Integer, ByVal Y As<br />

Integer)<br />

Dim Value As Integer<br />

Value = <strong>AVT</strong><strong>Active</strong>Cam1.GetPixel(X, Y)<br />

Label1.Caption = Value<br />

End Sub<br />

Remarks<br />

Note that the coordinates returned by this event refer to the image coordinate system, not to the screen<br />

coordinates.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

337


<strong>Active</strong>X Reference<br />

Set the Acquire and ScrollBars properties to TRUE in order to display a scrollable live video and get a<br />

visual access to all parts of the image.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

338


<strong>Active</strong>X Reference<br />

MouseUp<br />

Description<br />

This event is fired each time the mouse button is released inside the control window. Returns the<br />

coordinates of a pixel pointed by the cursor.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_MouseUp( ByVal X As Integer, ByVal Y As Integer<br />

)<br />

[C/C++]<br />

HRESULT Fire_MouseUp( SHORT X, SHORT Y );<br />

Data Types [VB]<br />

X: Integer<br />

Y: Integer<br />

Parameters [C/C++]<br />

X [in]<br />

The X-coordinate of the pixel pointed by the cursor.<br />

Y [in]<br />

The Y-coordinate of the pixel pointed by the cursor.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the MouseUp event to display the value of the pixel pointed by the cursor:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_MouseUp(ByVal X As Integer, ByVal Y As<br />

Integer)<br />

Dim Value As Integer<br />

Value = <strong>AVT</strong><strong>Active</strong>Cam1.GetPixel(X, Y)<br />

MsgBox Value<br />

End Sub<br />

Remarks<br />

Note that the coordinates returned by this event refer to the image coordinate system, not to the screen<br />

coordinates.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

339


<strong>Active</strong>X Reference<br />

Set the Acquire and ScrollBars properties to TRUE in order to display a scrollable live video and get a<br />

visual access to all parts of the image.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

340


<strong>Active</strong>X Reference<br />

RawFrameAcquired<br />

Description<br />

This event is fired each time a raw frame has arrived from the camera, before it is submitted to<br />

<strong>AVT</strong><strong>Active</strong>Cam's decoding and processing chain. Can be used in combination with GetRawData to<br />

perform a preprocessing on raw images.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_RawFrameAcquired()<br />

[C/C++]<br />

HRESULT Fire_RawFrameAcquired();<br />

Parameters [C/C++]<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This MFC fragment uses the RawFrameAcquired event to perform a preprocessing (invert operation)<br />

of the raw video:<br />

void CGcamProDlg::OnRawFrameAcquired<strong>AVT</strong><strong>Active</strong>Cam1()<br />

{<br />

VARIANT v=m_<strong>AVT</strong><strong>Active</strong>Cam.GetRawData(true);<br />

int nSize=m_<strong>AVT</strong><strong>Active</strong>Cam.GetSizeX()*m_<strong>AVT</strong><strong>Active</strong>Cam.GetSizeY();<br />

BYTE* ptr=(BYTE*)v.pcVal;<br />

int max=255;<br />

for(int y=0;y


<strong>Active</strong>X Reference<br />

Scroll<br />

Description<br />

This event is fired each time the live video display has been scrolled. Returns the horizontal and<br />

vertical scroll positions.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_Scroll( ByVal X As Integer, ByVal Y As Integer<br />

)<br />

[C/C++]<br />

HRESULT Fire_Scroll( SHORT ScrollX, SHORT ScrollY );<br />

Data Types [VB]<br />

ScrollX: Integer<br />

ScrollY: Integer<br />

Parameters [C/C++]<br />

ScrollX [in]<br />

The X-coordinate of the pixel pointed by the cursor.<br />

ScrollY [in]<br />

The Y-coordinate of the pixel pointed by the cursor.<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the Scroll event to display the position of the live video in the control window:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_Scroll(ByVal ScrollX As Integer, ByVal ScrollY<br />

As Integer)<br />

Label1.Caption = ScrollX<br />

Label2.Caption = ScrollY<br />

End Sub<br />

Remarks<br />

Note that the scroll positions returned by this event refer to the image coordinate system, not to the<br />

screen coordinates.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

342


<strong>Active</strong>X Reference<br />

The ScrollBars properties to TRUE in order for the Scroll event to be fired.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

343


<strong>Active</strong>X Reference<br />

Timeout<br />

Description<br />

This event is fired each time a timeout occurs during the acquisition of a frame.<br />

Syntax<br />

[VB]<br />

Private Sub obj<strong>AVT</strong><strong>Active</strong>Cam_Timeout()<br />

[C/C++]<br />

HRESULT Fire_Timout();<br />

Parameters [C/C++]<br />

None<br />

Return Values<br />

S_OK<br />

Success<br />

E_FAIL<br />

Failure.<br />

Example<br />

This VB example uses the Timeout event to generate a sound signal:<br />

Private Sub <strong>AVT</strong><strong>Active</strong>Cam1_Timeout()<br />

Beep<br />

End Sub<br />

Remarks<br />

The Timeout event is raised when the amount of seconds specified by the Timeout property passes<br />

after the Grab method has been called and no frame has been acquired. The event will be raised<br />

repeatedly if the control is set in the continuous acquisition mode (Acquire is TRUE). The most<br />

common reason for a timeout is a missing trigger signal in the Trigger mode.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

344


<strong>Active</strong>X Reference<br />

4.4 Property Pages<br />

The following property pages are available in <strong>AVT</strong><strong>Active</strong>Cam control:<br />

Source Used to select the properties specifying the source for the video<br />

input<br />

Format Used to select the properties specifying the format of the video<br />

Exposure Used to select the properties specifying the exposure features of<br />

the video<br />

Color Used to select the properties specifying the color features of the<br />

video<br />

Advanced Used to select the properties specifying the advanced features of<br />

the video<br />

Display Used to select the properties specifying the display settings<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

345


<strong>Active</strong>X Reference<br />

Source<br />

This property page is used to select the properties specifying the source for the video input.<br />

Select from the following options:<br />

Camera<br />

Displays the vendor's name and model of the currently selected camera. If you have more than one<br />

camera connected to the 1394 board, you can switch to another camera by choosing the<br />

corresponding camera name in the list. Equivalent to the Camera property.<br />

Acquire<br />

Lets you enable the continuous acquisition mode. If this box is checked, the board will continuously<br />

acquire the video into the internal image memory. If the control is visible, the live video will be<br />

displayed in the control window. Equivalent to the Acquire property.<br />

Asynchronous mode<br />

Lets you select an acquisition mode. Check this box to set the board to the asynchronous mode. In<br />

this mode the board will continuously transfer pixels into the host memory, allowing your application<br />

to process a captured frame while the acquisition of the next frame occurs. The asynchronous mode<br />

provides the fastest and most efficient setup for real-time image processing. However, if processing<br />

occurs at a slower rate than pixels are acquired, using this mode may result in the decomposition of<br />

images and loss of data. Clear this check box to set the board to the synchronous mode. In this<br />

mode the acquisition of the next frame will be initiated upon the capture command. The synchronous<br />

mode is slower, but it guarantees the wholeness of images during real-time processing. Equivalent<br />

to the Asynch property.<br />

Timeout<br />

Use this option to set the number of seconds to wait for a frame to be acquired. Typically used to<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

346


<strong>Active</strong>X Reference<br />

assign the timeout when the Trigger mode is active. If the timeout expires, the Timeout event event<br />

will be raised. Equivalent to the Timeout property.<br />

ISO speed<br />

Lets you choose the camera's isochronous transmission speed in Mbps/sec. Possible values are<br />

100, 200, 400 for 1394a cameras and 100, 200, 400, 800 for 1394b cameras. By default the<br />

transmission speed is set to the maximum value available for the current 1394 configuration.<br />

Reducing the transmission speed can be useful in multiple cameras situations in order to limit the<br />

bandwidth available to each camera. Equivalent to the SetIsoSpeed method.<br />

Trigger<br />

Select this check box to set the current camera to the trigger mode. This mode is typically used with<br />

an asynchronously resetable camera. The acquisition of a frame will occur upon receiving a signal<br />

from an external hardware trigger. To set the camera to the continuous mode, clear the Trigger<br />

check box. Equivalent to the Trigger property.<br />

Trigger Source<br />

Lets you select the source for the trigger signal. Depending on a camera, there may be one or more<br />

hardware trigger inputs as well as the software trigger. If the software trigger is available and<br />

selected, use the Set button to set and reset the trigger event. If the camera doesn't suppot trigger<br />

source selection as defined by the IIDC 1.31 specifications, this option will be unavailable. Equivalent<br />

to the TriggerSource property and SoftTrigger method.<br />

Trigger mode<br />

Lets you select the trigger mode as defined by the IIDC 1.31 specifications. If several trigger modes<br />

are available for the currently selected camera, you can switch between them by choosing the<br />

desired mode from the list. See TriggerMode for more details.<br />

Trigger polarity<br />

Lets you change polarity of the trigger input. Equivalent to the TriggerPolarity property. Choose one<br />

of the following options:<br />

High <strong>Active</strong> - trigger has high active input.<br />

Low <strong>Active</strong> - trigger has low active input.<br />

Trigger counter<br />

Lets you select the trigger counter (trigger parameter) as defined by the IIDC 1.31 specifications.<br />

Equivalent to the TriggerCounter property. See TriggerMode for more details on the usage of the<br />

trigger counter.<br />

Trigger delay<br />

Lets you select the raw value for the trigger delay which defines the time between the arrival of the<br />

trigger signal and acquisition of the frame. Equivalent to the TriggerDelay property.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

347


<strong>Active</strong>X Reference<br />

Format<br />

This property page is used to select the properties specifying the format and synchronization options of<br />

the video.<br />

Select from the following options:<br />

Video mode<br />

Use this option to select the desired video mode from the list of modes available for the current<br />

camera. In addition to standard modes defined by the IIDC 1.30 specifications, camera-dependent<br />

partial scan modes (Format 7) can be available at the bottom of the list. Each partial scan mode<br />

retains the frame size and packet size previously selected for it. However, selecting the same partial<br />

scan mode twice will reset its parameters to maximum values, thus providing the highest resolution<br />

and frame rate available for the mode.Equivalent to the Mode property.<br />

Frame rate<br />

Lets you choose the frame rate available for the currently selected Mode. Select among the<br />

following possible frame rates: 1.875 fps, 3.75 fps, 7.5 fps, 15 fps, 30 fps, 60 fps. If one of the partial<br />

scan modes (Format 7) is selected, this option will be unavailable, as the frame rate will depend on<br />

the size of the scan window and Packet size. Equivalent to the Rate property.<br />

Packet size<br />

Use this option to select the number of bytes in an isochronous packet. This option is available only<br />

for partial scan (Format 7) modes and related but not necessarily indicative of the effective frame<br />

rate. Equivalent to the PacketSize property.<br />

Partial scan<br />

Lets you change the size and position of the image window in a partial scan (Format 7) mode. To<br />

modify the size and position of the window, enter the desired values for the image width, height, left<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

348


<strong>Active</strong>X Reference<br />

coordinate and top coordinate in pixels. Equivalent to the SizeX, SizeY, StartX, StartY properties.<br />

16-bit swap<br />

Select this box to change the order of bytes in incoming camera frames. While outputting 16-bit<br />

pixels, some cameras can place the most significan bits of each pixel in the high-order bytes and the<br />

least significant bits in the low-order bytes. If this happens, the live image will appear scrambled.<br />

Checking this box will restore the original pixel values. Equivalent to the SwapBytes property.<br />

16-bit shift<br />

Select the number of positions for the right bit shift to be applied to 16-bit pixel values in the image<br />

buffer. When displaying and saving 16- and 48-bit images, <strong>AVT</strong><strong>Active</strong>Cam assumes that pixel<br />

values are mapped to the entire 16-bit dynamic range (0-65535). Certain cameras however may<br />

output data in narrower dynamic range resulting in dark images. Selecting a non-zero bit shift will<br />

cause real-time remapping of image data. Equivalent to the BitShift property.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

349


<strong>Active</strong>X Reference<br />

Exposure<br />

This property page is used to select the properties specifying the display features of the video.<br />

Select from the following options:<br />

Brightness<br />

Move the slider to adjust the brightness (black level) of the video. Note that this option is available<br />

only for the cameras that support the software brightness control.. Equivalent to the Brightness<br />

property.<br />

Shutter<br />

Move this slider to adjust the integration time of the incoming light. Note that this option is available<br />

only for the cameras that support the software shutter control. Equivalent to the Shutter property.<br />

Gain<br />

Move this slider to adjust the camera circuit gain control. Note that this option is available only for the<br />

cameras that support the software gain control. Equivalent to the Gain property.<br />

Gamma<br />

Move the slider to adjust the gamma level of the video. The gamma correction modifies an image<br />

by applying standard, nonlinear gamma curves to the intensity scale. To lighten an image and<br />

increase the contrast in its darker areas, increase the gamma by moving the slider to the right. To<br />

darken the image and emphasize the contrast in the lighter areas, decrease in the gamma by<br />

moving the slider to the left. Note that this option is available only for the cameras that support the<br />

software gamma control. Equivalent to the Gamma property.<br />

Sharpness<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

350


<strong>Active</strong>X Reference<br />

Move the slider to adjust the sharpness of the video. Note that this option is available only for the<br />

cameras that support the software sharpness control. Equivalent to the Sharpness property.<br />

Each of the sliders has a corresponding check box On located on the left and Auto located on the<br />

right. If an On box is unselected, the corresponding feature will be disabled. If an Auto box is enabled,<br />

the camera supports an automatic mode for the corresponding feature. Checking the box will put the<br />

camera to the continuous automatic control of the feature, unchecking it will restore the manual control.<br />

Auto Exposure Reference<br />

Use this option to control the AE mode of the camera. When the auto exposure mode is activated, the<br />

camera will automatically control the exposure by keeping Shutter and Gain at optimal levels. The<br />

reference value for auto exposure can be adjusted by moving the slider next to the check box. Both<br />

options are available only if the currently selected camera supports auto exposure control. Equivalent<br />

to the AutoExposure and AutoExposureRef properties.<br />

Note: The features Iris and Optical Filter are not available in <strong>AVT</strong> cameras.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

351


<strong>Active</strong>X Reference<br />

Color<br />

This property page is used to select the properties specifying the format and synchronization options of<br />

the video.<br />

Select from the following options:<br />

Saturation<br />

Move the slider to adjust the color saturation of the video. Note that this option is available only for<br />

the cameras that support the software saturation control.. Equivalent to the Saturation property.<br />

Hue<br />

Move the slider to adjust the color phase the video. Note that this option is available only for the<br />

cameras that support the software hue control.. Equivalent to the Hue property.<br />

Both sliders has a corresponding check box On located on the left and Auto located on the right. If an<br />

On box is unselected, the corresponding feature will be disabled. If an Auto box is enabled, the<br />

camera supports an automatic mode for the corresponding feature. Checking the box will put the<br />

camera to the continuous automatic control of the feature, unchecking it will restore the manual control.<br />

White balance<br />

Move the U/B slider to adjust the the tint of the white color along the yellow-blue axis. Move the<br />

V/R slider to adjust the the tint of the white color along the cyan-red axis. Select the Auto box to<br />

put the camera to the continuous automatic control of the white balance. Click the One Push<br />

button to have the camera adjust the white balance level by itself and return to the manual mode.<br />

Equivalent to the WhiteBalanceUB, WhiteBalanceVR and WhiteBalanceControl properties.<br />

Bayer conversion<br />

Select this option to activate the real-time color conversion of a grayscale video generated by a<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

352


<strong>Active</strong>X Reference<br />

Bayer camera. The Bayer list lets you select the specific Bayer conversion algorithm. The CCD<br />

layout of the camera can be selected from the Layout list. Both options are available only for<br />

monochrome video modes. See Bayer and BayerLayout for more information.<br />

Please note that after detecting a new camera, automatic bayer layout recognition is performed<br />

and the bayer conversation method is set to nearest.<br />

R, G , B , Y<br />

Let you adjust the gain factors for individual color channels or the intensity factor for a<br />

monochrome video. Equivalent to the SetGains property.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

353


<strong>Active</strong>X Reference<br />

Advanced<br />

This property page is used to select the properties specifying the format and synchronization options of<br />

the video<br />

Register<br />

Lets you perform asynronous reads and writes to a selected register in the camera 1394 address<br />

space. To perform the read operation, enter the desired hexadecimal offset to the Offset filed and<br />

click the Read button. The offset should be given relative to the 1394 base address<br />

FFFF:00000000 h. The result will be displayed in the Hex Value box. To perform the write<br />

operation, enter a desired offset and 32-bit hexadecimal value to the Offset and Hex Value fields<br />

respectively, and then press the Write button. Use the Refresh button to synchronize<br />

<strong>AVT</strong><strong>Active</strong>Cam properties with possible changes in the camera settings that might have occured<br />

after changing the values of 1394 registers. Equivalent to the ReadRegister, WriteRegister and<br />

LoadChannel methods.<br />

Memory channel<br />

Select the internal EEPROM channel for loading or storing camera settings. Use the Save button<br />

to write the current setting to the internal camera memory. Use the Load button to load the settings<br />

from the internal memory. Channel 0 corresponds to the default factory settings and cannot be<br />

overwriten. Equivalent to the LoadChannel and SaveChannel methods.<br />

Save image<br />

Lets you save the current frame buffer in an image file. When you click this button, the Save As<br />

dialog box will appear where you can select the file name and one of the image file formats: BMP,<br />

TIF and JPEG. Note that BMP and TIF files will be recorded with no compression while JPEG files<br />

will be recorded with quality 75. Equivalent to the SaveImage method.<br />

Note: The features Pan, Tilt, Focus and Zoom are not available in <strong>AVT</strong> cameras<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

354


<strong>Active</strong>X Reference<br />

Display<br />

This property page is used to select the properties specifying the display settings of <strong>AVT</strong><strong>Active</strong>Cam.<br />

Select from the following options:<br />

Display<br />

Lets you enable or disable live display in the control window. You might want to disable the display<br />

option if you want to render captured frames by other means such as Picture box. Setting this<br />

property to TRUE will activate the internal RGB24 conversion which is required by image data<br />

access and image analysis methods. Equivalent to the Display property.<br />

Anti-tearing<br />

Lets you enable or disable the anti-tearing feature. Anti-tearing removes horizontal tears in the live<br />

video caused by a difference between the camera frame rate and refresh rate of the monitor.<br />

Equivalent to the AntiTearing property.<br />

Monitor Sync<br />

Lets you enable or disable the monitor synchronization mode. If this box is checked, the camera<br />

frame rate will exactly match the refresh rate of the system monitor thus eleminating all the display<br />

artifacts related to the digital image transfer. Equivalent to the MonitorSync property.<br />

Scroll bars<br />

Lets you enable or disable the scroll bars in the control window. If this box is checked and the<br />

video width or/and height exceed the size of the control window, the scroll bar(s) will be displayed<br />

on the border of the control window allowing you to pan the live video. Equivalent to the ScrollBars<br />

property.<br />

Digital zoom<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

355


<strong>Active</strong>X Reference<br />

Lets you adjust the magnification of the live video display. This option doesn't change the content<br />

of the image data, but only its appearance in the control window. If it is set to zero, the image will<br />

be fit to the size of the control window. In this case the display might not retain the original<br />

proportions of the video frame. Equivalent to the Magnification property.<br />

Flip<br />

Lets you select one of the flipping modes. Flipping affects the live video display as well as actual<br />

order of pixels in the frame buffer. Select among the following modes:<br />

Off<br />

No image flipping is performed.<br />

Horizontal<br />

The image is flipped horizontally.<br />

Vertical<br />

The image is flipped vertically.<br />

Diagonal<br />

The image is flipped horizontally and vertically.<br />

This option is equivalent to the Flip property.<br />

Rotate<br />

Lets you rotate the image. Rotation affects the live video display as well as actual order of pixels in<br />

the frame buffer. Select one of the following modes:<br />

Off<br />

No image rotation is performed.<br />

90°<br />

The image is rotated counterclockwise.<br />

180°<br />

The image is rotated 180 degrees.<br />

270°<br />

The image is rotated clockwise.<br />

This option is equivalent to the Rotate property.<br />

Integrate Mode<br />

Lets you select the frame integration operation mode. The frame integration allows you to average<br />

or add frames "on the fly" without sacrificing the frame rate. Equivalent to the Integrate property.<br />

Select one of the following modes:<br />

None<br />

Frame integration is disabled.<br />

Average<br />

Running Average mode. Each output frame is the result of averaging a selected number of<br />

previously captured frames.<br />

Add<br />

Running Accumulation mode. Each output frame is the sum of a selected number of previously<br />

captured frames.<br />

Integrate Window<br />

Sets the number of frames for the integration. Equivalent to the IntegrateWnd property.<br />

Palette<br />

Lets you select one of a few predefined palette to be applied to a grayscale live video. The palettes<br />

represent choices that may be useful in viewing different kinds of video in pseudo-colors. Choose<br />

among the following palettes:<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

356


<strong>Active</strong>X Reference<br />

Gray<br />

Applies the standard 256-level grayscale palette. This is a regular mode of viewing a grayscale<br />

video.<br />

Inverse<br />

Applies the inverted 256-level grayscale palette. The video will be displayed in the negative<br />

format.<br />

Saturated<br />

Applies the grayscale palette with colorized upper entries. The saturated palette allows you to<br />

control the dynamic range of the video signal by bringing it slightly below the saturation level of<br />

the video camera or video amplifier. To achieve the maximum dynamic range, adjust the<br />

intensity of the light source and/or the gain and zero level of the video amplifier so that the red<br />

color corresponding to the brightest pixel values just barely shows up.<br />

Rainbow<br />

Applies a color palette where the entries are evenly distributed along the Hue axis. This allows<br />

for assigning different color pigments to different levels of intensity.<br />

Spectra<br />

Applies a color palette where the entries are distributed along the Hue and Luminance axes.<br />

That allows for assigning different color pigments to different levels of intensity while<br />

preserving the luminance scale.<br />

Isodense<br />

Applies the 256-level grayscale palette, each 8-th entry of which is colorized. The isodense<br />

palette allows you to clearly see transitions between different levels of intensities as isolines on<br />

a topographic map.<br />

Multiphase<br />

Applies the multiphase palette. Entries in the multiphase palette are at opposite ends of the<br />

color model so even small changes in gray levels are highlighted.<br />

Random<br />

Applies the random color palette whose entries are filled with random values each time you<br />

select it from the list.<br />

This option is equivalent to the Palette property.<br />

Background name<br />

Lets you enter the name prefix under which the background files are stored. See BkgName for<br />

more details.<br />

Save Dark<br />

Click this button to store a dark field background image on the hard drive. Dark field should be<br />

saved when no light transmitted through the camera lens. The dark field will be calculated by<br />

avaraging the number of consecutive frames specified by the Frames option. Equivalent to the<br />

SaveBkg method.<br />

Save Bright<br />

Click this button to store a bright field background image on the hard drive. Bright field should be<br />

saved with the maximum light transmitted and no objects in the filed of view. To achieve the best<br />

dynamic range, the light intensity should be adjusted so that it stays just below the saturation level<br />

of the camera. To control the saturation for monochrome cameras, use the Saturated Palette.<br />

The bright field will be calculated by avaraging the number of consecutive frames specified by the<br />

Frames option.<br />

Correct<br />

Lets you select a background correction mode. Select None if you do not want the background<br />

correction to be performed. Select Dark/Offset to apply the dark-field background correction to<br />

each frame captured. Select Flat/Gain to apply the flat-field background correction to each frame<br />

captured. Make sure to save the bright and dark fields before using this option, otherwise certain<br />

background correction modes will not be available. For more details on background correction<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

357


<strong>Active</strong>X Reference<br />

refer to BkgCorrect.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

358


TWAIN<br />

TWAIN<br />

The <strong>AVT</strong>Twain driver allows Windows users to view and capture images in TWAIN-compliant graphic<br />

editing and scientific imaging applications such as Photoshop, Image Pro and others. Depending on<br />

the selected video mode, the TWAIN driver can capture images in 8- or 16-bit monochrome and 24- or<br />

48-bit RGB format.<br />

The driver is automatically installed on your system during <strong>AVT</strong><strong>Active</strong>Cam Installation. To use 1394<br />

cameras via a TWAIN compliant imaging application (e.g. Photoshop, Image Pro etc.), you must first<br />

set <strong>AVT</strong> 1394 Digital Camera as the default TWAIN source.<br />

· Open the TWAIN compliant application (e.g. Photoshop, Image Pro etc.)<br />

· Specify the TWAIN source that you want to interface with. The procedure for this step will vary<br />

depending on the software you are using, but you should see a list of TWAIN devices.<br />

· Choose <strong>AVT</strong> 1394 Digital Camera.<br />

· Open the TWAIN interface. This step also varies depending on the software. The <strong>AVT</strong>Twain<br />

window will appear as shown below.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

359


TWAIN<br />

The user interface of the TWAIN driver includes the following buttons and controls:<br />

Capture<br />

Captures the current video frame into the application.<br />

Live<br />

Switches the camera into the continuous acquisition mode and initiates live preview.<br />

Freeze<br />

Stops the acquisition from the camera and freezes the last video frame in the image window.<br />

Zoom in<br />

Click this button to increase the magnification of the image.<br />

Zoom out<br />

Click this button to decrease the magnification of the image.<br />

Fit to screen<br />

Click this button to change the magnification factor of the image so that it fits to the image window.<br />

Settings<br />

Click this button to display <strong>AVT</strong><strong>Active</strong>Cam Property Pages.<br />

Video mode<br />

Use this option to select the desired video mode from the list of modes available for the current<br />

camera. In addition to standard modes defined by the IIDC 1.30 specifications, camera-dependent<br />

partial scan modes (Format 7) can be available at the bottom of the list.<br />

Frame rate<br />

Lets you choose the frame rate available for the currently selected video mode. Select among the<br />

following possible frame rates: 1.875 fps, 3.75 fps, 7.5 fps, 15 fps, 30 fps, 60 fps, 120 fps. If one of<br />

the partial scan modes (Format 7) is selected, this option will be unavailable.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

360


Samples<br />

Samples<br />

The <strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> includes the following sample applications:<br />

Development<br />

environment<br />

Programming<br />

language<br />

Visual Studio 6 VB 6 <strong>Active</strong>CamProfile<br />

Visual Studio 2005,<br />

Visual Studio 6<br />

Visual C++ with<br />

MFC<br />

Project name Description<br />

Multi<strong>Active</strong>Cam<br />

VBProcess<br />

<strong>Active</strong>CamStat<br />

<strong>Active</strong>CamLevels<br />

<strong>Active</strong>CamEnhance<br />

<strong>Active</strong>CamByRef<br />

<strong>Active</strong>CamDemo<br />

PlugUnplug<br />

Live image preview, real-time line<br />

profile, drawing text, rectangles<br />

and ellipses<br />

Multiple camera viewer (up to 4<br />

simultaneously running cameras)<br />

Live image processing with direct<br />

pixel manipulation in the frame buffer<br />

Real-time image statistics over an<br />

adjustable luminance range<br />

Demonstrates the usage of the<br />

SetLevels method for Window/Level<br />

operation and how to apply the<br />

LUTMode method for lookup table<br />

operations<br />

Real time running average and frame<br />

integration, software gain controls<br />

Live image in PictureBox object, pixel<br />

values at cursor coordinates, fps<br />

display, using <strong>AVT</strong><strong>Active</strong>Cam by<br />

reference<br />

Live image preview, real-time line<br />

profile, histogram and image statistics<br />

over ROI, saving image into file,<br />

continuous capture into multiple<br />

frames.<br />

Multiple camera viewer with<br />

plug/unplug event processing. Ability<br />

to disconnect and connect up to 4<br />

cameras with streaming video.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

361


Samples<br />

Visual Studio 2005,<br />

Visual Studio 6<br />

Visual C++ with<br />

Win32 API<br />

(without MFC)<br />

<strong>Active</strong>CamConsole<br />

<strong>Active</strong>CamWin<br />

Visual Studio 2005 VB.NET <strong>Active</strong>CamOverlay<br />

<strong>Active</strong>CamCapture<br />

Visual Studio 2005 C# <strong>Active</strong>CamSharp<br />

FilterSharp<br />

Console application showing how to<br />

use <strong>AVT</strong><strong>Active</strong>Cam API to retrieve<br />

the list of connected cameras and<br />

video formats, capture a series of<br />

frames and modify camera properties<br />

Live image preview using DIB<br />

rendering, built-in and custom camera<br />

controls, saving image into file.<br />

Written in C with Win32 API (no MFC<br />

used)<br />

Flipped video preview, pseudocoloring,<br />

pixel window extraction,<br />

overlay animation<br />

Time-lapse video capture to AVI files<br />

or series of images, overlayed frame<br />

counter<br />

Image and pixel viewer with custom<br />

camera controls: selection among<br />

multiple cameras, video modes and<br />

frame rates, pseudo-color display,<br />

real-time shutter and gain control,<br />

mouse event handling<br />

Direct access to the frame buffer<br />

using pointers, real-time Emboss<br />

filter, non-destructive color overlay,<br />

interactive drawing<br />

Delphi 7 Object Pascal <strong>AVT</strong>Hist Image viewer with shutter control and<br />

overlayed histogram display<br />

None HTML Try<strong>AVT</strong>Cam.html Web page with an integrated viewer<br />

Note that VB.NET and Visual C# samples utilize .NET Framework. Make sure it is installed on your<br />

system before using these samples. In addition, <strong>Active</strong>CamOverlay and <strong>Active</strong>CamSharp samples<br />

assume the presense of MSCOMM32.ocx on the system.<br />

All the samples include complete source code and executables which can be run with any <strong>AVT</strong> 1394<br />

camera out of the box. Simply connect one or more cameras to your system, start an application of<br />

your choice and see how the <strong>Active</strong>X Control <strong>AVT</strong><strong>Active</strong>Cam performs in real world!<br />

If using Windows 7 or Windows Vista, please also read chapter Working with examples because you<br />

might encounter difficulties compiling or executing these samples.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

362


Samples<br />

6.1 Samples and <strong>User</strong> Account Control<br />

Note that if <strong>User</strong> Account Control (UAC) is activated, the sample projects cannot be compiled directly<br />

(i.e. from the C:\Program Files directory).<br />

In this case you get one or more error messages: e.g. Could not create output directory. The reason<br />

for these messages is missing write permissions due to <strong>User</strong> Account Control (UAC).<br />

For basic information on <strong>User</strong> Account Control (UAC) read Section <strong>User</strong> Account Control (UAC) in the<br />

chapter System Requirements.<br />

Workaround for UAC problems:<br />

To solve the compiling problems under UAC, perform the following steps:<br />

1. Locate the installation directory: e.g. C:\Program files\<strong>Allied</strong> <strong>Vision</strong><br />

<strong>Technologies</strong>\<strong>Active</strong><strong>FirePackage</strong><br />

2. Copy <strong>Active</strong><strong>FirePackage</strong> directory to one of your user directories, e.g. your desktop.<br />

3. In this directory, open the Samples directory and search for *.sln.<br />

4. Doubleclick desired *.sln. Visual Studio opens this file.<br />

5. You can work with this files as usual (e.g. compile) without getting the error messages listed<br />

above.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

363


Troubleshooting<br />

Troubleshooting<br />

Below is the list of the most frequently encountered issues and remedies for their resolutions:<br />

Problem description Cause Resolution<br />

The camera is not<br />

recognized by<br />

<strong>AVT</strong><strong>Active</strong>Cam. "**No<br />

<strong>AVT</strong> camera found**"<br />

message appears in the<br />

control window.<br />

Live video occasionally<br />

freezes. After restarting<br />

the application "Error in<br />

the system 1394 driver"<br />

appears in the control<br />

window. In some cases<br />

system reboot is required.<br />

The camera is not<br />

receiving power.<br />

<strong>AVT</strong> <strong>FirePackage</strong> or<br />

UniversalPackage is installed<br />

and the<br />

camera is connected<br />

to a card to which the<br />

intek driver is assigned<br />

<strong>AVT</strong> <strong>Active</strong>Cam 1394<br />

Camera Driver is not<br />

installed for the<br />

camera.<br />

The camera is no <strong>AVT</strong> camera.<br />

Windows 7 Gap Count<br />

Optimization is enabled<br />

The camera and 1394<br />

board have a<br />

compatibility problem.<br />

The computer/board<br />

or cabling have an intermittent<br />

hardware<br />

issue<br />

This is a typical issue for notebook<br />

computers that do not provide power to<br />

external 1394 devices. Use a FireWire<br />

hub or DC power cable to connect your<br />

camera to a laptop.<br />

Run the Automatic Driver Setup tool or<br />

refer to Driver Setup for the manual<br />

driver installation procedure.<br />

Run the Automatic Driver Setup tool or<br />

refer to Driver Setup for the manual<br />

driver installation procedure.<br />

<strong>AVT</strong><strong>Active</strong>Cam only works with <strong>AVT</strong><br />

cameras. Non-<strong>AVT</strong> cameras (as well as<br />

non-IIDC-compliant cameras like DVcamcorders)<br />

will not be recognized by<br />

<strong>AVT</strong><strong>Active</strong>Cam. Use the manufacturer's<br />

provided software.<br />

There are two possible solutions:<br />

a. Modify/Create the registry key<br />

HKEY_LOCAL_MACHINE\SYSTEM\<br />

CurrentControlSet\Services\1394ohci\<br />

Parameters\EnableGapCountOptimizatio<br />

n to have a DWORD value of 0.<br />

b. Alternatively, switch the default<br />

Microsoft card driver to the legacy<br />

version, as shown in the following linked<br />

video: 1394 legacy mode<br />

Some 1394 boards/chipsets are known<br />

not to perform well with certain models of<br />

1394 cameras. Replace your board with<br />

a board recommended by <strong>AVT</strong> or your<br />

camera distributor.<br />

Replace the cable or try to run the<br />

camera/software on a different system.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

364


Troubleshooting<br />

Problem description Cause Resolution<br />

The video is corrupted<br />

(frames are broken into<br />

parts, jittering occurs or<br />

synchronization is lost).<br />

Some video formats and<br />

frame rates do not work.<br />

When switching to certain<br />

video modes, I get a blank<br />

screen.<br />

VB.NET and C# sample<br />

applications do not work.<br />

When I try to compile your<br />

VB.NET and C# samples<br />

in Visual Studio 2005/2008<br />

under Vista or Windows 7,<br />

I am getting error<br />

messages.<br />

When I run a live video<br />

application from within<br />

Visual Studio.NET,<br />

everything freezes.<br />

I am trying to do real-time<br />

image processing in .NET,<br />

and I experience a<br />

significant drop in the<br />

frame rate.<br />

The camera and 1394<br />

board have a<br />

compatibility problem.<br />

The processor has an<br />

extensive latency in the C3<br />

power state transition.<br />

You are running Windows XP<br />

SP2 and the camera is<br />

connected to 1394b board.<br />

Some cameras require turning<br />

the acquisition off while<br />

switching between video<br />

modes.<br />

.NET framework is not installed<br />

on the system<br />

The DEP memory access<br />

protection is enabled on your<br />

system which prevents VS<br />

2005/2008 from interfacing<br />

with <strong>AVT</strong><strong>Active</strong>Cam.<br />

Live video is active in the<br />

Design mode. Visual<br />

Studio.NET doesn't close the<br />

designer while starting the<br />

application.<br />

VB.NET and C# have<br />

performance issues when<br />

working with large arrays.<br />

FrameAcquired event has an<br />

overhead that might affect the<br />

performance<br />

See the solution above.<br />

This problem is common for notebook<br />

computers. To correct the latency<br />

setting, run C3State.reg file located in<br />

the Driver folder. Restart the system for<br />

the changes to take effect.<br />

If you are using a 1394a camera, run the<br />

following fix from Microsoft:<br />

http://support.microsoft.com/kb/885222<br />

If you are using a 1394b camera,<br />

perform a "rollback" procedure as<br />

described in 1394b (FireWire 800)<br />

Turn the acquisition off by setting the<br />

Acquire property to off, then select the<br />

desired video mode and turn the<br />

acquisition on.<br />

Install the latest .NET framework from<br />

Microsoft:<br />

http://msdn.microsoft.com/netframework<br />

/default.aspx<br />

Run the Command Prompt (as<br />

Administrator) and execute the following<br />

command:<br />

bcdedit.exe /set {current} nx AlwaysOff<br />

Reboot your computer. The problem<br />

should be fixed.<br />

<strong>AVT</strong><strong>Active</strong>Cam cannot run two instances<br />

of live video acquired from the same<br />

camera. Make sure to close the design<br />

view before running your application.<br />

The best way to avoid this problem is not<br />

to use live display in the design mode<br />

except for testing purposes. You can<br />

initiate acquisition in your code by setting<br />

the Acquire property to true.<br />

For performance boost, use unsafe code<br />

and pointers to directly access<br />

<strong>AVT</strong><strong>Active</strong>Cam image buffer. A pointer<br />

to the image buffer is provided by<br />

GetImagePointer.<br />

For VB.NET, C# and C++ applications<br />

use FrameAcquiredX event.<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

365


Troubleshooting<br />

Problem description Cause Resolution<br />

AVI files are not recorded<br />

in real-time, many frames<br />

are being dropped.<br />

<strong>AVT</strong><strong>Active</strong>Cam installation<br />

fails with the following<br />

error: "<strong>AVT</strong><strong>Active</strong>Cam.dll<br />

failed to register,<br />

HRESULT -2147220473"<br />

After disabling Auto-<br />

Shutter check-box, the<br />

shutter stays the same as<br />

before<br />

Your system does not provide<br />

enough throughput or CPU<br />

power to keep up with the<br />

camera frame rate<br />

This error is usually caused by<br />

a corrupted registration of atl.dll<br />

system file.<br />

Switch to a lower resolution mode or<br />

reduce the frame rate. If you are using a<br />

Bayer camera, consider recording the<br />

monochrome video instead of color one.<br />

Alternatively, upgrade your system to a<br />

faster hard drive and/or CPU.<br />

1. Locate atl.dll, generally found in<br />

"C:\WINNT\system32" or<br />

"C:\WINDOWS\system32".<br />

2. Open the command-line prompt<br />

· Start Menu/Run<br />

· type "cmd"<br />

· press "ENTER"<br />

3. Using the atl.dll filename and path,<br />

call regsvr32, i.e. at the command-line<br />

prompt, type:<br />

· regsvr32<br />

"C:\WINNT\system32\atl.dll"<br />

· press "ENTER"<br />

4. You should see a regsvr32 window,<br />

confirming success: Close it.<br />

5. Repeat <strong>AVT</strong><strong>Active</strong>Cam installation.<br />

This is a camera issue; the Switch tabs before disabling Auto-<br />

Shutter register does not reflect Shutter<br />

the current Shutter setting in all<br />

cases<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

366


Index<br />

1<br />

1394 driver 25<br />

1394b 29<br />

3<br />

3D look 90<br />

A<br />

Acquire 62<br />

Advanced property page 354<br />

AntiTearing 64<br />

Anti-tearing 64<br />

Asynch 66<br />

Asynchronous acquisition 66<br />

Auto exposure 68<br />

Auto exposure maximum 196<br />

Auto exposure minimum 197<br />

AutoExposure 68<br />

AutoExposureRef 70<br />

AVI 312, 314<br />

B<br />

Background color 72<br />

Bayer filter 73<br />

Bayer layout 75<br />

BitShift 77<br />

BkgCorrect 79<br />

BkgName 81<br />

bmp 283<br />

Brightness 82<br />

Brightness control mode 84<br />

Brightness maximum 183<br />

Brightness minimum 184<br />

C<br />

C# 48<br />

C++ 38<br />

Camera 86<br />

Camera list 186<br />

CameraPlugged event 321<br />

CameraUnplugged event 323<br />

Codec SetCodec 287<br />

Codec ShowCodecDlg 306<br />

Codec ShowCompressionDlg 307<br />

Color property page 352<br />

Continuous acquisition 62<br />

D<br />

Delphi 52<br />

Delphi 7 52<br />

Display 88<br />

Distributing 33<br />

Draw 171<br />

DrawEllipse 172<br />

DrawLine 174<br />

DrawPixel 176<br />

DrawRectangle 177<br />

DrawText 179<br />

E<br />

Edge 90<br />

Events 320<br />

Exposure property page 350<br />

F<br />

Flip 91<br />

Font 93<br />

Format 7 198<br />

FormatChanged event 325<br />

FrameAcquired event 326<br />

FrameAcquiredX event 327<br />

FrameDropped event 328<br />

G<br />

Gain 95<br />

Gain control mode 97<br />

Gain maximum 212<br />

Gain minimum 213<br />

Gamma 99<br />

Gamma control mode 101<br />

Gamma maximum 214<br />

Gamma minimum 215<br />

GetCameraList 186<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

367


GetCodecList Codec 189<br />

GetComponentData 190<br />

GetComponentLine 192<br />

GetDIB 194<br />

GetF7Info 198<br />

GetHistogram 217<br />

GetImageData 221, 295<br />

GetImageLine 223<br />

GetImagePointer 225<br />

GetImageStat 227<br />

GetImageWindow 229<br />

GetIsoSpeed 231<br />

GetMaxChannel 234<br />

GetModeList 235<br />

GetPicture 237<br />

GetPixel 238<br />

GetRateList 240<br />

GetRawData 242<br />

GetRGBPixel 244<br />

GetROI 246<br />

GetTriggerInfo 256<br />

Grab 263<br />

<strong>Guide</strong> 34<br />

H<br />

Height 144, 216<br />

Histogram 217<br />

Horizontal offset 146<br />

Hue 105<br />

Hue control mode 107<br />

Hue maximum 219<br />

Hue minimum 220<br />

I<br />

Image height 216<br />

Image width 262<br />

Installation 16<br />

Introduction 9<br />

J<br />

jpeg 283<br />

L<br />

License 9, 11<br />

LoadChannel 264<br />

LoadSettings 268<br />

M<br />

Magnification 110<br />

Memory channels 234, 264, 285<br />

Methods 163<br />

Mode 112<br />

Mode list 235<br />

MouseDblClick event 333<br />

MouseDown event 335<br />

MouseMove event 337<br />

MouseUp event 339<br />

Multiple cameras 56<br />

N<br />

New link 154<br />

O<br />

Overlay 116<br />

OverlayClear 269<br />

OverlayColor 117<br />

OverlayEllipse 270<br />

OverlayFont 118<br />

OverlayLine 271<br />

OverlayPixel 272<br />

OverlayRectangle 273<br />

OverlayText 274<br />

Overview 9<br />

P<br />

PacketSize 119<br />

Palette 121<br />

Pixel depth 185<br />

Properties 58<br />

Property pages 308, 345<br />

Pseudo colors 121<br />

R<br />

Rate 123<br />

Rate list 240<br />

Read block 275<br />

Read register 277<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

368


ReadSIO 279<br />

Reference 57<br />

Requirements 14<br />

ROI 246, 302<br />

Rotate 125<br />

S<br />

Samples 361<br />

Saturation 127<br />

Saturation control mode 129<br />

Saturation maximum 247<br />

Saturation minimum 248<br />

SaveBkg 281<br />

SaveChannel 285<br />

SaveImage 283<br />

SaveSettings 286<br />

Scroll event 342<br />

ScrollBars 131<br />

ScrollX 132<br />

ScrollY 133<br />

SetIsoSpeed 297<br />

SetROI 302<br />

SetSIO 304<br />

Sharpness 134<br />

Sharpness control mode 136<br />

Sharpness maximum 249<br />

Sharpness minimum 250<br />

ShowProperties 308<br />

Shutter 138<br />

Shutter control mode 140<br />

Shutter maximum 251<br />

Shutter minimum 252<br />

SizeX 142<br />

SizeY 144<br />

SoftTrigger 310<br />

Software trigger 310<br />

Source property page 346, 355<br />

StartCapture 312<br />

StartX 146<br />

StartY 147<br />

StopCapture 314<br />

SwapBytes 148<br />

Synchronous acquisition 66<br />

T<br />

tiff 283<br />

Timeout 149, 344<br />

Trigger 150, 310<br />

Trigger delay 152<br />

Trigger delay maximum 254<br />

Trigger delay minimum 255<br />

TriggerCounter 151<br />

TriggerMode 154<br />

TriggerPolarity 156<br />

Troubleshooting 364<br />

TWAIN 359<br />

V<br />

VB 35<br />

VB.NET 43<br />

Vertical offset 147<br />

Video Format 348<br />

Visual Basic 35<br />

Visual C# 48<br />

Visual C++ 38<br />

W<br />

White balance control mode 157<br />

White balance maximum 260<br />

White balance minimum 261<br />

White balance U/B 159<br />

White balance V/R 161<br />

Width 142, 262<br />

Write block 315<br />

Write register 317<br />

WriteSIO 319<br />

<strong>AVT</strong> <strong>Active</strong> <strong>FirePackage</strong> <strong>User</strong> <strong>Guide</strong> V3.0.0<br />

369

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!