Copyright: (c) Media Cybernetics


Auto-Pro Programming Reference

   ♦  Auto-Pro Functions (listed alphabetically)

   ♦  Auto-Pro Functions (listed by function)

   ♦  IPBASIC Commands

   ♦  Data Types

   ♦  Variable Names

   ♦   KeyWord List

   ♦  ANSI Character Table

   ♦  Shortcut Key Assignments

   ♦  Software License


Auto-Pro Function Summary

Acquire Command

IpAcqAverage

IpAcqControl

IpAcqMultiSnap

IpAcqSelectDriver

IpAcqSettings

IpAcqShow

IpAcqSnap

IpAcqTimed

AOI Operations

IpAoiChangeName

IpAoiCreateBox

IpAoiCreateEllipse

IpAoiCreateIrregular

IpAoiGet

IpAoiManager

IpAoiMove

IpAoiMultAppend

IpAoiMultShow

IpAoiShow

IpAoiValidate

IpListPts

IpMorePts

Application Window

IpAppArrange

IpAppCloseAll

IpAppCtl

IpAppCtlText

IpAppExit

IpAppGet

IpAppHide

IpAppMaximize

IpAppMenuSelect

IpAppMinimize

IpAppMove

IpAppRestore

IpAppRun

IpAppSelectDoc

IpAppSize

IpAppUpdateDoc

IpAppWindow

IpAppWndPos

IpAppWndState

IpTrackBar

Background Correction Command

IpOpBkgndCorrect

IpOpBkgndSubtract

Batch Conversion Command

IpWsConvertFile

BCG and Color Map

IpLutApply

IpLutBinarize

IpLutLoad

IpLutReset

IpLutSave

IpLutSetAttr

IpLutSetControl

IpLutShow

IpRangeGet

IpRangeSet

IpWsStretchLut

Bitmap Analysis

IpBitAttr

IpBitSaveData

IpBitShow

Calibration Command

IpCalLoad

IpCalSave

IpCalSaveAll

IpICalCreate

IpICalDestroy

IpICalLinearize

IpICalMove

IpICalReset

IpICalSelect

IpICalSetName

IpICalSetOptDens

IpICalSetPoints

IpICalSetSamples

IpICalSetUnitName

IpICalShow

IpICalShowFormat

IpSCalCreate

IpSCalDestroy

IpSCalMove

IpSCalReset

IpSCalSelect

IpSCalSetAngle

IpSCalSetAspect

IpSCalSetName

IpSCalSetOrigin

IpSCalSetUnit

IpSCalSetUnitName

IpSCalShow

Clipboard Operations

IpWsCopy

IpWsPaste

Color Segmentation Command

IpSegCreateMask

IpSegDelete

IpSegLoad

IpSegMerge

IpSegNew

IpSegPreview

IpSegRename

IpSegReset

IpSegSave

IpSegSelect

IpSegSelectArea

IpSegSetAttr

IpSegSetRange

IpSegShow

Color Transform Command

IpCmChannelExtract

IpCmChannelMerge

IpCmChannelMerge3

IpCmTransform

Convert To Command

IpWsConvertToBilevel

IpWsConvertToFloat

IpWsConvertToGray

IpWsConvertToGray12

IpWsConvertToGray16

IpWsConvertToPaletteMColor

IpWsConvertToPaletteMedian

IpWsConvertToRGB

IpWsGray12To8

IpWsGray16To8

Count/Size Command

IpBlbCount

IpBlbCreateMask

IpBlbData

IpBlbDelete

IpBlbEnableMeas

IpBlbFilter

IpBlbGet

IpBlbLoadOutline

IpBlbLoadSetting

IpBlbMeasure

IpBlbMultiRanges

IpBlbRemoveHoles

IpBlbSaveClasses

IpBlbSaveData

IpBlbSaveOutline

IpBlbSavePopDensities

IpBlbSaveSetting

IpBlbSetAttr

IpBlbSetFilterRange

IpBlbSetRange

IpBlbShow

IpBlbShowAutoClass

IpBlbShowCluster

IpBlbShowData

IpBlbShowHistogram

IpBlbShowObjectWindow

IpBlbShowPopDens

IpBlbShowScattergram

IpBlbShowSingleClass

IpBlbShowStatistics

IpBlbSmoothObjects

IpBlbSplitObjects

IpBlbUpdate

Duplicate Command

IpWsDuplicate

Dynamic Data Exchange Command

IpDde

FFT Command

IpFftForward

IpFftHiPass

IpFftInverse

IpFftLoad

IpFftLoPass

IpFftSave

IpFftShow

IpFftSpikeBoost

IpFftSpikeCut

File Name Operations

IpStAutoName

IpStGetName

IpStSearchDir

Fill Command

IpWsFill

IpWsFillPattern

Filtering Command

IpFltClose

IpFltConvolveKernel

IpFltDilate

IpFltDistance

IpFltErode

IpFltExtractBkgnd

IpFltFlatten

IpFltHiPass

IpFltLaplacian

IpFltLocalHistEq

IpFltGauss

IpFltLoPass

IpFltMedian

IpFltOpen

IpFltPhase

IpFltPrune

IpFltReduce

IpFltRoberts

IpFltSharpen

IpFltShow

IpFltSobel

IpFltThin

IpFltUserDilate

IpFltUserErode

IpFltVariance

IpFltWatershed

Histogram Command

IpHstCreate

IpHstDestroy

IpHstEqualize

IpHstGet

IpHstMaximize

IpHstMinimize

IpHstMove

IpHstRestore

IpHstSave

IpHstScale

IpHstSelect

IpHstSetAttr

IpHstSize

IpHstUpdate

Image Window

IpAnotAttr

IpAnotBox

IpAnotEllipse

IpAnotLine

IpDraw

IpDrawClear

IpDrawClearDoc

IpDrawGet

IpDrawSet

IpDrawText

IpDocClick

IpDocClose

IpDocCloseEx

IpDocCloseVri

IpDocFind

IpDocGet

IpDocGetArea

IpDocGetLine

IpDocMaximize

IpDocMinimize

IpDocMove

IpDocOpenAoi

IpDocOpenVri

IpDocPutArea

IpDocPutLine

IpDocRestore

IpDocSize

IpPlotCreate

IpPlotData

IpPlotDestroy

IpPlotRange

IpPlotSet

IpPlotShow

IpPlotUpdate

IpGetLine

IpLocalHistEq

IpTextBurn

IpTextFont

IpTextSetAttr

IpTextShow

IpWsCreateFromVri

IpWsOverlay

Internet Access Commands

IpFTPOpen

IpFTPSave

IpMail

Info Command

IpWsChangeDescription

IpWsChangeInfo

Line Profile Command

IpProfCreate

IpProfDestroy

IpProfGet

IpProfLineMove

IpProfMaximize

IpProfMinimize

IpProfMove

IpProfRestore

IpProfSave

IpProfSelect

IpProfSetAttr

IpProfSize

IpProfUpdate

Macro Operations

IpIniFile

IpMacroLoad

IpMacroRun

IpMacroStop

IpMacroWait

Manual Tagging Commands

IpTagAttr

IpTagDelete

IpTagGet

IpTagLoadEnv

IpTagLoadPoints

IpTagPt

IpTagSaveData

IpTagSaveEnv

IpTagSavePoints

IpTagShow

IpTagUpdate

Measurements Command

IpMeasAttr

IpMeasDelete

IpMeasGet

IpMeasLoadOutline

IpMeasMove

IpMeasRestore

IpMeasSaveData

IpMeasSaveOutline

IpMeasShow

IpMeasSize

IpMeasTag

IpMeasTool

New Command

IpWsCreate

IpWsCreateFromClipboard

Open Command

IpWsLoad

IpWsLoadNumber

IpWsLoadPreview

IpWsLoadSetRes

Operations Command

IpOpImageArithmetics

IpOpImageLogic

IpOpNumberArithmetics

IpOpNumberLogic

IpOpNumberRgb

IpOpShow

Output Window Command

IpOutput

IpOutputClear

IpOutputSave

IpOutputShow

Palette Window

IpPalSetGrayBrush

IpPalSetPaletteBrush

IpPalSetPaletteColor

IpPalSetRGBBrush

IpPalShow

Print Command

IpPrtHalftone

IpPrtPage

IpPrtSize

IpPrtScreen

Pseudo-Color Command

IpPcLoad

IpPcSave

IpPcSaveData

IpPcSetColor

IpPcSetDivisions

IpPcSetRange

IpPcShow

Registration Command

IpRegister

IpRegShow

Reload Command

IpWsReload

Resize Command

IpWsScale

Rotate Command

IpWsOrient

IpWsRotate

Rulers Command

IpWsRulerShow

IpWsRulerType

Save/Save As Command

IpWsSave

IpWsSaveAs

IpWsSaveEx

Scanning Command

IpScanSelect

IpScanShow

Screen Capture Command

IpCapArea

IpCapFile

IpCapHotKey

IpCapWindow

Scrolling/Panning Operations

IpWsMove

IpWsPan

Sequencer Commands

IpSeqMerge

IpSeqOpen

IpSeqPlay

IpSeqSave

Template Mode

IpTemplateMode

Test Strips Command

IpWsTestStrips

IpWsTestStrips2

IpWsTestStripsHalftone

Undo Command

IpWsRedo

IpWsUndo

User Input

IpStGetFloat

IpStGetInt

IpStGetString

Zoom Operations

IpWsZoom


Auto-Pro Functions

A

IpAcqAverage

IpAcqControl

IpAcqMultiSnap

IpAcqSelectDriver

IpAcqSettings

IpAcqShow

IpAcqSnap

IpAcqTimed

IpAnotAttr

IpAnotBox

IpAnotEllipse

IpAnotLine

IpAoiChangeName

IpAoiCreateBox

IpAoiCreateEllipse

IpAoiCreateIrregular

IpAoiGet

IpAoiManager

IpAoiMove

IpAoiMultAppend

IpAoiMultShow

IpAoiShow

IpAoiValidate

IpAppArrange

IpAppCloseAll

IpAppCtl

IpAppCtlText

IpAppExit

IpAppGet

IpAppHide

IpAppMaximize

IpAppMenuSelect

IpAppMinimize

IpAppMove

IpAppRestore

IpAppRun

IpAppSelectDoc

IpAppSize

IpAppUpdateDoc

IpAppWindow

IpAppWndPos

IpAppWndState

B

IpBitAttr

IpBitSaveData

IpBitShow

IpBlbCount

IpBlbCreateMask

IpBlbData

IpBlbDelete

IpBlbEnableMeas

IpBlbFilter

IpBlbGet

IpBlbLoadOutline

IpBlbLoadSetting

IpBlbMeasure

IpBlbMultiRanges

IpBlbRemoveHoles

IpBlbSaveClasses

IpBlbSaveData

IpBlbSaveOutline

IpBlbSavePopDensities

IpBlbSaveSetting

IpBlbSetAttr

IpBlbSetFilterRange

IpBlbSetRange

IpBlbShow

IpBlbShowAutoClass

IpBlbShowCluster

IpBlbShowData

IpBlbShowHistogram

IpBlbShowObjectWindow

IpBlbShowPopDens

IpBlbShowScattergram

IpBlbShowSingleClass

IpBlbShowStatistics

IpBlbSmoothObjects

IpBlbSplitObjects

IpBlbUpdate

C

IpCalLoad

IpCalSave

IpCalSaveAll

IpCapArea

IpCapFile

IpCapHotKey

IpCapWindow

IpCmChannelExtract

IpCmChannelMerge

IpCmChannelMerge3

IpCmTransform

D

IpDde

IpDocClick

IpDocClose

IpDocCloseEx

IpDocCloseVri

IpDocGet

IpDocGetArea

IpDocGetLine

IpDocMaximize

IpDocMinimize

IpDocMove

IpDocOpenAoi

IpDocOpenVri

IpDocPutArea

IpDocPutLine

IpDocRestore

IpDocSize

IpDraw

IpDrawClear

IpDrawClearDoc

IpDrawGet

IpDrawSet

IpDrawText

F

IpFftForward

IpFftHiPass

IpFftInverse

IpFftLoad

IpFftLoPass

IpFftSave

IpFftShow

IpFftSpikeBoost

IpFftSpikeCut

IpFltClose

IpFltConvolveKernel

IpFltDilate

IpFltDistance

IpFltErode

IpFltExtractBkgnd

IpFltFlatten

IpFltGauss

IpFltHiPass

IpFltLaplacian

IpFltLocalHistEq

IpFltLoPass

IpFltMedian

IpFltOpen

IpFltPhase

IpFltPrune

IpFltReduce

IpFltRoberts

IpFltSharpen

IpFltShow

IpFltSobel

IpFltThin

IpFltUserDilate

IpFltUserErode

IpFltVariance

IpFltWatershed

IpFTPOpen

IpFTPSave

G

IpGetLine

H

IpHstCreate

IpHstDestroy

IpHstEqualize

IpHstGet

IpHstMaximize

IpHstMinimize

IpHstMove

IpHstRestore

IpHstSave

IpHstScale

IpHstSelect

IpHstSetAttr

IpHstSize

IpHstUpdate

I

IpICalCreate

IpICalDestroy

IpICalLinearize

IpICalMove

IpICalReset

IpICalSelect

IpICalSetName

IpICalSetOptDens

IpICalSetPoints

IpICalSetSamples

IpICalSetUnitName

IpICalShow

IpICalShowFormat

IpIniFile

L

IpListPts

IpLutApply

IpLutBinarize

IpLutLoad

IpLutReset

IpLutSave

IpLutSetAttr

IpLutSetControl

IpLutShow

M

IpMacroLoad

IpMacroRun

IpMacroStop

IpMacroWait

IpMail

IpMeasAttr

IpMeasDelete

IpMeasGet

IpMeasLoadOutline

IpMeasMove

IpMeasRestore

IpMeasSaveData

IpMeasSaveOutline

IpMeasShow

IpMeasSize

IpMeasTag

IpMeasTool

IpMorePts

O

IpOpBkgndCorrect

IpOpBkgndSubtract

IpOpImageArithmetics

IpOpImageLogic

IpOpNumberArithmetics

IpOpNumberLogic

IpOpNumberRgb

IpOpShow

IpOutput

IpOutputClear

IpOutputSave

IpOutputShow

P

IpPalSetGrayBrush

IpPalSetPaletteBrush

IpPalSetPaletteColor

IpPalSetRGBBrush

IpPalShow

IpPcLoad

IpPcSave

IpPcSaveData

IpPcSetColor

IpPcSetDivisions

IpPcSetRange

IpPcShow

IpPlotCreate

IpPlotData

IpPlotDestroy

IpPlotRange

IpPlotSet

IpPlotShow

IpPlotUpdate

IpProfCreate

IpProfDestroy

IpProfGet

IpProfLineMove

IpProfMaximize

IpProfMinimize

IpProfMove

IpProfRestore

IpProfSave

IpProfSelect

IpProfSetAttr

IpProfSize

IpProfUpdate

IpPrtHalftone

IpPrtPage

IpPrtScreen

IpPrtSize

R

IpRangeGet

IpRangeSet

IpRegister

IpRegShow

S

IpSCalCreate

IpSCalDestroy

IpSCalMove

IpSCalReset

IpSCalSelect

IpSCalSetAngle

IpSCalSetAspect

IpSCalSetName

IpSCalSetOrigin

IpSCalSetUnit

IpSCalSetUnitName

IpSCalShow

IpScanSelect

IpScanShow

IpSegCreateMask

IpSegDelete

IpSegLoad

IpSegMerge

IpSegNew

IpSegPreview

IpSegRename

IpSegReset

IpSegSave

IpSegSelect

IpSegSelectArea

IpSegSetAttr

IpSegSetRange

IpSegShow

IpSeqMerge

IpSeqOpen

IpSeqPlay

IpSeqSave

IpStAutoName

IpStGetFloat

IpStGetInt

IpStGetName

IpStGetString

IpStSearchDir

T

IpTagAttr

IpTagDelete

IpTagGet

IpTagLoadEnv

IpTagLoadPoints

IpTagPt

IpTagSaveData

IpTagSaveEnv

IpTagSavePoints

IpTagShow

IpTagUpdate

IpTemplateMode

IpTextBurn

IpTextFont

IpTextSetAttr

IpTextShow

IpTrackBar

W

IpWsChangeDescription

IpWsChangeInfo

IpWsConvertFile

IpWsConvertToBilevel

IpWsConvertToFloat

IpWsConvertToGray

IpWsConvertToGray12

IpWsConvertToGray16

IpWsConvertToPaletteMColor

IpWsConvertToPaletteMedian

IpWsConvertToRGB

IpWsCopy

IpWsCreate

IpWsCreateFromClipboard

IpWsCreateFromVri

IpWsDuplicate

IpWsFill

IpWsFillPattern

IpWsGray12To8

IpWsGray16To8

IpWsLoad

IpWsLoadNumber

IpWsLoadPreview

IpWsLoadSetRes

IpWsMove

IpWsOrient

IpWsOverlay

IpWsPan

IpWsPaste

IpWsRedo

IpWsReload

IpWsRotate

IpWsRulerShow

IpWsRulerType

IpWsSave

IpWsSaveAs

IpWsSaveEx

IpWsScale

IpWsStretchLut

IpWsTestStrips

IpWsTestStrips2

IpWsTestStripsHalftone

IpWsUndo

IpWsZoom


IPBASIC Command Summary

C

Call

Chr$

Const

D

Declare Function

Dim

Do...Loop

E

End

End Function

End If

End Sub

End Type

Exit Do

Exit For

Exit Function

Exit Sub

F

For...Next

Function...End Function

G

Global

GoSub...Return

GoTo

I

If...Then...Else

If...Then...ElseIf...End If

InStr

L

Left$

Len

LTrim$

O

On...GoSub

On...GoTo

Option Base

P

Print

R

Redim

Rem

Return

S

Static

Stop

Str$

Sub...End Sub

T

Type...End Type

V

Val

W

While...Wend


Software License
License

Read this license agreement before removing the Program Diskette or CD-ROM(hereafter "program media") or Documentation from its protective cover.  Removing the program media or documentation will constitute agreement to the conditions of this single-use, enduser license agreement.  If you are not willing to be bound by the terms of this license agreement, promptly return the unopened package to Media Cybernetics, L.P. (hereafter Media) with a copy of the receipt, and your license fee will be refunded.

PROGRAM LICENSE AGREEMENT

Media has worldwide rights to copy, publish, sell, license and distribute Image-Pro Plus, including Software, Program Media and Documentation (hereafter collectively referred to as PRODUCT).  You assume responsibility for the selection of the program to achieve your intended results, and for its installation and subsequent use.

GRANT OF LICENSE

Media hereby grants to Licensee nonexclusive, single-use license to use the PRODUCT upon the terms and conditions contained in this agreement.  You may:

1.	use the PRODUCT on a single workstation owned, leased or otherwise controlled by you, whether in a network or other configuration.

2.	copy the PRODUCT for backup purposes in support of your use of the PRODUCT on the single workstation.

3.	transfer the PRODUCT and license to another party if the other party agrees to accept the terms and conditions of this Agreement.  If you transfer the PRODUCT, you must, at the same time, either transfer all copies of PRODUCT to the same party, or destroy any copies not transferred.

You must reproduce and include the copyright notice on any copy of the PRODUCT documentation.

You may not:

1.	use or copy the PRODUCT, in whole or in part, except as expressly provided in this agreement,

2.	use the PRODUCT on more than one workstation concurrently,

3.	copy, rent, distribute, sell, license or sublicense, or otherwise transfer the PRODUCT or this license, in whole or in part, to another party, except as specifically set forth above.

4.	use PRODUCT, or any portion of PRODUCT, to develop, or incorporate into, other software that can be executed without a licensed copy of Image-Pro.

The use of PRODUCT, or any portions of PRODUCT, to develop, or incorporate into, other software capable of executing without a licensed copy of Image-Pro, is specifically prohibited under the terms of this Agreement.  Further, the use of PRODUCT, or any portion of PRODUCT, on more than one workstation at one time is specifically prohibited under the terms of this Agreement.  Additional licensing from Media is required for these and any other purpose not specifically granted above.  For further information, please contact Media at:

Media Cybernetics, L.P.
8484 Georgia Avenue
Silver Spring,  MD 20910
U.S.A.
(301) 495-3305

TERMS

The license is effective until terminated.  You may terminate it at any time by destroying the PRODUCT together with all copies and documentation in any form.  It will also terminate automatically and without notice from Media if you fail to comply with any term or condition of this Agreement.  You agree upon such termination to destroy the PRODUCT and all copies of the PRODUCT.

LIMITED WARRANTY

THE PRODUCT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  The entire risk as to the quality and performance of the PRODUCT is with you, should the PRODUCT prove defective.  You (and not Media or any authorized dealer of Media products) assume the entire cost of all necessary servicing, repair, or correction.

Some jurisdictions do not allow the exclusion of implied warranties, so the above exclusion may not apply to you.  The warranty gives you specific legal rights and you may also have other rights which vary from jurisdiction to jurisdiction.

However, Media warrants the program media on which the software is furnished, to be free from defects in materials and workmanship under normal use for a period of ninety (90) days from the date of delivery as evidenced by a copy of your receipt.

LIMITATIONS OF REMEDIES

Media's entire liability and your exclusive remedy shall be:

1.	the replacement of the program media not meeting Media's Limited Warranty and which is returned to Media with a copy of your receipt;

2.	if Media is unable to deliver replacement program media which is free of defects in workmanship, you may terminate this Agreement by returning the PRODUCT and a copy of your receipt to Media, and your money will be refunded.

In no event will Media be liable to you for any damages, including any lost profits, lost savings, or other indirect, special, exemplary, incidental or consequential damages, claims or actions, arising out of the use or inability to use this PRODUCT, even if Media has been advised of the possibility of such damages, claims or actions.  Further, in no event will Media be liable for any claim by any other party arising out of your use of the PRODUCT.

Some jurisdictions do not allow the limitation or exclusion of liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you.

TRADEMARK

Image-Pro® and its component software are trademarks or registered trademarks of Media.  No right, license, or interest to such trademarks is granted hereunder.

U.S. GOVERNMENT RESTRICTED RIGHTS IN DATA CLAUSE

This computer software product and documentation are provided with Restricted Rights.  Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer Software clause at DFARS 252.227-7013, or subparagraphs (c)(1) and (2) of the Commercial Computer Software  Restricted Rights at 48 CFR 52.227-19, as applicable.  Contractor/Manufacturer is Media Cybernetics, L.P., 8484 Georgia Avenue, Silver Spring, Maryland 20910.

GENERAL INFORMATION

You may not sublicense, assign or transfer the license or the PRODUCT, in whole or in part, except as expressly provided in this Agreement.  Any attempt otherwise to sublicense, assign or transfer any of the rights, duties or obligations hereunder is void.

This Agreement will be governed by the laws of the State of Maryland, applicable to agreements made and to be performed in the State of Maryland.

Should any part of this agreement be declared void or unenforceable by a court of competent jurisdiction, the remaining terms shall remain in full effect.

Failure of Media to enforce any of its rights in this agreement shall not be considered a waiver of its rights, including its rights to respond to subsequent breaches.

Should you have any questions concerning this Agreement, you may contact Media Cybernetics by writing:

Media Cybernetics, L.P.
8484 Georgia Avenue
Silver Spring, Maryland  20910 U.S.A.

BY OPENING AND USING THIS SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, UNDERSTAND IT, AND AGREE TO BE BOUND BY ITS TERMS AND CONDITIONS.  YOU FURTHER AGREE THAT THIS AGREEMENT IS THE COMPLETE AND EXCLUSIVE STATEMENT OF THE AGREEMENT BETWEEN YOU AND MEDIA CYBERNETICS AND SUPERSEDES ANY PROPOSAL OR PRIOR AGREEMENT, ORAL OR WRITTEN, ANY OTHER COMMUNICATIONS BETWEEN YOU AND MEDIA CYBERNETICS RELATING TO THE SUBJECT MATTER OF THIS AGREEMENT.


IpAcqAverage

Syntax	IpAcqAverage(Frames, Divider)
Description	This function captures and averages (or accumulates) the specified number of frames from the frame-grabber and displays the result in a new image window.  Equivalent to the Video Average command.
Parameters	Frames	Integer	An integer specifying the number of consecutive frames to accumulate.
	Divider	Integer	An integer from 1 - 255 specifying the value to be used as the divisor for the accumulated total in each pixel.  Specify a value equal to Frames to obtain the mean; specify 1 to obtain the sum.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpAcqAverage(16,16) This statement will average 16 frames acquired from the frame-grabber.
Comments	The capture will be performed using the Acquire options that are currently in effect on the system.
See Also	IpAcqSnap,  IpAcqTimed


IpAcqControl

Syntax	IpAcqControl(Cmd, Param, lpParam)
Description	This function is used to set various options assocated with particular frame-grabbers. It is equivalent to setting the options button in the Video Capture menu.
Parameters	Cmd	Integer	Specifies the type of option that will be set on the video capture board.
	Param	Integer	A value that specifies data required by the option.
	lpParam	Any	A value that specifies the data required by the option. The data type of this value will vary depending on the value in the Cmd.
	Cmd	wParam	lpParam
	48 (Capture Area)	0 = preview 1 = acquire	Address or pointer to a rectangular structure.
Example	Dim captarea as RECT captarea.left = 10 captarea.top  = 20 captarea.right = 300 captarea.bottom = 400 ret = IpAcqControl(48, 1, captarea)
	49 (Exposure Time)	0 = preview 1 = acquire	Address or pointer to a long containing the exposure time in milliseconds.
Example	Dim exposure as long exposure = 1000 ret = IpAcqControl(49, 1, exposure)
	52 (binning)	0 = preview 1 = acquire	Array of two short values containing the x and y binning
Example	Dim binning(2) as integer binning(0) = 2 binning(1) = 2 ret = IpAcqControl(52, 0, binning (0))
	53 (gain)	0 = preview 1 = acquire	Pointer or address to a short containing the gain index
Example	Dim gain as integer gain = 1 ret = IpAcqControl(53, 0, gain)
Comments	Because of the extensive number of farme-grabber combinations, it is not practical to describe all of the possible parameter values allowed by this function here. If you need to obtain the specific values used to set an option on your particular device, use the Record Macro command to record the Option setting steps on your system. Then use the macro editor to view the recorded statement.


IpAcqMultiSnap

Syntax	IpAcqMultiSnap(startframe, numframe, ,destVri )
Description	This function captures multiple image from the frame-grabber.
Parameters	startframe	Integer	The number of the first frame in the range to be captured.
	numframe	Integer	The total number of frames to be captured
	destVri	Integer	An enumerated integer specifying the window into which the image will be captured.  Must be one of the following: ACQ_CURRENT ACQU_FILE ACQ_NEW ACQ_SEQUENCE where, ACQ_NEW saves the captured image to a new image window, and ACQ_CURRENT saves it to the active image window. ACQ_SEQUENCE saves it to a sequencer file.
Example	To capture 4 new images: IpAcqMultiSnap (4,ACQ_NEW) To capture a 4-frame sequence: IpAcqMultiSnap (0,4,ACQ_SEQUENCE)
Comments	The capture will be performed using the Acquire options currently in effect on the system. Note that in previous versions of  this program, the last parameter, destVri, was used to indicate whether to capture the frames to the frame grabber's memory, or to store them in this program as new images. Therefore, acquiring a series of frames was a two-step process, and was only possible if your hardware supported multiple frames in memory. In the current version of this program, IpAcquMultiSnap will automatically use the frame grabber's multiple frame support if possible, or will simulate this capability if necessary. For this reason, the start frame parameter should be set to zero, and the old true/false parameter (toVri) has been replaced by destVri.
See Also	IpAcqSnap


IpAcqSettings

Syntax	IpAcqSettings (File, Save)
Description	This function loads or saves a settings file.
Parameters	File	String	Indicates the path to the settings file that you want to load or save.
	Save	Integer	1 = Save settings to this file. 0 = Load settings to this file
Example	IpAcqSettings("c:\AppName\new.vpf", 0)
Comments	This function can be used to save and reload complicated capture settings. These settings are recorded when you use the Load, Save, or Default buttons on the Setup page.


IpAcqSelectDriver

Syntax	IpAcqSelectDriver (DriverName)
Description	This function selects a frane-grabber driver
Parameters	DriverName	String	Name of the driver you want to use.


IpAcqShow

Syntax	IpAcqShow(Dialog, bShow)
Description	This function displays or hides the video acquisition dialogs.
Parameters	Dialog	Integer	An enumerated integer that specifies the dialog to be displayed or hidden.  Must be one of the following: ACQ_SNAP ACQ_AVG ACQ_TIMED ACQ_MULTI ACQ_LIVE See definitions under Comments, below
	bShow	Integer	A value of 0 or 1 specifying whether the dialog is to be displayed or suppressed.  Where: 0  -  hides the dialog 1  - shows the dialog
Example	ret = IpAcqShow(ACQ_SNAP, 1) ret = IpAcqShow(ACQ_LIVE, 1) These statements will display the Acquire dialog and the live video window.
Comments	The live video window is considered an element of an acquisition dialog.  As such, it can only be shown while one of the other acquisition dialogs is displayed. Dialog options are as follows:
VALUE	DESCRIPTION
ACQ_SNAP	Specifies the Acquire dialog box.
ACQ_AVG	Specifies the Video Average dialog box.
ACQ_TIMED	Specifies the Timed Acquire dialog box.
ACQ_MULTI	Specifies the Multi-Frame Acquire window.
ACQ_LIVE	Specifies the  live video window.
See Also	IpAcqSnap


IpAcqSnap

Syntax	IpAcqSnap(destVri )
Description	This function captures a single image from the frame-grabber.  Equivalent to clicking the Acquire command's Snap button.
Parameters	destVri	Integer	An enumerated integer specifying the window into which the image will be captured.  Must be one of the following: ACQ_CURRENT ACQ_FILE ACQ_NEW ACQ_SEQUENCE where, ACQ_NEW saves the captured image to a new image window, ACQ_CURRENT saves it to the active image window, ACQ_FILE saves it to the the currently defined file, and ACQ_SEQUENCE saves it to a new sequencer image.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.
Comments	The capture will be performed using the Acquire options currently in effect on the system. The destination file for ACQ_FILE will be the last file indicated by the SetFile button.
See Also	IpAcqAverage,  IpAcqTimed,  IpAcqShow, IpAcqMultiSnap


IpAcqTimed

Syntax	IpAcqTimed(Dir, Prefix, StartNumber, Frames, Interval)
Description	This function captures a sequence of images at the specified rate, and saves them to disk.   Equivalent to the Timed Acquire command.
Parameters	Dir	String	A string specifying the directory to which the captured images will be saved.
	Prefix	String	A string specifying the "prefix" to be used to compose the file names for the saved images.   Note - acquired images are automatically stored in TIFF format, and are assigned the .TIF file extension.
	StartNumber	Integer	An integer specifying the sequence number to be appended to the prefix of the first image.  This number is automatically incremented as successive images are stored.
	Frames	Integer	An integer specifying the total number of images to be acquired during the timed-acquire session.
	Interval	Long	An integer specifying the interval, in seconds, at which the images are to be acquired.
Example	ret = IpAcqTimed("c:\images", "img", 1, 10, 45) This statement will acquire and store an image every 45 seconds until 10 images have been obtained.  The captured images will be stored to the "C:\IMAGES" directory under the file names IMG1.TIF, IMG2.TIF, IMG3.TIF. . .IMG10.TIF. You can also save frames to a new Sequencer image workspace by setting both strings to: ret = IpAcqTimed("", "", 0, 3, 5)
Comments	Note that IpAcqTime(Path, Prefix, 0, 0) is equivalent to IpAcqSnap(ACQ_FILE) except that the file name is specified.
See Also	IpAcqSnap, IpAcqMultiSnap


IpAoiChangeName

Syntax	IpAoiChangeName(oldName, newName)
Description	This function changes the name of the specified AOI.  Equivalent to retyping the name of the selected AOI in the AOI Manager dialog box.
Parameters	oldName	String	A string specifying the name of the AOI that is to be renamed.  Must not exceed 20 characters in length.
	newName	String	A string specifying the new name to be given to the AOI.  Must not exceed 20 characters in length.
Example	ret = IpAoiChangeName("Box1", "Quadrant0") This statement will rename the "Box1" AOI to "Quadrant0".


IpAoiCreateBox

Syntax	IpAoiCreateBox(ipRect)
Description	This function creates a rectangular AOI of the size specified by ipRect.  Equivalent to drawing a rectangular AOI using the Rectangular AOI drawing tool on the Ribbon.
Parameters	ipRect	RECT	The name of the variable containing the AOI coordinates.  By default this variable is defined as ipRect.
Example	The following  statements will create a rectangular AOI positioned from 53,111 (upper-left corner) to 102,162 (lower-right corner).  The ipRect definitions preceding the IpAoiCreateBox statement specify the AOI's coordinates.
ipRect.left = 53

ipRect.right = 102

ipRect.top = 111

ipRect.bottom = 162

ret = IpAoiCreateBox(ipRect)

See Also	IpAoiCreateEllipse,  IpAoiCreateIrregular,  IpAoiShow


IpAoiCreateEllipse

Syntax	IpAoiCreateEllipse(ipRect)
Description	This function creates an elliptical AOI, bound by a rectangle of the size specified by ipRect.  Equivalent to drawing an elliptical AOI using the Elliptical AOI drawing tool on the Ribbon.
Parameters	ipRect	RECT	The name of the variable containing the coordinates of the elliptical AOI's rectangular bounding box.  By default this variable is defined as ipRect.
Example	ipRect.left = 53 ipRect.right = 102 ipRect.top = 111 ipRect.bottom = 162 ret = IpAoiCreateEllipse(ipRect) These statements will create an elliptical AOI positioned within the bounding box defined from 53,111 (upper-left corner) to 102,162 (lower-right corner).  The ipRect definitions preceding the IpAoiCreateEllipse statement specify the AOI bounding box coordinates.
See Also	IpAoiCreateBox,  IpAoiCreateIrregular,  IpAoiShow


IpAoiCreateIrregular

Syntax	IpAoiCreateIrregular(ipAoiPoint, NumPoints)
Description	This function creates a freeform AOI of the size and shape specified by ipAoiPoint and NumPoints.  Equivalent to drawing a polygonal AOI using the Freeform AOI drawing tool on the Ribbon.
Parameters	ipAoiPoint	POINTAPI	The name and first element of an array containing the coordinate-pairs specifying the position of each vertex in the shape.  By default this array is defined as Pts.
	NumPoints	Integer	An integer specifying the total number of coordinate-pairs defined in Pts.
Example	ret = IpAoiCreateIrregular(Pts(0), 5) These instructions,create a 5-sided, freeform AOI with vertices at the following x,y pixel positions:
	point 0 = 133,164 point 1 = 109,183 point 2 = 128, 206 point 3 = 161,196 point 4 = 160,180.
Pts(0).x = 133

Pts(0).y = 164

Pts(1).x = 109

Pts(1).y = 183

Pts(2).x = 128

Pts(2).y = 206

Pts(3).x = 161

Pts(3).y = 196

Pts(4).x = 160

Pts(4).y = 180

See Also	IpAoiCreateBox,  IpAoiCreateEllipse,  IpAoiShow


IpAoiGet

Syntax	IpAoiGet(Cmd, Param, OutVal)
Description	Use this function to get information relating to the active AOI.  There is no command equivalent to this function; it is one that must be manually written with the macro editor.
Parameters	Cmd	Integer	A command ID, which specifies the type of AOI information you want to retrieve.  Must be one of the following: GETTYPE GETNUMPTS GETBOUNDS GETPOINTS See definitions under Comments, below
	Param	Integer	An integer specifying data with which Cmd will operate.  See definitions under Comments, below for the values used by each command
	OutVal	See below	The address (name) of the variable that will receive the requested data.  Be sure this variable is of the type required by Cmd.  See Cmd description under Comments, below.
Return Value	The value returned by IpAoiGet depends upon the command that was used.  The table below describes the return value produced by each command.
Cmd	RETURN VALUE
GETTYPE	None
GETNUMPTS	None
GETBOUNDS	None
GETPOINTS	Number of points stored in OutVal.  If this value is equal to Param, OutVal was probably not big enough to hold the entire list of coordinates.
Example	The following example uses IpAoiGet to identify the active AOI's type, and then moves the AOI 100 pixels to the right.
Dim aoitype As Integer

Dim numpoints As Integer

Dim aoirect As RECT

Dim i As Integer

ret = IpAoiGet(GETTYPE, 0, aoitype)

If aoitype = AOI_BOX Then

    ret = IpAoiGet(GETBOUNDS, 0, aoirect)

    aoirect.left = aoirect.left + 100

    aoirect.right = aoirect.right + 100

    ret = IpAoiCreateBox(aoirect)

ElseIf aoitype = AOI_ELLIPSE Then

    ret = IpAoiGet(GETBOUNDS, 0, aoirect)

    aoirect.left = aoirect.left + 100

    aoirect.right = aoirect.right + 100

    ret = IpAoiCreateEllipse(aoirect)

ElseIf aoitype = AOI_POLYGON Then

    ret = IpAoiGet(GETNUMPTS, 0, numpoints)

    Redim aoipts(numpoints) As pointapi

    ret = IpAoiGet(GETPOINTS, numpoints, aoipts(0))

    	For i = 0 To numpoints - 1

    	aoipts(i).x = aoipts(i).x + 100

    	Next i

    ret = IpAoiCreateIrregular(aoipts(0), numpoints)

End If

Comments	When passing an array from a BASIC program, pass the first element of the array by reference (see example above). Cmd options are as follows:
Cmd VALUE	DESCRIPTION	Param VALUE	OutVal  TYPE
GETTYPE	Use this command to determine the type of AOI that is active.  OutVal will be set to one of the following: 0        AOI_BOX    AOI_ELLIPSE  AOI_POLYGON 0 signals that no AOI is currently active.	Not used by GETTYPE.  Must be set to 0.	BASIC, Integer C, LPSHORT
GETNUMPTS	Use this command to determine the number of points in the outline of a   freeform AOI.  OutVal will be set to this value.	Not used by GETNUMPTS.  Must be set to 0.	BASIC, Integer C, LPSHORT
	Note - GETNUMPTS is applicable to freeform AOIs, only (i.e., AOI_POLYGON).
GETBOUNDS	Use this command to get the coordinates defining the AOI's bounding box.  The coordinates will be written to OutVal.	Not used by GETBOUNDS.  Must be set to 0.	BASIC, RECT C, LPRECT
GETPOINTS	Use this command to get the coordinates defining the outline of a freeform AOI.  The coordinates will be written to the array specified in OutVal. Note - this command is applicable to freeform AOIs, only (i.e., AOI_POLYGON).	The maximum number of points that can be written to OutVal (i.e., the length of your array). Note - you can use GETNUMPTS to determine the number of elements needed in this array.	BASIC, POINTAPI C, LPPOINT Note - OutVal must specify an array.
See Also	IpAoiMove,  IpAoiCreateEllipse, IpAoiCreateIrregular,  IpAoiCreateBox,  IpDocOpenAoi


IpAoiManager

Syntax	IpAoiManager(FuncId, Name)
Description	This function is used to manipulate AOIs in the AOI list.  Equivalent to using the Add, Del, Set, Load and Save buttons in the AOI Manager dialog box.
Parameters	FuncId	Integer	An enumerated integer specifying the type of AOI management action that is to be performed.  Must be one of the following: AOIDELETE AOIADD AOISET AOISHOWDLG AOIHIDEDLG AOILOAD AOISAVE See definitions under Comments, below.
	Name	String	A string specifying the data upon which FuncId is to operate.  See definitions under Comments, below, for the values allowed by each option.
Example	This set of statements will create the rectangular AOI defined by ipRect and add it to the current AOI list as "Box1".
ipRect.left = 21

ipRect.top = 18

ipRect.right = 85

ipRect.bottom = 50

ret = IpAoiCreateBox(ipRect)

ret = IpAoiManager(AOIADD, "Box1")

Comments	FuncId options are as follows:
VALUE	DESCRIPTION	Name VALUES
AOIDELETE	Deletes the AOI specified by the Name parameter.	The string in Name must specify the name of the AOI to be deleted.
AOIADD	Adds the active AOI to the AOI list, assigning it the name specified by the Name parameter. Note - If the name specified by the Name parameter is one that already exists in the current AOI list, the new AOI definition will replace the existing one.	The string in Name must specify the name to be given to the added AOI.
AOISET	Assigns the AOI specified by Name to the active image.	The string in Name must specify the name of the AOI to be assigned.
AOISHOWDLG	Displays the AOI Manager dialog box.	The Name parameter is ignored when AOISHOWDLG is used.  When this is the case, just set Name to an empty string (i.e., "").
AOIHIDEDLG	Closes the AOI Manager dialog box if it is open.	The Name parameter is ignored when AOIHIDEDLG is used.  When this is the case, just set Name to an empty string (i.e., "").
AOILOAD	Loads an AOI list from the file specified by Name.	The string in Name must specify the name of the file containing the AOI list.
AOISAVE	Saves the current AOI list to the file specified by Name.	The string in Name must specify the name of the file to which you want the AOI list stored.
See Also	IpAoiChangeName


IpAoiMove

Syntax	IpAoiMove(deltaX, deltaY)
Description	This function moves the active AOI.  Equivalent to dragging the current AOI to a new position with your mouse.
Parameters	deltaX	Integer	An integer specifying the distance, in pixels, by which the AOI is to be moved horizontally.  Positive values move the AOI to the right; negative values to the left.
	deltaY	Integer	An integer specifying the distance, in pixels, by which the AOI is to be moved vertically.  Positive values move the AOI down; negative values up.
Example	ret = IpAoiMove(0, -20) This statement will move the active AOI 20 pixels up from its current position.


IpAoiMultAppend

Syntax	IpAoiMultAppend(Append)
Description	This function adds the current regular AOI to the current multiple AOI or clears the current multiple AOI.
Parameters	Append	Integer	1 = add the current AOI to the multiple AOI 0 = clear/reset the current multiple AOI
Example
ipRect.left = 94

ipRect.top = 131

ipRect.right = 200

ipRect.bottom = 189

ret - AiAoiCreateBox(ipREct)

ret = IpAoiMultShow(1)

ret = IpAoiMultAppend(1)

Comments	IpAoiMultShow must be included in the commands for this marcro to work.
See Also	IpAoiMultShow


IpAoiMultShow

Syntax	IpAoiMultShow(Mode)
Description	This function shows or hides the current multiple AOI.
Parameters	Mode	Integer	1 = show the current multiple AOI 0 = hide the current multiple AOI
See Also	IpAoiMultAppend


IpAoiShow

Syntax	IpAoiShow(FrameType)
Description	This function activates or deactivates the currently defined AOI.  Equivalent to clicking any of the AOI tool buttons on the Ribbon.
Parameters	FrameType	Integer	An enumerated integer specifying the kind of AOI to be activated.  Must be one of the following: FRAME_NONE FRAME_RECTANGLE FRAME_ELLIPSE FRAME_IRREGULAR FRAME_INVIEW See definitions under Comments, below.
Comments	FrameType options are as follows:
VALUE	DESCRIPTION
FRAME_NONE	Deactivates the current AOI.  Equivalent to clicking an enabled AOI tool button to deactivate it.
FRAME_RECTANGLE	Activates the currently defined rectangular AOI.
FRAME_ELLIPSE	Activates the currently defined elliptical AOI.
FRAME_IRREGULAR	Activates the currently defined freeform AOI.
FRAME_INVIEW	Moves the AOI so it can be seen.  Useful in Zoom and Pan modes.
See Also	IIpAoiCreateBox, IpAoiCreateEllipse,  IpAoiCreateIrregular


IpAoiValidate

Syntax	IpAoiValidate( )
Description	This function refreshes the image's internal AOI description, based on the AOI currently shown on the screen.  For performance reasons the internal AOI is not maintained in real-time (i.e., it is not updated every time the user moves, resizes or deactivates an AOI).  Instead, it is the responsibility of each AOI-constrained operation to initialize this description (from the screen) when it begins.  Application commands perform this function implicitly.  Similarly, if you are developing your own AOI-constrained process, your procedure must call IpAoiValidate when it begins.  This ensures that the region affected by your program is the one most recently defined by your user.
See Also	IpAoiCreateBox,  IpAoiCreateEllipse,  IpAoiCreateIrregular


IpAppArrange

Syntax	IpAppArrange(mode)
Description	This function is used to arrange open image windows within theapplication window.  Equivalent to the Tile Images, Cascade Images or Arrange Images commands.
Parameters	mode	Integer	An enumerated integer specifying the way in which the open image windows are to be arranged.  Must be one of the following: DOCS_CASCADE DOCS_TILE DOCS_OVERLAP See definitions under Comments, below.
Example	ret = IpAppArrange(DOCS_OVERLAP) This statement will arrange the windows one on top of the other.
Comments	mode options are as follows:
VALUE	DESCRIPTION
DOCS_CASCADE	Layers all open image windows one on top of the other, such that all title bars are visible. Equivalent to the Cascade command.
DOCS_TILE	Arranges all open image windows in side-by-side (i.e., "tiled") fashion.  Equivalent to the Tile command.
DOCS_OVERLAP	Stacks all open image windows one on top of the other.  Equivalent to the Overlap command.
See Also	IpDocMinimize,  IpDocMaximize, IpDocMove


IpAppCloseAll

Syntax	IpAppCloseAll( )
Description	This function closes all open image windows.  Equivalent to the Close All command.
See Also	IpAppExit,  IpDocClose


IpAppCtl

Syntax	IpAppCtl(CtlName,ParamCommand, ParmValue)
Description	Gets or sets value of a control in the currrently active dialog box.
Parameters	CtlName	String	The label, caption, or string ID of the control.
	ParamCommand	Integer	Commands to invoke. Must be one of the following:
	Command	Value	Description
	APC_GETHWND	Variable that will receive the handle of the control.	Gets the window handle of a control.
	APC_CLICK	Ignored.	Clicks a button (control).
	APC_GETFOCUSID	Return value.	Returns the ID of the control in focus.
	APC_SETFOCUSID	ID of control	Sets the ID of the control in focus.
	APC_SETCHECK	0 = uncheck 1= check	Checks or unchecks a checkbox or radio button.
	APC_GETCHECK	0 = uncheck 1= check	Gets the state of a checkbox or radio button.
	APC_SETSCROLL	-1 = up -2 = down -3 = top most -4 = bottom most -5 = page up -6  = page down	Sets the scroll position with relative or absolute values.  A positive value sets the scroll positon.
	APC_GETSCROLL	Scroll position	Gets the scroll position of the scroll box.
	APC_GETCURSEL	0 = topmost Current selection  in  a list box.	Gets the current selection in a list box or a drop-down combo box.
	APC_SETCURSEL	0 = topmost	Sets the current selection in a list box or a drop-down combo box.
	APC_SETPOSX	0 = first column	Sets the column position of a grid
	APC_SETPOSY	0 = first row	Sets the row of a grid
	ParamValue	Long	Values for ParamCommand
See Also	IpAppWindow, IpAppCtlText


IpAppCtlText

Syntax	IpAppCtlText(CtlName,Caption, Mode)
Description	Gets or sets value of a caption of a control
Parameters	CtlName	String	The label, caption, or string ID of the control on the currently active window or dialog.
	Caption	String	The caption of the control.
	Mode	Integer	0 = Gets the caption into Caption. 1= Sets the caption of the control to Caption.
Example	The first example sets the edit text box following "File Name" with "Germs.TIF". The second example copies the content of control ID 2342 into the Caption.
ret = IpAppCtlText("FileName", "Germs.Tif",1)

ret = IpAppCtlText( "#2342",Caption, 0)

See Also	IpAppCtl


IpAppExit

Syntax	IpAppExit( )
Description	This function closes the application.  Equivalent to the Exit command.
See Also	IpAppCloseAll,  IpDocClose


IpAppGet

Syntax	IpAppGet(Cmd, Param, OutVal)
Description	Multi-purpose query function for application-related information.
Parameters	Cmd	Integer	A command ID. See table below for list of commands.
	Param	Integer	Parameter of the command
	OutVal	Any	The address of the variable that will receive the results of the command.  The type of this variable depends on the command.
Example
'Get the Windows handle for AppName

Dim ipHandle as integer  for 16-bit only

Dim ipHandle as long   for 32-bit only

ret = IpAppGet(GETAPPWND, 0, ipHandle)

'Check that AppName is running

if ipHandle = 0 then

' AppName is not running.

...

end if

'Get the serial number of the copy protection plug:

Dim plugsn as integer

ret = IpAppGet (GETPLUGSN, 0, plugsn)

if ret <> 0 then

'Plug was found. Check serial number.

if plugsn = 1234 then

...

end if

Declare function IpAppGet2 lib ipc32.dll alias IpAppGet
(byval sCmd as itenter, byval sParam as integer, byval lpParam as string) as integer

use ipc32.dll for 32-bit only

use ipc16.dll for 16-bit only

  sub load_image0

dim appdir as string*255

  	ret = IpAppGet2(GETAPPDIR, 0, appdir)

ret = IpWsLoad(rtrim$(appdir) + images\spots.tif, TIF)

  end sub

Comments	Each copy of this program has a unique serial number which is printed on the box and  programmed into the copy protection plug.
Command	Param	OutVal	Return Value	Description
GETAPPWND	Not used. Must be 0.	C: *HWND Integer (16-bit Basic) Long (32-bit Basic)	None.	Gets the Windows handle to Image-Pro. When called from an external program, this command will return 0 if Image-Pro is not running.
GETAPPDIR	Not used. Must be 0.	LPBYTE (C), String (Basic)	None.	Returns the path to the directory where Image-Pro is installed.
GETPLUGSN	Not used. Must be 0.	LPSHORT (C), Integer (Basic)	0 if plug is not found. 1 if plug is found.	Gets the serial number of the copy protection plug. Each copy of this program has a unique serial number.
See Also	IpDocGet


IpAppHide

Syntax	IpAppHide(bHide )
Description	This function displays or suppresses the display of the application window controls.  Equivalent to toggling between Show Border and Hide Border views using the F4 key.
Parameters	bHide	Integer	A value of 0 or 1 specifying whether the control border is to be displayed or suppressed.  Where: 0  - displays the control border 1  - suppress the control border
Example	ret = IpAppHide(1) This statement will  hide the control border.


IpAppMaximize

Syntax	IpAppMaximize( )
Description	This function maximizes (enlarges to maximum size) the  application window.  Equivalent to clicking the Maximize button on the Control bar.
See Also	IpAppMinimize,  IpAppRestore,  IpAppSize,  IpDocMaximize


IpAppMenuSelect

Syntax	IpAppMenuSelect(Id1, Id2, ItemName, Mode)
Description	This function is used to invoke a menu item from the main command bar.  This command is never recorded; it is one that must be manually written into your macro if it is needed. This command may be recorded using the Insert : Menu Selection command on  the Macro menu.
Parameters	Id1	Integer	An integer specifying the menu or menu item to be invoked.  The values required by Id1 are determined by Mode.  See Mode definitions below.
	Id2	Integer	An integer specifying the sub-menu item to be invoked.  The values required by Id2 are determined by Mode.  See Mode definitions below.
	ItemName	String	A string specifying the menu item name, as it is defined in the *.MNU file.  This parameter is  used when Mode is set to MENU_NAME.
	Mode	Integer	An enumerated integer specifying the method by which the menu item is being specified.  Must be one of the following:
			MENU_ID MENU_NAME MENU_COORD See definitions under Comments, below.
Example	The following statements illustrate three ways in which the Open menu command could be invoked, assuming its default *.MNU definition had not been modified.
ret = IpAppMenuSelect(102, 0, "", MENU_ID)

ret = IpAppMenuSelect(0, 0, "&Open...", MENU_NAME)

ret = IpAppMenuSelect(0, 1, "", MENU_COORD)

Comments	Mode options, and their associated Id1, Id2 and ItemName values are as follows.  Shaded parameters are ones that are ignored when the described Mode is used.
Mode	DESCRIPTION	Id1	Id2	ItemName
DLG_MENU_ID	Used to invoke the menu of  an active dialog box by its menu ID.	An integer specifying the command's ID number.	ID2 is ignored.  Set it to 0.	ItemName is ignored.  Set it to an empty string (i.e., "").
DLG_MENU_NAME	Used to invoke a menu or tab of  an active dialog box by its name.	ID1 is ignored.  Set it to 0.	ID2 is ignored.  Set it to 0.	A string specifying the command's name.
DLG_MENU_COORD	Used to invoke a menu command or tab of an active dialog box by its position on the menu or tab.	Specifies the menu on which the command is located, where 0 is the first menu or tab, 1 is the second menu or tab and so forth.	Specifies the item number within the menu, where 0 is the first item in the  menu, 1 is the second item and so forth.	ItemName is ignored.  Set it to  an empty string (i.e., "").
MENU_ID	Used to invoke a resident command by its *.MNU ID number. See important note below about the use of MENU_ID.	An integer specifying the command's ID number as defined in *.MNU.	ID2 is ignored.  Set it to 0.	ItemName is ignored.  Set it to an empty string (i.e., "").
MENU_NAME	Used to invoke a menu command by its *.MNU name.	ID1 is ignored.  Set it to 0.	ID2 is ignored.  Set it to 0.	A string specifying the command's name, as defined in *.MNU.
MENU_COORD	Used to invoke a menu command by its position on the command bar.	Specifies the menu on which the command is located, where 0 is the first menu, 1 is the second menu and so forth.	Specifies the item number within the menu, where 0 is the first item in the  menu, 1 is the second item and so forth.	ItemName is ignored.  Set it to  an empty string (i.e., "").
When MENU_ID is used, the Id1 parameter must reference the ID value defined in the command's progitem or progbutton statement in the *.MNU file.  The ID value is the last value listed in such a statement, as shown below:

progitem Ne&w...,Make document.,0,101

progbutton SAVE,Save current document to disk.,783, 105

Important - the MENU_ID option can only be used to call commands that are resident within the main  program, not commands that reside in a Dynamic Link Library (DLL).  Therefore, it cannot be used to invoke commands that are defined with item or button statements in *.MNU.

When MENU_NAME is used, the ItemName parameter must contain the name of the command exactly as it is defined by the  progitem or item statement in the *.MNU file, including the & symbol and any embedded spaces or punctuation (such as an ellipsis).  The name is contained in the Title parameter of a *.MNU progitem or item statement, as shown in the examples below:

progitem Ne&w...,Make document.,0,101

item &Color Transform...,Color Models.,colordlg.dll,56,100

Note that the name includes all characters up to, but not including, the comma that separates the name from the following parameter.

See Also	IpAppSize,  IpDocMove


IpAppMinimize

Syntax	IpAppMinimize( )
Description	This function minimizes (reduces to an icon) the application window.  Equivalent to clicking the Minimize button on the Control bar.
See Also	IpAppMaximize,  IpAppRestore,  IpAppSize,  IpDocMinimize


IpAppMove

Syntax	IpAppMove(x, y)
Description	This function moves the application window to the screen position specified by x,y, where x,y specifies the new position for the upper-left corner of the window.  Equivalent to dragging the  application window to a new position.
Parameters	x	Integer	An integer specifying the x-coordinate of the pixel to which the upper-left corner of the window is to be moved.
	y	Integer	An integer specifying the y-coordinate of the pixel to which the upper-left corner of the window is to be moved.
Example	ret = IpAppMove(20,40) This statement will move the application window to screen position 20,40.
See Also	IpAppSize,  IpDocMove


IpAppRestore

Syntax	IpAppRestore( )
Description	This function returns the application window to its previous screen position and size, from a minimized or maximized state.  Equivalent to clicking the Restore button on a maximized window or double-clicking the icon of a minimized window.
See Also	IpAppMaximize,  IpAppMinimize


IpAppRun

Syntax	IpAppRun(CommandLine, ShowMode, RunMode)
Description	This function executes a DOS or Windows application program.  There is no command equivalent for this function; it is one that must be manually written to your macro with the macro editor.
Parameters	CommandLine	String	A string specifying the program file name (if it is a Windows application) or the PIF file name (if it is a DOS application) and any required arguments.
	ShowMode	Integer	An enumerated integer specifying the way in which the application's window is to be displayed after the program is loaded.  Must be one of the following: RUN_NORMAL RUN_MINIMIZED RUN_MAXIMIZED See definitions under Comments, below.
	RunMode	Integer	An enumerated integer specifying the way in which control is to be transferred.  Must be one of the following: RUN_AUTOCLOSE RUN_MODAL 0  See definitions under Comments, below.
Example	ret = IpAppRun("DEMO10.EXE", RUN_NORMAL, RUN_AUTOCLOSE) This statement loads the DEMO10 program and displays its window at its normal size and position.  This program will automatically close when this program is closed.
Comments	Allowable ShowMode options are as follows:
ShowMode	DESCRIPTION
RUN_NORMAL	Displays the application window in its default size and position.
RUN_MINIMIZED	Displays the application window as an icon.
RUN_MAXIMIZED	Displays the application window in full-screen mode.
Allowed RunMode options are as follows:

RunMode	DESCRIPTION
0	The macro will continue executing after the application is loaded.  The application will remain open when the program is closed.
RUN_AUTOCLOSE	The macro will continue executing after the application is loaded.  The application will automatically close when the program is closed.
RUN_MODAL	The macro will stop and resume only after the other application is terminated (your program will be disabled while the application is active).


IpAppSelectDoc

Syntax	IpAppSelectDoc(DocId)
Description	This function makes the specified image window the active image, where DocId specifies the number associated with an open image.
Parameters	DocId	Integer	An integer identifying the ID of the open image (where the first image opened is image 0) or one of the following: DOCSEL_NEXTID DOCSEL_PREVID See definitions under Comments, below.
Example	ret = IpAppSelectDoc(2) This statement will select image window number 2 as the active image.
Comments	A document "ID" (DocId) is assigned to an image window when it is opened.  It retains this ID for the duration of its existence.  IDs are assigned consecutively, in the order in which images are opened.  The next higher ID number is used when a new window is created — e.g., if image 4 is already open, the next image is assigned an ID of 5. Because of the dynamic nature of DocId (the mix and sequence of images on your desktop varies from session to session), macros involving multiple images should be recorded and played back from an empty imaging area (i.e., one in which there are no images open), or images should be selected relatively using the DOCSEL_NEXTID and DOCSEL_PREVID options described below.  These measures will ensure that the recorded image numbers select the intended images on playback.
DocId	DESCRIPTION
DOCSEL_NEXTID	Selects the image with the next-higher ID, relative to the active image.  If the active image has the highest ID, the image with the lowest ID is selected.
DOCSEL_PREVID	Selects the image with the next-lower ID, relative to the active image.  If the active image has the lowest ID, the image with the highest ID is selected.


IpAppSize

Syntax	IpAppSize(Width, Height)
Description	This function changes the size of the application window to the specified  width and height.
Parameters	Width	Integer	An integer specifying the width, in pixels, at which the application window is to be displayed.
	Height	Integer	An integer specifying the height, in pixels, at which the application window is to be displayed.
Example	ret = IpAppSize(800, 400) This statement will resize the application window to half-screen length on a super-VGA monitor.
Comments	Be aware that there is a minimum size to which the application window can be set.  If you specify dimensions below this minimum, your values will be ignored, and the minimum will be used.  The minimum values vary depending upon the resolution of your screen and the font that is used.
See Also	IpAppRestore,  IpAppMove


IpAppUpdateDoc

Syntax	IpAppUpdateDoc(DocId)
Description	This function directs the program  to repaint the specified image window, repaint all open image windows or refrain from repainting any image window.  From an Auto-Pro macro, it can be used to force a repaint before macro termination, so that the results of intermediate macro steps can be viewed as they occur.  From a Visual Basic or Visual C++ program, it can be used to improve program performance by selectively updating the screen. There is no command equivalent for this function; it is one that must be manually written into your macro with the macro editor.
Parameters	DocId	Integer	An integer identifying the ID of the open image (where the first image opened is image 0) or one of the following: DOCSEL_ACTIVE DOCSEL_ALL DOCSEL_NONE See definitions under Comments, below.
Example	The following Auto-Pro macro segment will adjust the brightness and contrast characteristics of the active image, and then sharpen it.  After each operation the image will be repainted.  This allows the viewer to see the result of each step as it is executed.  Without the IpAppUpdateDoc statements in this macro, the user would see only the final result when the macro was finished. Note - if this segment were executed from a Visual Basic or Visual C++ program, the screen would automatically be updated after each step.  See second example, below.
ret = IpLutSetAttr(LUT_BRIGHTNESS, 78)

ret = IpAppUpdateDoc(DOCSEL_ACTIVE)

ret = IpLutSetAttr(LUT_CONTRAST, 60)

ret = IpAppUpdateDoc(DOCSEL_ACTIVE)

ret = IpLutApply()

ret = IpFltSharpen(5, 8, 2)

If the following sequence were called from a Visual Basic or Visual C++ program, the active image would not be updated until the entire sequence of LUT and filtering statements had been performed.

ret = IpAppUpdateDoc(DOCSEL_NONE)

ret = IpLutSetAttr(LUT_BRIGHTNESS, 78)

ret = IpLutSetAttr(LUT_CONTRAST, 60)

ret = IpLutApply()

ret = IpFltSharpen(5, 8, 2)

ret = IpFltMedian(5, 2)

ret = IpAppUpdateDoc(DOCSEL_ACTIVE)

Comments	Update the image window only when it is truly necessary.  Frequent repainting will slow down a macro.  DocId options are as follows:
DocId VALUE	DESCRIPTION
DOCSEL_ACTIVE	Specifies that the active image is to be repainted.
DOCSEL_ALL	Specifies that all open images are to be repainted.
DOCSEL_NONE	Specifies that no images are to be repainted until the next call to IpAppUpdateDoc with DOCSEL_ACTIVE or DOCSEL_ALL is performed.   In a Visual Basic or Visual C++ program, you might want to use DOCSEL_NONE to eliminate screen painting for performance reasons, since the screen is, otherwise, updated every time an Auto-Pro function is called (DOCSEL_NONE can be set in an Auto-Pro macro, too, however, there is really no purpose in doing so, since by default, the screen is updated only when the macro ends or is interrupted by a message box).  In any event, regardless of what program called DOCSEL_NONE, it must, at some point before its termination, disable this mode by calling DOCSEL_ALL or DOCSEL_ACTIVE.  If this isn't done, the non-painting mode will continue to be in effect even after the macro or program terminates, and  returns it to its normal, interactive mode.


IpAppWindow

Syntax	IpAppWindow(WindowName, WindowParm, Mode)
Description	Gets the name and window ID of the active window, or activates a window.
Parameters	Window Name	String	The title of the active window.
	Window Parm	Long	The ID or title of the active window.
	Mode	Integer	0 = Gets the name of the active window in WindowName 1= Gets the ID of the active window in WindowParm 2 = Gets the handle of the active window in WindowParm 3 = Activates the window named in WindowName 4 = Activates a window with the ID equal to WindowParm 4 = Activates a window with the window handle equal to WindowParm
Example	The following example shows how the AppWindow parameters are used.
ret = IpAppWindow (Untitled1,0,3)

ret = IpAppWindow (, 1324,4)

ret = IpAppWindow (WindowName,0, 1,)
ret = IpAppWindow (Bugs.TIF,WindowParm, 2,)
ret = IpAppWindow (, WindowParm,5)

See Also	IpAppCtl


IpAppWndPos

Syntax	IpAppWndPos(WindowName, ipRect, Mode)
Description	Sets or gets the position of a window using screeen coordinates
Parameters	Window Name	String	The name or ID of the window.
	IpRect	RECT	Location of the window in screen coordinates.
	Mode	Integer	0 = Gets the window position  1= Sets the window position
See Also	IpAppWindow, IpAppWndState


IpAppWndState

Syntax	IpAppWndState(WindowName, State, Mode)
Description	Sets or gets the state of a window.
Parameters	Window Name	String	The name or ID of the window.
	State	Integer	WST_ENABLED WST_VISIBLE WST_NORMAL WST_MINIMIZED WST_MAXIMIZED
	Mode	Integer	0 = Get the window state 1= Set the window state
See Also	IpAppWindow, IpAppWndPos


IpBitAttr

Syntax	IpBitAttr(Attribute, Value)
Description	This function selects, sets or deselects options relating to the Bitmap Analysis  command.
Parameters	Attribute	Integer	An enumerated integer identifying the option to be set.  Must be one of the following: BIT_SAMPLE BIT_CALIB BIT_SAVEALL See definitions under Comments, below.
	Value	Integer	An integer specifying how the option specified in Attrib is to be set.  See definitions below for the values allowed by each option.
Example	The following example sets the sampling rate to every other pixel on every other line. ret = IpBitAttr(BIT_SAMPLE, 2)
Comments	Attrib options are as follows:
Attribute	DESCRIPTION	Value VALUES
BIT_SAMPLE	Sets the sampling rate to the interval specified in Value. Equivalent to the Bitmap Analysis  window's Sampling command.	1  - Every pixel. 2  - Every other pixel. 3  - Every 3rd pixel. . . .
BIT_CALIB	Specifies whether the bitmap values are reported in calibrated or uncalibrated format.  Equivalent to the Bitmap Analysis window's Intensity Cal command.	0  -  Display actual. 1  - Display calibrated.
BIT_SAVEALL	Specifies whether the top row and left column will be saved with the bitmap values.  Equivalent to the Bitmap Analysis  window's Pixel Values Only command.	0  -  Save pixels only. 1  -  Save pixels with row and column legends.
See Also	IpBitShow,  IpBitSaveData


IpBitSaveData

Syntax	IpBitSaveData(Filename, SaveMode)
Description	This function saves a block of image data in ASCII form to a file or to the Clipboard.  Equivalent to the Bitmap Analysis window's Save Data, Append Data, and Copy To Clipboard commands.
Parameters	Filename	String	A string specifying the name of the file to which the bitmap analysis ASCII data will be written.  This parameter is ignored when SaveMode is set to S_CLIPBOARD.  When this is the case, set FileName to an empty string (i.e., "").
	SaveMode	Integer	An enumerated integer specifying whether the bitmap data is to be stored as a new file, appended to an existing file or written to the Clipboard.  Where:   0   - Stores data to a new file (if the file already exists, it will be overwritten). S_APPEND   -  Appends data to an existing file. S_CLIPBOARD -  Copies data to the Clipboard. S_LEGEND  -  Save the legend with the pixel data. If  the legend is not included, this is equivalent to checking "pixel values only."
Return Value	This function will return a 0 if successful.  A negative number, otherwise.
Example	The following example will save a block of image data from an AOI to the Clipboard.
' create a 16x16 box AOI.

ipRect.left = 100

ipRect.top = 100

ipRect.right = 115

ipRect.bottom = 115

ret = IpAoiCreateBox(ipRect)

' show the bitmap analysis tool.

ret = IpBitShow(1)

' set save attribute to pixels only.

ret = IpBitAttr(BIT_SAVEALL, 0)

' copy the 16x16 block to the clipboard.

ret = IpBitSaveData("", S_CLIPBOARD)

Comments	You must call IpBitShow to open the Bitmap Analysis window before calling this function.  IpBitSaveData will fail if the Bitmap Analysis window is not displayed.
See Also	IpBitShow,  IpBitAttr


IpBitShow

Syntax	IpBitShow(bShow)
Description	This function is used to display, hide and update the Bitmap Analysiswindow.    Equivalent to selecting the Bitmap Analysiscommand to open the window or   clicking the Updatemenu or Close button within it to update or close it.
Parameters	bShow	Integer	An integer value of 0, 1 or 2, specifying whether the Bitmap Analysis command window is to be shown, closed or updated.  Where: 0  - Closes the window if it is already open. 1  - Opens the window. 2  - Updates the window.
Example	ret = IpBitShow(1) The statement above will open the Bitmap Analysis command window.
Comments	If you intend to save bitmap data using IpBitSaveData, you must first call this function with its bShow flag enabled.  Otherwise, IpBitSaveData will fail.
See Also	IpBitSaveData,  IpBitAttr


IpBlbCount

Syntax	IpBlbCount( )
Description	This function counts and measures the objects in the active image or AOI.  Equivalent to clicking the Count button in the Count/Sizecommand window.
Return Value	This function returns an integer representing the number of counted objects within range, or 0 if no objects were found.
Comments	The program will utilize the current intensity, option and measurement settings if you have not explicitly set them using the IpBlbSetRange, IpBlbSetAttr and IpBlbEnableMeas functions.   When it is necessary to ensure that your counting macro operates under specific intensity, options and measurement values, consider saving these values to an environment file.  Your program can then initialize the environment by loading this file via the IpBlbLoadSetting function.  Or you may set them explicitly via the IpBlbSetAttr function.
See Also	IpBlbSetAttr,  IpBlbEnableMeas,  IpBlbSetRange,  IpBlbLoadSetting


IpBlbCreateMask

Syntax	IpBlbCreateMask( )
Description	This function makes a mask from the current count/size result. Equivalent to selecting the Make Mask command from the Image menu in the Count/Size window.
Comments	This statement does nothing if there is no count associated with the active image.


IpBlbData

Syntax	IpBlbData(Measure, FromObj, ToObj, DataArray)
Description	This function is used to get the measurement data associated with the active object count.  There is no command equivalent to this function; it is one that must be manually written with the macro editor.
Parameters	Measure	Integer	An enumerated integer specifying the measurement type for which data is to be obtained.  Must be one of the following:
			BLBM_AREA BLBM_ASPECT BLBM_BOX_AREA BLBM_BOX_XY BLBM_CENTRX BLBM_CENTRY BLBM_DENSITY BLBM_DIRECTION BLBM_HOLEAREA BLBM_HOLEAREARATIO
			BLBM_MAJORAX BLBM_MINORAX BLBM_MAXFERRET BLBM_MINFERRET BLBM_MEANFERRET BLBM_MAXRADIUS BLBM_MINRADIUS BLBM_NUMHOLES BLBM_PERIMETER BLBM_RADIUSRATIO
			BLBM_ROUNDNESS BLBM_CLUSTER BLBM_RED BLBM_GREEN BLBM_BLUE BLBM_PERAREA BLBM_CLASS See definitions under IpBlbEnableMeas.
	FromObj	Integer	An integer representing the ID number of the first object for which you want measurements (the very first object in the counted set is considered object 0).
	ToObj	Integer	An integer representing the ID number of the last object for which you want measurements (the very first object in the counted set is considered object 0).
	DataArray	Float (Basic) LPFLOAT (C)	The address (name) of the array (of BASIC type, Single) that will receive the measurement data. This array should be large enough to store (ToObj - FromObj + 1) numbers.
Return Value	0 if successful.
Example	The following example obtains the aspect ratio measurement for all objects in the count.
Dim NumObj As integer

ret = IpBlbGet(GETNUMOBJ, 0, 0, NumObj)

Redim Values(NumObj) As Single

ret = IpBlbData(BLBM_ASPECT, 0, NumObj - 1, Values(0))

Comments	When passing an array to the program from a BASIC program, be sure to pass the first element of the array by reference (see example above).
See Also	IpBlbGet,  IpBlbCount,  IpBlbMeasure,  IpBlbFilter


IpBlbDelete

Syntax	IpBlbDelete( )
Description	This function clears the current set of counted objects and measurements.  Equivalent to clicking the Delete button in the Count/Size command window.


IpBlbEnableMeas

Syntax	IpBlbEnableMeas(MeasurementType, bEnable)
Description	This function enables or disables the specified measurement type in preparation for a Count/Size operation.  Equivalent to selecting or deselecting a measurement type with the Select Measurements command.
Parameters	MeasurementType	Integer	An enumerated integer specifying the measurement to be selected or deselected.  Must be one of the following:
			BLBM_AREA BLBM_ASPECT BLBM_BOX_AREA BLBM_BOX_XY BLBM_CENTRX BLBM_CENTRY BLBM_DENSITY BLBM_DIRECTION BLBM_HOLEAREA BLBM_HOLEAREARATIO BLBM_MAJORAX BLBM_MINORAX
			BLBM_MAXFERRET BLBM_MINFERRET
			BLBM_MAXRADIUS BLBM_MINRADIUS BLBM_NUMHOLES BLBM_PERIMETER BLBM_RADIUSRATIO BLBM_ROUNDNESS BLBM_CLUSTER BLBM_RED BLBM_GREEN BLBM_BLUE BLBM_PERAREA BLBM_CLASS See definitions below.
	bEnable	Integer	An integer value of 0 or 1 that will select or deselect the measurement type specified in MeasurementType as follows: 0  -  Deselects the specified measurement 1  -  Selects the specified measurement
Example	ret = IpBlbEnableMeas(BLBM_PERIMETER,1) This statement selects the perimeter measurement.  When the IpBlbCount or IpBlbMeasure function is subsequently performed, the perimeter measurement (and any other currently selected measurements) of all counted objects are recorded.
Comments	To ensure that your counting macro records all, and only, the measurement types you want, consider saving the settings to an environment file.  Your program can then initialize the environment with the appropriate measurement types by loading this file via the IpBlbLoadSetting function.  Allowable MeasurementType options are as follows:
MeasurementType	DESCRIPTION
BLBM_AREA	Selects the Area measurement type.
BLBM_ASPECT	Selects the "Aspect" measurement type.
BLBM_BOX_AREA	Selects the "Box/Area" measurement type.
BLBM_BOX_XY	Selects the "Box X/Y" measurement type.
BLBM_CENTRX	Selects the "Centr-X" measurement type.
BLBM_CENTRY	Selects the "Centr-Y" measurement type.
BLBM_DENSITY	Selects the "Density" measurement type.
BLBM_DIRECTION	Selects the Angle measurement type.
BLBM_HOLEAREA	Selects the "Hole Area" measurement type.
BLBM_HOLEAREARATIO	Selects the "Hole Ratio" measurement type.
BLBM_MAJORAX	Selects the "Major Axis" measurement type.
BLBM_MINORAX	Selects the "Minor Axis" measurement type.
BLBM_MAXFERRET	Selects the "Max Diameter" measurement type.
BLBM_MINFERRET	Selects the "Min Diameter" measurement type.
BLBM_MAXRADIUS	Selects the "Max Radius" measurement type.
BLBM_MINRADIUS	Selects the "Min Radius" measurement type.
BLBM_NUMHOLES	Selects the "Holes" measurement type.
BLBM_PERIMETER	Selects the "Perimeter" measurement type.
BLBM_RADIUSRATIO	Selects the "Radius Ratio" measurement type.
BLBM_ROUNDNESS	Selects the "Round" measurement type.
BLBM_CLUSTER	Selects the "Cluster" measurement type.
BLBM_RED	Specifies the "Red"  measurement type.
BLBM_BLUE	Specifies the "Blue"  measurement type.
BLBM_GREEN	Specifies the "Green"  measurement type.
BLBM_PERAREA	Specifies the "PerArea"  measurement type.
BLBM_CLASS	Specifies the "Class"  measurement type.
See Also	IpBlbCount,  IpBlbSetAttr,  IpBlbLoadSetting,  IpBlbMeasure


IpBlbFilter

Syntax	IpBlbFilter( )
Description	This function eliminates counted objects whose measurements do not meet the specified measurement criteria.  Equivalent to the "Filter Objects" button in the "Set Ranges" dialog box.
See Also	IpBlbSetFilterRange


IpBlbGet

Syntax	IpBlbGet(Cmd, Param1, Param2, OutVal)
Description	Use this function to get information relating to the object count in the current image.  There is no  command equivalent to this function; it is one that must be manually written with the macro editor.
Parameters	Cmd	Integer	A command ID, which specifies the type of  information you want to retrieve.  Must be one of the following: GETNUMOBJ GETSTATUS GETPOINTS GETSTATS GETHIT GETTHRESH GETHBLOB See definitions under Comments, below.
	Param1	Integer	An integer specifying data with which Cmd will operate.  See definitions under Comments, below, for the values required by each command
	Param2	Integer	An integer specifying additional data with which Cmd will operate.  See definitions under Comments, below, for the values required by each command
	OutVal	See below	The address (name) of the variable that will receive the requested data.  Be sure this variable is of the type required by Cmd.  See Cmd description under Comments, below.
Return Value	IpBlbGet returns a 0 if successful except when used with the GETPOINTS command.  Then it will return the number of points stored to OutVal.  If this value is equal to Param2, chances are that OutVal was not large enough to hold all of the points.  See GETPOINTS under Comments, below.
Example	The following statements perform an XOR on the inside of all visible objects.
Redim blbpts(1000) As POINTAPI

Dim numpoints As Integer, numobj As Integer

Dim status As Integer, i As Integer

' get the total number of objects, in-range and out-of-range,

' hidden and visible.

ret = IpBlbGet(GETNUMOBJ, 0, 0, numobj)

For i = 0 To numobj - 1

ret = IpBlbGet(GETSTATUS, i, 0, status)

Print ret ' (status)

' if object in-range and visible...

If status >= 0 Then

'	get the outline of the object

numpoints = IpBlbGet(GETPOINTS, i, 1000, blbpts(0))

Print numpoints

If numpoints > 0 Then

' create AOI out of the object outline and XOR it.

ret = IpAoiCreateIrregular(blbpts(0), numpoints)

ret = IpOpNumberLogic(0, OPL_NOT, 0)

End If

End If

Next i

The following statements binarizes the active image based upon the threshold established by the count.

Dim threshold As Single

ret = IpBlbGet(GETTHRESH, 0, 0, threshold)

ret = IpLutBinarize(0, threshold, 0)

Comments	When passing an array to the program  from a BASIC program, be sure to pass the first element of the array by reference (see example, above). Commands are listed below:
Cmd	DESCRIPTION
GETNUMOBJ	This command gets the number of objects that have been counted in the active image.  This number  will be written to OutVal.
		Param1 VALUE	Param2 VALUE	OutVal TYPE
		An integer from 1 to 255 specifying the class, or 0 for all classes.	0  - All objects 1  -  In-range objects	BASIC, Integer C, LPSHORT
GETSTATUS	Gets the status of the object specified in Param1.  Status is written to OutVal, as follows: -1 -  Object is out of range or hidden. -0 -  Object is in range. 1 to 255  -  object is in range and belongs to the indicated class (i.e., OutVal will report a value from 1 to 255 when data have been classified).
		Param1 VALUE	Param2 VALUE	OutVal TYPE
		An integer specifying the requested object's number, where 0 is the first object, 1 is the second object, and so forth.	Not used by GETSTATUS.  Must be set to 0.	BASIC, Integer C, LPSHORT
GETPOINTS	This command gets the list of coordinates defining the outline of the object specified in Param1.  The coordinates will be written to the array you have specified in OutVal.   Note - the number of points written to OutVal will be returned by the IpBlbGet.  If this value is equal to Param2, OutVal was probably not big enough to hold the entire list of coordinates.
GETPOINTS		Param1 VALUE	Param2 VALUE	OutVal TYPE
(cont)		An integer specifying the requested object's number, where 0 is the first object, 1 is the second object, and so forth.	The number of elements allocated in OutVal (i.e., the size of the array).	BASIC, POINTAPI C,  LPPOINT
GETSTATS	This command gets the statistical data for the measurement type specified by Param2.  It will write the statistics to a 10-element array in OutVal, as follows: OutVal (0) -  Mean value OutVal (1) -  Standard Deviation OutVal (2) -  Minimum measurement OutVal (3) -  Maximum measurement OutVal (4) -  Range OutVal (5) -  Sum OutVal (6) -  Object ID-1 with Minimum measurement OutVal (7) -  Object ID-1 with Maximum measurement OutVal (8) -  Number of objects OutVal (9) -  Not Currently Used
GETSTATS		Param1 VALUE	Param2 VALUE	OutVal TYPE
		An integer from 1 to 255 specifying a specific class, or 0 for all classes.	An enumerated integer specifying the requested measurement type   (e.g., BLBM_AREA, BLBM_ASPECT, BLBM_RED).  See list below for a complete list of the allowed measurement types:	BASIC, Single C,  LPFLOAT Note - OutVal must specify a 10-element array.
GETHIT	This command prompts the user to click on an object.  It will write the object's label number to OutVal.  A 0 will be written to OutVal if the user does not select a valid object.  Note - an object's label number is its external number — the one the user sees on the screen when the labels are displayed.  External numbering begins with 1, not 0.
		Param1 VALUE	Param2 VALUE	OutVal TYPE
		Not used by GETHIT.  Must be set to 0.	Not used by GETHIT.  Must be set to 0.	BASIC , Integer C, LPSHORT
GETTHRESH	This command calculates the threshold between objects and background.  It writes the threshold value to OutVal.
		Param1 VALUE	Param2 VALUE	OutVal TYPE
		Not used by GETTHRESH.  Must be set to 0.	Not used by GETTHRESH.  Must be set to 0.	BASIC , Single C,  LPFLOAT
GETHBLOB	This command gets the handle to the active count structure.  It writes the handle to OutVal.
		Param1 VALUE	Param2 VALUE	OutVal TYPE
		Not used by GETHBLOB.  Must be set to 0.	Not used by GETHBLOB.  Must be set to 0.	BASIC , Integer C, LPSHORT
MeasurementType	DESCRIPTION
BLBM_AREA	Selects the Area measurement type.
BLBM_ASPECT	Selects the "Aspect" measurement type.
BLBM_BOX_AREA	Selects the "Box/Area" measurement type.
BLBM_BOX_XY	Selects the "Box X/Y" measurement type.
BLBM_CENTRX	Selects the "Centr-X" measurement type.
BLBM_CENTRY	Selects the "Centr-Y" measurement type.
BLBM_DENSITY	Selects the "Density" measurement type.
BLBM_DIRECTION	Selects the Angle measurement type.
BLBM_HOLEAREA	Selects the "Hole Area" measurement type.
BLBM_HOLEAREARATIO	Selects the "Hole Ratio" measurement type.
BLBM_MAJORAX	Selects the "Major Axis" measurement type.
BLBM_MINORAX	Selects the "Minor Axis" measurement type.
BLBM_MAXFERRET	Selects the "Max Diameter" measurement type.
BLBM_MINFERRET	Selects the "Min Diameter" measurement type.
BLBM_MAXRADIUS	Selects the "Max Radius" measurement type.
BLBM_MINRADIUS	Selects the "Min Radius" measurement type.
BLBM_NUMHOLES	Selects the "Holes" measurement type.
BLBM_PERIMETER	Selects the "Perimeter" measurement type.
BLBM_RADIUSRATIO	Selects the "Radius Ratio" measurement type.
BLBM_ROUNDNESS	Selects the "Round" measurement type.
BLBM_CLUSTER	Selects the "Cluster" measurement type.
BLBM_RED	Specifies the "Red"  measurement type.
BLBM_BLUE	Specifies the "Blue"  measurement type.
BLBM_GREEN	Specifies the "Green"  measurement type.
BLBM_PERAREA	Specifies the "PerArea"  measurement type.
BLBM_CLASS	Specifies the "Class"  measurement type.
See Also	IpBlbCount,  IpBlbData


IpBlbLoadOutline

Syntax	IpBlbLoadOutline(OutlineFile)
Description	This function loads a counted object, outline file into the active image.  Equivalent to the Load Outlines command located on the Count/Size window's File menu.
Parameters	OutlineFile	String	A string specifying the name of the file from which the outlines are to be read.
Example	ret = IpBlbLoadOutline("C:\APPNAME\DATA.OUT") This statement will load outlines from the file DATA.OUT in the \APPNAME directory on the C: drive.
Comments	The file specified by OutlineFile must be a binary .OUT file, not an ASCII outline file.  See IpBlbSaveOutline.
See Also	IpBlbSaveOutline


IpBlbLoadSetting

Syntax	IpBlbLoadSetting(SettingFile)
Description	This function loads the environment values (i.e., the intensity, option and measurement selections) from an environment file.  Equivalent to the Load Settings command located on the Count/Size window's File menu.
Parameters	SettingFile	String	A string specifying the name of the file from which the environment values will be read.
Example	ret = IpBlbLoadSetting("C:\APPNAME\SPORES.ENV") This statement will initialize the environment with values from the SPORES.ENV file located in the \APPNAME directory on the C: drive.
Comments	Consider using this function to initialize the environment if you are developing a counting macro that must be executed under the same conditions each time it is run.
See Also	IpBlbSaveSetting


IpBlbMeasure

Syntax	IpBlbMeasure( )
Description	This function performs the selected measurements upon the current set of counted objects.  Equivalent to clicking the Measure button in the Select Measurements dialog box.
Example	ret = IpBlbEnableMeas(BLBM_CENTRX, 1) ret = IpBlbEnableMeas(BLBM_MAXFERRET, 1) ret = IpBlbMeasure() This set of statements will select the Centr-X (BLBM_CENTRX) and Max. Dia. (BLBM_MAXFERRET) measurements, and will then measure the counted objects.
See Also	IpBlbEnableMeas,  IpBlbFilter


IpBlbMultRanges
IpBlbMultiRanges

Syntax	IpBlbMultiRanges(intRanges, NumRanges )
Description	This function sets multiple range limits for gray-scale images. It is equivalent to the "Select Ranges" command in the Count/Size window. Do not use this command with RGB-class images.
Parameters	intRanges	Float (Basic) LPFLOAT (C)	It contains 2*numranges of float type values specifying the starting and ending values of each range.
	numranges	Integer	Indicates the total number of ranges specified.
See Also	IpBlbSetRange


IpBlbRemoveHoles

Syntax	IpBlbRemoveHoles( )
Description	This function eliminates counted objects that are embedded within other counted objects, and considers all pixels encompassed by the perimeter of an object as belonging to the object.  Equivalent to the Remove Holes command on the Edit menu in the Count/Sizecommand window.
See Also	IpBlbSetAttr


IpBlbSaveClasses

Syntax	IpBlbSaveClasses(DataFile, Append)
Description	This function saves or appends the contents of the Classification window to a file, or writes the data to the Clipboard.  Equivalent to the Save, Append and Copy to Clipboard commands on the File menu in the Classification window.
Parameters	DataFile	String	A string specifying the name of the file to which the measurement data will be written.  This parameter is ignored when Append is set to S_CLIPBOARD.  When this is the case, set DataFile to an empty string (i.e., "").
	Append	Integer	An enumerated integer specifying whether the measurement data is to be stored as a new file, appended to an existing file or written to the Clipboard.  Where:   0  - Stores data to a new file (if the file already exists, it will be overwritten). S_APPEND   -  Appends data to existing file. S_CLIPBOARD -  Copies data to the Clipboard.
Example	ret = IpBlbShowSingleClass(18,ipbins(),5,1) ret = IpBlbSaveClasses("C:\APPNAME\CLASS.CNT", 0) The set of statements above will display the Classification window and divide the perimeter measurement into 5 classes.  Then, the classification data will be saved as a new file, CLASS.CNT, in the \APPNAME directory on the C: drive.     ret = IpBlbShowSingleClass(18,ipbins(),5,1) ret = IpBlbSaveClasses("C:\APPNAME\CLASS.CNT", S_APPEND) The set of statements above will display the Classification window and divide the perimeter measurement into 5 classes.  Then, the classification data will be appended to CLASS.CNT in the \APPNAME directory on the C: drive.
Comments	The IpBlbShowSingleClass function, with its bShow flag enabled, must be called before this function.  Otherwise, no data will be saved.


IpBlbSaveData

Syntax	IpBlbSaveData(DataFile, Append)
Description	This function saves, or appends, the current measurements or statistics to a file or the Clipboard.  Equivalent to the Save Data, Append Data and Copy to Clipboard commands on the Measurements and Statistics windows' File menus.
Parameters	DataFile	String	A string specifying the name of the file to which the measurement data will be written.  The file extension determines the file format.  Where: .WK1 - Lotus® WK1 format. .XLS - Microsoft® Excel XLS format.
			Anything else specifies ASCII format.
	Append	Integer	An expression involving the addition of two enumerated integers, where the first operand specifies whether the measurement data or statistics are to be stored, as follows: S_DATA  -  Measurement Data S_STATS  -  Measurement Statistics and the second operand specifies whether the measurement data is stored as a new file, appended to an existing file or written to the Clipboard, as follows:   S_APPEND   -  Appends data to existing file. S_CLIPBOARD -  Copies data to the Clipboard. If no second operand is supplied, the data is saved to a new file (if the file already exists, it will be overwritten). See the examples below for usage.
Example	ret = IpBlbSaveData("C:\APPNAME\DATA.CNT", S_DATA) This statement will save the current measurement data to a new file called DATA.CNT in the \APPNAME directory on the C: drive. ret = IpBlbSaveData("C:\APPNAME\DATA.CNT", S_DATA+S_APPEND) This statement will append the current measurement data to a file called DATA.CNT in the \APPNAME directory on the C: drive. ret = IpBlbSaveData("", S_STATS+S_CLIPBOARD) This statement will append the current statistic data to the Clipboard.  The DataFile parameter is set to a zero-length string, as this data is not required for a Clipboard operation.


IpBlbSaveOutline

Syntax	IpBlbSaveOutline(OutlineFile)
Description	This function saves the current counted-object outlines to a file.  Equivalent to the Save Outlines command on the File menu in the Count/Sizecommand window.
Parameters	OutlineFile	String	A string specifying the name of the file to which the current object outlines will be written.  The file name's extension determines the format in which it is saved, where: .OUT  -  Specifies a binary outline file. Anything else specifies an ASCII-format outline file.
Example	ret = IpBlbSaveOutline("C:\APPNAME\PERIM.OUT") This statement will save the current outlines in binary form to the PERIM.OUT file in the \APPNAME directory on the C: drive.
See Also	IpBlbLoadOutline


IpBlbSavePopDensities

Syntax	IpBlbSavePopDensities(DataFile, append)
Description	This function  saves, or appends, the current population density results to a file or the Clipboard.  Equivalent to the Save, Append and Copy to Clipboard commands on the Population Density windows' File menu.
Parameters	DataFile	String	A string specifying the name of the file to which the population density data will be written.  This parameter is ignored when append is set to S_CLIPBOARD.  When this is the case, set DataFile to an empty string (i.e., "").
	append	Integer	An enumerated integer specifying whether the population density data is to be stored as a new file, appended to an existing file or written to the Clipboard.  Where:   0  - Stores data to a new file (if the file already exists, it will be overwritten). S_APPEND   -  Appends data to existing file S_CLIPBOARD -  Copies data to the Clipboard
Example	ret = IpBlbSavePopDensities("C:\APPNAME\PD1.cnt", 0) This statement will save the contents of the Population Density window to the PD1.CNT file in the \APPNAME directory on the C: drive. ret = IpBlbSavePopDensities("C:\APPNAME\PD1.cnt", S_APPEND) This statement will append the contents of the Population Density window to the PD1.CNT file in the \APPNAME directory on the C: drive. ret = IpBlbSavePopDensities("", S_CLIPBOARD) This statement will save the contents of the Population Density window to the Clipboard.  The DataFile parameter is set to a zero-length string, as this data is not required for a Clipboard operation.
Comments	The IpBlbShowPopDens function, with its bShow flag enabled, must be called before this function.  Otherwise, no data will be saved.
See Also	IpBlbShowPopDens


IpBlbSaveSetting

Syntax	IpBlbSaveSetting(SettingFile)
Description	This function saves the current Count/Size intensity, option and measurement settings to a file.  Equivalent to the Count/Size window's Save Settings command.
Parameters	SettingFile	String	A string specifying the name of the file to which the current environment settings will be written.
Example	ret = IpBlbSaveSetting("C:\APPNAME\SPORES.ENV") This statement will save the current Count/Size environment settings to the SPORES.ENV file in the \APPNAME directory on the C: drive.
See Also	IpBlbLoadSetting


IpBlbSetAttr

Syntax	IpBlbSetAttr(Attrib, Value)
Description	This function selects, sets or deselects options relating to the Count/Size command.
Parameters	Attrib	Integer	An enumerated integer which identifies the option to be set.  Must be one of the following: BLOB_OUTLINEMODE BLOB_OUTLINECOLOR BLOB_LABELMODE BLOB_LABELCOLOR BLOB_SMOOTHING BLOB_MINAREA BLOB_FILLHOLES
			BLOB_BRIGHTOBJ BLOB_AUTORANGE BLOB_MEASUREOBJECTS BLOB_FILTEROBJECTS BLOB_ADDCOUNT BLOB_CLEANBORDER See definitions under Comments, below.
	Value	Integer	An integer specifying how the option specified in Attrib is to be set.  See definitions below for the values allowed by each option.
Example	ret = IpBlbSetAttr(BLOB_LABELCOLOR,2)  This statement sets the label color to blue.
Comments	Attrib options are as follows:
ATTRIB	DESCRIPTION	ALLOWED VALUES
BLOB_OUTLINEMODE	Selects the outline style	0  -  None
	to be applied to the	1  -  Outline
	counted objects.	2  -  With Holes
	Equivalent to selecting	3  -  Filled
	the outline style in the	4  -  Ellipse
	Count/Size options	5  -  Class
	dialog box.
BLOB_OUTLINECOLOR	Selects the outline color	0  -  Red
	to be used to outline the	1  -  Yellow
	counted objects.	2  -  Green
	Equivalent to selecting	3  -  Cyan
	the outline color in the	4  -  Blue
	Count/Size options	5  -  Magenta
	dialog box.	6  -  White
		7  -  Black
BLOB_LABELMODE	Selects the label style	0  -  None
	to be used to tag the	1  -  Object #
	counted objects.	2  -  Class
	Equivalent to selecting
	the label style in the
	Count/Size options
	dialog box.
BLOB_LABELCOLOR	Specifies the color to be	0  -  Red
	used to label the counted	1  -  Green
	objects.  Equivalent  to	2  -  Blue
	selecting the label color	3  -  Yellow
	in the Count/Size	4  -  Cyan
	options dialog box.	5  -  Magenta
		6  -  White
		7  -  Black
		8 - Dark Red
		9 - Brown
BLOB_SMOOTHING	Specifies how much smoothing is to be performed to the counted object's outline.	You may specify a value from 0 to 100, inclusive, where 0 specifies no smoothing, and 100 specifies maximum smoothing.
BLOB_MINAREA	Specifies whether the	0  -  Deselects Pre-filter
	total object population	1  -  Selects Pre-filter
	will be comprised of all intensity-matching objects, or just objects meeting the specified measurement criteria.  Equivalent to the Pre-filter option in the Count/Sizeoptions dialog box
BLOB_FILLHOLES	Specifies whether all	0  -  Deselects fill holes
	pixels encompassed by	1  -  Selects fill holes
	an object's perimeter belong to the object, or whether just the pixels possessing a value within the selected intensity range are part of the object.  Equivalent to the Fill Holes option in the Count/Size Options dialog box.
BLOB_CLEANBORDER	Specifies whether objects that intersect the edge of the active image or AOI are to be included in the	0  - Count all objects
	count.  Equivalent to the Clean Borders option in the Count/Size	1  - Do not count objects intersecting the image border.
	Options dialog box.
		2 - Do not count objects intersecting the East and West borders
		4 - Do not count objects intersecting the North and South borders.
BLOB_BRIGHTOBJ	Specifies whether objects	0  - Selects dark objects.
	are comprised of dark or	1  - Selects bright
	bright intensities	objects.
	relative to the back-ground.  This attribute is relevant only when the Automatic intensity selection mode is set
	(BLOB_AUTORANGE enabled).  Equivalent to selecting the Bright Objects or Dark Objects radio button in the Count/Size command window.
BLOB_AUTORANGE	Specifies whether objects	0  - Selects manual
	are to be extracted	intensity selection.
	using the auto-matic intensity selection	1  - Selects automatic intensity selection.
	feature, or whether they are to be set according to the values specified by IpBlbSetRange.  Equivalent to selecting the Automatic or Manual radio button  in the Count/Sizecommand window.
BLOB_MEASUREOBJECTS	Specifies whether objects will simply be counted,	0  - Do not measure objects.
	or whether they will be counted and measured.	1  - Count and measure objects.
	Equivalent to the Measure Objects checkbox in the Count/Sizewindow.
BLOB_FILTEROBJECTS	Specifies whether the measurement criteria	0  - Ignore range criteria.
	will be applied during the count process.	1  - Apply range criteria.
	Equivalent to the Apply Ranges check box in the Count/Sizecommand window.
BLOB_ADDCOUNT	Specifies whether the measurements of new	0  - Adds new results to existing count.
	objects will replace, or be merged with, the existing measurement	1  - Replaces existing count with new results
	results.  Equivalent to the Add Count check box in the Count/Size command window.
See Also	IpBlbSetRange


IpBlbSetFilterRange

Syntax	IpBlbSetFilterRange(MeasurementType, min, max)
Description	This function sets measurement criteria.  Equivalent to specifying the Start and End  values for each measurement with the Set Ranges command on the Measure menu in the Count/Size command window.
Parameters	MeasurementType	Integer	An enumerated integer specifying the measurement for which criteria is to be set.  Must be one of the following: BLBM_AREA BLBM_ASPECT BLBM_BOX_AREA BLBM_BOX_XY BLBM_CENTRX BLBM_CENTRY BLBM_DENSITY BLBM_DIRECTION BLBM_HOLEAREA BLBM_HOLEAREARATIO BLBM_MAJORAX BLBM_MINORAX
			BLBM_MAXFERRET BLBM_MINFERRET BLBM_MEANFERRET BLBM_MAXRADIUS BLBM_MINRADIUS BLBM_NUMHOLES BLBM_PERIMETER BLBM_RADIUSRATIO BLBM_ROUNDNESS BLBM_CLUSTER BLBM_RED
			BLBM_GREEN BLBM_BLUE BLBM_PERAREA BLBM_CLASS See definitions under IpBlbEnableMeas.
	min	Float	A number (of IPBASIC type, Single) specifying the smallest value to be allowed for the specified measurement.
	max	Float	A number (of IPBASIC type, Single) specifying the largest value to be allowed for the specified measurement.
Example	ret = IpBlbSetFilterRange(BLBM_PERIMETER, 95.0, 450.0) This statement will set the range of allowable perimeter values from 95.0 to 450.0.
Comments	The min and max values must be expressed in terms of the current calibration.
See Also	IpBlbFilter


IpBlbSetRange

Syntax	IpBlbSetRange(Start, End)
Description	This function specifies the range of intensities that define objects to be counted when Automatic intensity selection is disabled (BLOB_AUTORANGE off).  Equivalent to clicking the Set Range button in the Count/Size command window and selecting the intensity range manually.
Parameters	Start	Integer	An integer between 0 and 255 (inclusive) that defines the smallest allowed value in the range.
	End	Integer	An integer between 0 and 255 (inclusive) that defines the largest allowed value in the range.
Example	ret = IpBlbSetRange(58, 109) This statement specifies that pixels possessing intensity values between 58 to 109 (inclusive) comprise objects. Note - in 12-bit and floating-point images, the normalized equivalents to these values will be used.
Comments	For RGB images, the Start and End values represent the values of the luminance channel.
See Also	IpBlbSetAttr


IpBlbShow

Syntax	IpBlbShow(bShow)
Description	This function is used to open or close the Count/Sizecommand window.  Equivalent to selecting the Count/Size command to open the window, and clicking the Close button within it to close it.
Parameters	bShow	Integer	Am integer value of 0 or 1 specifying whether the Count/Size command window is to be shown.  Where: 0  - Closes the window if it is already open. 1  - Opens the window.
Example	ret = IpBlbShow(1) This statement will make the Count/Size command window visible during execution of the macro.
Comments	The Count/Size command window does not have to be open during execution of any of the count macro functions.  Its disposition, visible or hidden, is entirely your choice.  You will want to display the window if your users will be required to make choices within it, but if your objective is simply to obtain measurement results, you may want to run without opening it.
See Also	IpBlbSaveData,  IpBlbSaveClasses,  IpBlbSavePopDensities


IpBlbShowAutoClass

Syntax	IpBlbShowAutoClass(ipClassifiers, NumMeas, NumClasses, bIterate, bShow)
Description	This function performs an auto-classification process on the current set of measurement results.  Equivalent to the Auto-classification command located on the Measure menu in the Count/Sizecommand window.
Parameters	ipClassifiers	Integer (Basic) LPSHORT (C)	The name and first element of an array containing the integers representing the measurement types that are to be used for classification.  By default this array is defined as ipClassifiers(0). See Comments, below, for valid classifier values.
	NumMeas	Integer	An integer from 1 to 3 (inclusive) specifying the number of types by which auto-classification is to be done.  Equivalent to counting the number of Classifiers selected in the Auto-Classification dialog box.  This value identifies the number of elements in the ipClassifiers array.
	NumClasses	Integer	An integer from 1 to 16 (inclusive) specifying the maximum number of categories into which the data will be classified.  Equivalent to the value entered into the Max. Classes: field in the Auto-Classification dialog box.
	bIterate	Integer	An integer value of 0 or 1 specifying whether the iteration option is to be applied during classification.  Where: 0  -  Iterate option off. 1  -  Iterate option on. Equivalent to deselecting/selecting the Iterate check box in the Auto-Classification dialog box.
	bShow	Integer	An integer value of 0 or 1 specifying whether the Auto-Classification window is visible or hidden, where: 0  -  Sets the window to be hidden. 1  -  Sets the window to be visible.
Example	This set of statements performs an iterative auto-classification of the three classifiers into 7 categories.  The auto-classification window is displayed during classification.      ipClassifiers(0) = BLBM_AREA ipClassifiers(1) = BLBM_ASPECT ipClassifiers(2) = BLBM_CENTRX ret = IpBlbShowAutoClass(ipClassifiers(0), 3, 7, 1,1)
Comments	The ipClassifiers array must contain integers representing the measurement types that are to be used.  The following enumerated integers can be used:
ipClassifiers( ) VALUE	DESCRIPTION
BLBM_AREA	Specifies Area measurement type.
BLBM_ASPECT	Specifies the "Aspect" measurement type.
BLBM_BOX_AREA	Specifies the "Box/Area" measurement type.
BLBM_BOX_XY	Specifies the "Box X/Y" measurement type.
BLBM_CENTRX	Specifies the "Centr-X" measurement type.
BLBM_CENTRY	Specifies the "Centr-Y" measurement type.
BLBM_DENSITY	Specifies the "Density" measurement type.
BLBM_DIRECTION	Specifies the Angle measurement type.
BLBM_HOLEAREA	Specifies the "Hole Area" measurement type.
BLBM_HOLEAREARATIO	Specifies the "Hole Ratio" measurement type.
BLBM_MAJORAX	Specifies the "Major Axis" measurement type.
BLBM_MINORAX	Specifies the "Minor Axis" measurement type.
BLBM_MAXFERRET	Specifies the "Max Diameter" measurement type.
BLBM_MINFERRET	Specifies the "Min Diameter" measurement type.
BLBM_MAXRADIUS	Specifies "Max Radius" measurement type.
BLBM_MINRADIUS	Specifies the "Min Radius" measurement type.
BLBM_NUMHOLES	Specifies the "Holes" measurement type.
BLBM_PERIMETER	Specifies the "Perimeter" measurement type.
BLBM_RADIUSRATIO	Specifies the "Radius Ratio" measurement type.
BLBM_ROUNDNESS	Specifies the "Round" measurement type.
BLBM_CLUSTER	Specifies the "Cluster" measurement type.
BLBM_RED	Specifies the "Red"  measurement type.
BLBM_BLUE	Specifies the "Blue"  measurement type.
BLBM_GREEN	Specifies the "Green"  measurement type.
BLBM_PERAREA	Specifies the "PerArea"  measurement type.
BLBM_CLASS	Specifies the "Class"  measurement type.
See Also	IpBlbEnableMeas


IpBlbShowCluster

Syntax	IpBlbShowCluster(bShow)
Description	This function performs a cluster analysis of the current measurements and displays the Clusters Info message box.  Equivalent to the Clusters command located on the Measure menu in the Count/Size command window.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether to open or close the "Clusters" dialog box.  Where: 0  -  Closes the dialog box. 1  -  Opens the dialog box and performs the cluster analysis.
Example	ret = IpBlbShowCluster(1) This statement will perform the cluster analysis, display the analysis results in the Cluster dialog box and wait for the user to click OK before proceeding to the next macro statement.
Comments	Although the macro recorder writes a pair of IpBlbShowCluster statements when the Clusters command is recorded (one with bShow = 1 and another with bShow = 0) the statement with bShow = 0 is ignored.  The Clusters message box is displayed by the first statement, then macro execution halts until the user clicks OK.
	When execution resumes, IpBlbShowCluster(0) is read, but is ignored as the user has already closed the message box.  The function has been implemented this way to ensure macro compatibility with future versions of Auto-Pro.


IpBlbShowData

Syntax	IpBlbShowData(bShow)
Description	This function opens or closes the Measurements data window.  Equivalent to the Measurement Data command located on the Count/Size window's View menu.
Parameters	bShow	Integer	A value of 0 or 1 specifying whether to open or close the Measurement data window.  Where: 0  -  Closes the Measurements data window 1  -  Opens the Measurements data window
Example	ret = IpBlbShowData(1) This statement will display the measurements data window.


IpBlbShowHistogram

Syntax	IpBlbShowHistogram(Measure, Bins, bShow)
Description	This function displays a histogram of the specified measurement.  Equivalent to the Histogram command on the Count/Size command window's View menu. Note - do not confuse this function with the Histogram command used to create intensity histograms.  This functions plots measurement results.  See IpHstCreate for intensity plotting.
Parameters	Measure	Integer	An enumerated integer specifying the type of measurement that is to be graphed.  Must be one of the following: BLBM_AREA BLBM_ASPECT BLBM_BOX_AREA BLBM_BOX_XY BLBM_CENTRX BLBM_CENTRY BLBM_DENSITY BLBM_DIRECTION
			BLBM_HOLEAREA BLBM_HOLEAREARATIO BLBM_MAJORAX BLBM_MINORAX BLBM_MAXFERRET BLBM_MINFERRET BLBM_MAXRADIUS BLBM_MINRADIUS BLBM_NUMHOLES BLBM_PERIMETER BLBM_RADIUSRATIO
			BLBM_ROUNDNESS BLBM_CLUSTER BLBM_RED BLBM_GREEN BLBM_BLUE BLBM_PERAREA BLBM_CLASS See definitions under IpBlbEnableMeas.
	Bins	Integer	An integer between 0 and 100 (inclusive) specifying the number of bins to be graphed.
	bShow	Integer	An integer value of 0 or 1 specifying whether the Histogram dialog box is to be displayed or hidden.  Where: 0  -  Hides the Histogram  window. 1  -  Displays the Histogram window.
Example	ret = IpBlbShowHistogram(BLBM_AREA,8,1) This statement will display an 8-bin histogram of the area measurement, then wait for the user to close the dialog box before continuing to the next macro statement.
Comments	When the bShow value is set to 1, the histogram is displayed and macro execution halts until the user manually closes the histogram window.  Once the window is closed, macro execution resumes at the next statement.   When the bShow value is set to 0, the IpBlbShowHistogram statement is ignored — no histogram window is shown, and execution is not halted.  The function has been implemented this way to ensure its compatibility with future versions of Auto-Pro.
See Also	IpBlbEnableMeas


IpBlbShowObjectWindow

Syntax	IpBlbShowObjectWindow(bShow)
Description	This function displays the object window.  Equivalent to the Object Window command located on the Count/Size command window's View menu.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether to open or close the Object information window.  Where: 0  -  Closes the Object  window. 1  -  Opens the Object window.
Example	ret = IpBlbShowObjectWindow(1) This statement will display the Object window.


IpBlbShowPopDens

Syntax	IpBlbShowPopDens(OutlineFile, bShow)
Description	This function performs a population density analysis.  Equivalent to the Population Density command located on the Count/Sizewindow's Measure menu.
Parameters	OutlineFile	String	A string specifying the name of the file from which the site outlines will be read.
	bShow	Integer	An integer value of 0 or 1 specifying whether the Population Density window and the site outlines are to be displayed .  Where: 0  - Closes the Population Density window if it is already open, or suppresses its display if a population density measurement is being performed.   1  - Displays the Population Density window and site outlines.
Example	ret = IpBlbShowPopDens("C:\APPNAME\CELLS.OUT", 1) This statement will perform a population density analysis using the site outlines from the CELLS.OUT file in the \APPNAME directory on the C: drive.  The Population Density window, and the cell site outlines will be displayed.
Comments	To close the Population Density window, set the bShow parameter to 0 and specify a zero-length string in OutlineFile, as shown in the following example: ret = IpBlbShowPopDens("", 0) If you intend to save population density information to the Clipboard or a file, you must first call this function with its bShow flag enabled.  Otherwise, no data will be saved.
See Also	IpBlbSavePopDensities,  IpBlbShow


IpBlbShowScattergram

Syntax	IpBlbShowScattergram(xMeasure, yMeasure, bShow)
Description	This function displays a scattergram of the specified measurement types.  Equivalent to the Scattergram command on the Count/Sizecommand window's View menu.
Parameters	xMeasure	Integer	An enumerated integer specifying the type of measurement that is to be graphed on the X-axis.  Must be one of the following: BLBM_AREA BLBM_ASPECT BLBM_BOX_AREA BLBM_BOX_XY BLBM_CENTRX BLBM_CENTRY BLBM_DENSITY
			BLBM_DIRECTION BLBM_HOLEAREA BLBM_HOLEAREARATIO BLBM_MAJORAX BLBM_MINORAX BLBM_MAXFERRET BLBM_MINFERRET BLBM_MAXRADIUS BLBM_MINRADIUS BLBM_NUMHOLES BLBM_PERIMETER BLBM_RADIUSRATIO BLBM_ROUNDNESS BLBM_CLUSTER BLBM_RED BLBM_GREEN BLBM_BLUE BLBM_PERAREA BLBM_CLASS See definitions under IpBlbEnableMeas.
	yMeasure	Integer	An enumerated integer specifying the type of measurement that is to be graphed on the Y-axis.  See xMeasure for allowed values.
	bShow	Integer	An integer value of 0 or 1, specifying whether to open or close the Scattergram window.  Where: 0  -  Closes the Scattergram  window. 1  -  Opens the Scattergram window.
Example	ret = IpBlbShowScattergram(BLBM_AREA, BLBM_PERIMETER, 1) This statement will display a scattergram of the area and perimeter measurements then wait for the user to close the scattergram before continuing to the next macro statement.
Comments	When the bShow value is set to 1, the scattergram is displayed and macro execution is halted until the user manually closes the scattergram window.  Then, macro execution resumes with the next statement.  When the bShow value is set to 0, the IpBlbShowScattergram statement is ignored — no scattergram is shown, and macro execution is not halted.  The function has been implemented in this way to ensure its compatibility with future versions of Auto-Pro.  When a Scattergram command is recorded, the IpBlbShowScattergram function is not written to the script file until the Scattergram window is closed.


IpBlbShowSingleClass

Syntax	IpBlbShowSingleClass(NumMeasurements, ipBins, NumClasses, bShow)
Description	This function classifies the specified measurement type.
Parameters	NumMeasurements	Integer	An enumerated integer specifying the measurement type that is to be classified. See MeasurementType parameter under IpBlbEnableMeas for allowed values.
	ipBins	Float (Basic) LPFLOAT (C)	The name and first element of an array containing the values (of IPBASIC type, Single) specifying the intervals into which the measurement is to be classified.   The first value represents the beginning of the first interval, the second the beginning of the second interval and so forth.  The last value in the array specifies the end of the range. Equivalent to the "Bins Start At" values in the Classification dialog box.
	NumClasses	Integer	An integer specifying the number of classifications into which the measurement is to be divided.
	bShow	Integer	An integer value of 0 or 1 specifying whether to display the Classification window.  Where: 0  -  Closes the Classification  window. 1  -  Opens the Classification window. When bShow is set to 0, the NumMeasurements, ipBins and NumClasses parameters are ignored.
Example	The following set of statements divides the perimeter into 6 classes, as defined by the values in ipBins.  The results are displayed in the Classification window and saved to the file CLASS2.CNT.  The window is then be closed.
ipBins(0) = 8.0

ipBins(1) = 51.83333

ipBins(2) = 95.66666

ipBins(3) = 139.50

ipBins(4) = 183.3333

ipBins(5) = 227.1667

ipBins(6) = 271.0

ret = IpBlbShowSingleClass(18, ipBins(0), 6, 1)

ret = IpBlbSaveClasses("C:\APPNAME\CLASS2.CNT", 0)

ret = IpBlbShowSingleClass(0, ipBins(0), 0, 0)

Comments	If you intend to save classification data to the Clipboard or a file, you must first call this function with its bShow flag enabled.  Otherwise, no data will be saved.
See Also	IpBlbSaveClasses


IpBlbShowStatistics

Syntax	IpBlbShowStatistics(bShow)
Description	This function calculates and, optionally, displays the statistics window.  Equivalent to the Statistics command on the Count/Size command window's View menu.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether to open or close the Statistics information window.  Where: 0  -  Closes the Statistics  window. 1  -  Opens the Statistics window.
Example	ret = IpBlbShowStatistics(1) This statement will calculate statistics for the current measurement results, show the Statistics window then append the data to the STATS.CNT file.
See Also	IpBlbSaveData


IpBlbSmoothObjects

Syntax	IpBlbSmoothObjects(smoothing)
Description	This function smoothes object outlines.  Equivalent to the Smooth Objects command on the Edit menu in the Count/Sizecommand window.
Parameters	smoothing	Integer	An integer between 1 and 100 (inclusive) specifying the degree of smoothing that is to be applied.
Example	ret = IpBlbSmoothObjects(50) This statement will apply smoothing to the counted outlines using a smoothing degree of 50.
See Also	IpBlbSetAttr


IpBlbSplitObjects

Syntax	IpBlbSplitObjects(bWatershed)
Description	This function splits counted objects within the active image or AOI using either the auto-split or watershed-split method.  Equivalent to the Auto-Split and Watershed Split commands on the Count/Sizecommand window's Edit menu.
Parameters	bWatershed	Integer	An integer value of 0 or 1specifying whether to use the Watershed or Automatic splitting method.  Where: 0  -  Applies the "Auto-Split" method. 1  -  Applies the "Watershed" method.
Example	ret = IpBlbSplitObjects(1) This statement will split counted objects using the Watershed method.


IpBlbUpdate

Syntax	IpBlbUpdate(bRedrawImage)
Description	This function updates the active image window, as well as the Measurements and Statistics windows, if they are open.  When a macro is recorded, this function is automatically inserted after any action that affects the display of counted objects in the image window, or the results that are presented in the data sheets.  There is no equivalent command in the interactive mode, as the screen is automatically updated anytime a command affects it.
Parameters	bRedrawImage	Integer	An integer value of 0, 1 or 2 specifying whether to redraw the outlines in the image.  Where: 0  -  Redraws object outlines. 1  -  Redraws image and outlines. 2  -  Updates classification.
Example	ret = IpBlbUpdate(1) This statement will update the count/size environment and redraw the image window.


IpCalLoad

Syntax	IpCalLoad(FileName)
Description	This function loads the specified calibration file from disk.  Equivalent to the Calibration command's Open menu item.
Parameters	FileName	String	A string specifying the name of the file from which the calibration values will be read.
Example	ret = IpCalLoad("C:\APPNAME\MICRONS.CAL") This statement will load the calibration values from the MICRONS.CAL file in the \APPNAME directory on the C: drive.
Comments	The calibration set that is loaded becomes the calibration for the active image, and for all image windows opened thereafter.


IpCalSave

Syntax	IpCalSave(FileName)
Description	This function saves the current calibration values to disk.  Equivalent to the Calibration command's Save menu item.
Parameters	FileName	String	A string specifying the name of the file to which the calibration values will be written.
Example	ret = IpCalSave("C:\APPNAME\MICRONS.CAL") This statement will save the current intensity and spatial calibration values to the MICRONS.CAL file in the \APPNAME directory on the C: drive.
Comments	If the file you specify already exists, it will automatically be overwritten.


IpCalSaveAll

Syntax	IpCalSaveAll(FileName)
Description	This function saves the current calibration values to disk.  Equivalent to the Calibration command's Save All menu item.
Parameters	FileName	String	A string specifying the name of the file to which the calibration values will be written.
Example	ret = IpCalSaveAll("C:\APPNAME\MICRONS.CAL") This statement will save the current intensity and spatial calibration values to the MICRONS.CAL file in the \APPNAME directory on the C: drive.
Comments	If the file you specify already exists, it will automatically be overwritten.


IpCapArea

Syntax	IpCapArea(ipFrame, bCursor)
Description	This function captures the entire screen or a portion of the screen, and stores it to a file. Equivalent to selecting the Screen Capture hot key with the Screen or Area selection settings.
Parameters	ipFrame	RECT	The name of a variable containing the AOI coordinates, or 0 (zero).  Where:  Variable name  -  indicates that only a portion of the screen is to be captured, and specifies the name of the variable containing the upper-left and lower-right coordinates of that portion.  By default, this variable is defined as ipFrame. 0  - specifies that the entire screen is to be captured.
	bCursor	Integer	An integer value of 0 or 1 specifying whether the cursor is to be included in the captured image.  Where: 0  -  Saves the image without the cursor. 1  -  Saves the image, including the cursor.
Example	Dim ipFrame as rect ipFrame.left=92 ipFrame.top=51 ipFrame.right=374 ipFrame.bottom=280 ret = IpCapArea(ipFrame,0) ret = IpBitSaveData("", S_CLIPBOARD) This set of statements will capture and save the contents of the rectangular screen area from pixel position 92,51 to 374,280. The following illustrates the statement that would be used to capture the entire screen:
	ipFrame.left=-1 ret = IpCapArea(ipFrame,0)
Comments	Regardless of the value in bCursor, the cursor will not be captured by an Area capture operation (a non-zero ipRect parameter). The image file name and format can be specified using the IpCapFile function.  If these values are not explicitly set using IpCapFile, the options currently in effect for the system will be used.
See Also	IpCapFile,  IpCapWindow


IpCapFile

Syntax	IpCapFile(FileFormat, Directory, Prefix, Number)
Description	This function specifies the file format, name and location to which Screen Capture  data will be stored.  Equivalent to setting the "File Format", "File Template" and "Destination Directory" fields in the Capture Options  dialog box.
Parameters	FileFormat	String	A string specifying the file format in which the image is to be stored.  Expressed in "*.XXX" format, where XXX identifies the standard extension used to designate the image file format (e.g., TIF, BMP, GIF).  See Comments, below, for a list of valid formats.
	Directory	String	A string specifying the directory into which the captured data will be stored.
	Prefix	String	A string specifying the "prefix" to be used to compose the file names for the saved images.
	Number	Integer	An integer specifying the number of digits to be used to generate the sequence number that will be appended to the string in Prefix to create a file name.
Example	ret = IpCapFile("*.PCX", "C:\IMAGES", "IMG", 4) This statement will set the capture options so that captured images are stored in PCX format to the \IMAGES directory on the C: drive.  The names of stored files will begin with the prefix "IMG", which will be followed by a 4-digit sequence number (e.g., IMG0000, IMG0001, IMG0002).
Comments	The length of the Prefix string must not exceed 4.  The length of the Prefix string combined with the value of Number must not exceed 8. The following table describes the file extensions that can be specified in the FileFormat parameter.
	FileFormat	DESCRIPTION
	BMP	Windows™ Bitmap File Format
	CUT	HALO® Device Independent Image File Format
	EPS	Encapsulated Postscript® File Format
	JPG	JPEG File Interchange Format
	PCT	Apple® Macintosh® PICT File Format
	PCX	ZSoft™ Image File Format
	TIF	Tagged Image File Format
	TGA	Truevision® Targa® File Format
	FLF	Flat File Format (user defined)
See Also	IpCapArea,  IpCapWindow,  IpCapHotKey


IpCapHotKey

Syntax	IpCapHotKey(KeyName, bShift, bCtrl, bAlt)
Description	This function designates the key (or key combination) that will be used to invoke the Screen Capture  utility.  Equivalent to specifying the "Hot Key" in the Capture Options  dialog box.
Parameters	KeyName	String	A string specifying the base key that is to be used to invoke Screen Capture.  Expressed in "X=YYY" format, where X identifies the key and YYY specifies its ANSI number.  See Comments, below.
	bShift	Integer	An integer value of 0 or 1 specifying whether the "Shift" key is to be used with the base key specified in KeyName.  Where: 0  - Shift is not part of the hot key combination. 1  - Shift is to be used with the base key in the hot key combination.
	bCtrl	Integer	An integer value of 0 or 1 specifying whether the "Ctrl" key is to be used with the base key specified in KeyName.  Where: 0  - Ctrl is not part of the hot key combination. 1  - Ctrl is to be used with the base key in the hot key combination.
	bAlt	Integer	An integer value of 0 or 1 specifying whether the "Alt" key is to be used with the base key specified in KeyName.  Where: 0  -  Alt is not part of the hot key combination. 1  -  Alt is to be used with the base key in the hot key combination.
Example	ret = IpCapHotKey("F12=123", 0, 1, 0) This statement assigns "Ctrl+F12" as the hot key combination.
Comments	The bShift, bCtrl and bAlt flags may be used simultaneously.
The following strings are allowed as base key definitions in KeyName.

String	String	String	String
"A=65"	"N=78"	"0=48"	"F1=112"
"B=66"	"O=79"	"1=49"	"F2=113"
"C=67"	"P=80"	"2=50"	"F3=114"
"D=68"	"Q=81"	"3=51"	"F4=115"
"E=69"	"R=82"	"4=52"	"F5=116"
"F=70"	"S=83"	"5=53"	"F6=117"
"G=71"	"T=84"	"6=54"	"F7=118"
"H=72"	"U=85"	"7=55"	"F8=119"
"I=73"	"V=86"	"8=56"	"F9=120"
"J=74"	"W=87"	"9=57"	"F10=121"
"K=75"	"X=88"		"F11=122"
"L=76"	"Y=89"		"F12=123"
"M=77"	"Z=90"
See Also	IpCapFile,  IpCapArea,  IpCapWindow


IpCapWindow

Syntax	IpCapWindow(Title, bClientOnly, bCursor)
Description	This function captures the specified  window or the contents of the specified window, and stores it to a file.  Equivalent to pressing the Screen Capture hot key with the Window or Client selection settings.
Parameters	Title	String	A string specifying the name of the window to be captured (as defined by the name in its Title bar). A zero-length string (i.e., "") can be used to specify the active window.
	bClientOnly	Integer	An integer value of 0 or 1 specifying whether the entire window (including borders, Title bar and so forth) is to be captured, or just its contents.  Where:
			0  - Specifies that entire window is to be captured (including its borders and bars). 1  - Specifies that just the contents of the window is to be captured.
	bCursor	Integer	An integer value of 0 or 1 specifying whether the cursor is to be included in the captured image.  Where: 0  - Saves the image without the cursor. 1  - Saves the image, including the cursor.
Example	ret = IpCapWindow("Histogram - circuit.tif", 1, 1) This statement will capture and save the contents of the "Histogram - circuit.tif" window.  If the cursor is within the window when the capture is performed, it will be included in the image.
Comments	The image file name and format can be specified using the IpCapFile function.  If these values are not explicitly set using IpCapFile, the options currently in effect for the system will be used.
See Also	IpCapFile,  IpCapArea


IpCmChannelExtract

Syntax	IpCmChannelExtract(cmColor, cmComp, Channel)
Description	This function extracts the specified color channel from the active image or AOI.  Equivalent to the Extract Channel command.
Parameters	cmColor	Integer	An enumerated integer identifying the color model in which the active image is currently expressed.  Must be one of the following: CM_RGB CM_HSI CM_HSV CM_YIQ See definitions under Comments, below.
	cmComp	Integer	An enumerated integer specifying the color model from which the channel is to be extracted.  Must be one of the following: CM_RGB CM_HSI CM_HSV
			CM_YIQ See definitions under Comments, below.
	Channel	Integer	An integer specifying which of the channels are to be extracted.  See definitions under Comments, below.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpCmChannelExtract(CM_RGB, CM_YIQ, 1) This statement will extract the In-Phase channel under YIQ mode from an RGB image.
Comments	The following table describes the values allowed in the cmColor, cmComp and Channel parameters:
		Channel VALUES
OPTION	DESCRIPTION	0	1	2
CM_RGB	Red, Green and Blue (RGB) model.	Red	Green	Blue
CM_HSI	Hue, Saturation and Intensity (HSI) model	Hue	Saturation	Intensity
CM_HSV	Hue, Saturation and Value (HSV) model	Hue	Saturation	Value
CM_YIQ	Luminance, In-Phase and Quadrature (YIQ) model.	Luminance	In-Phase	Quadrature
	To select multiple channels,start with a value of 8 for multiple channels. Then add: 1 to select channel 0 ( red, hue, or luminance) 2 to select channel 1 (green, saturation, or in-phase) 4 to select channel 2 (blue, intensity, value, or quadrature) Therefore, to select blue and green, the channel parameter would be 8 +4 (blue) + 2 (green) = 14
See Also	IpCmChannelMerge,  IpCmTransform


IpCmChannelMerge

Syntax	IpCmChannelMerge(DocId, cmColor, Channel)
Description	This function merges the specified channel from the active image or AOI into the specified image.  Equivalent to the Merge Channel command.
Parameters	DocId	Integer	An integer specifying the ID number of the image into which the active image or AOI is to be merged.
	cmColor	Integer	An enumerated integer identifying the color model by which the active image is to be merged.  Must be one of the following: CM_RGB CM_HSI CM_HSV CM_YIQ See definitions under Comments, below.
	Channel	Integer	An integer specifying the channel into which the active image data is to be merged.  See definitions under Comments, below.
Example	ret = IpCmChannelMerge(4, CM_HSI, 1) This statement will merge the active image as the saturation channel in image 4.
Comments	The active image must be of Gray Scale class.  The image into which the active image is merged must be True Color class. The following table describes the values allowed in the cmColor and Channel parameters:
		Channel VALUES
cmColor	DESCRIPTION	0	1	2
CM_RGB	Red, Green and Blue (RGB) model.	Red	Green	Blue
CM_HSI	Hue, Saturation and Intensity (HSI) model	Hue	Saturation	Intensity
CM_HSV	Hue, Saturation and Value (HSV) model	Hue	Saturation	Value
CM_YIQ	Luminance, In-Phase and Quadrature (YIQ) model.	Luminance	In-Phase	Quadrature
See Also	IpCmChannelExtract,  IpCmTransform


IpCmChannelMerge3

Syntax	IpCmChannelMerge3 (colorDoc, redDoc, greenDoc, blueDoc, cModel,bNewImage)
Description	This functions merges a color channel or channels into another image.
Parameters	colorDoc	Integer	ID of the destination color image, or -1 for a new color image
	redDoc	Integer	ID of the red image.
	greenDoc	Integer	ID of the green image.
	blueDoc	Integer	ID of the blue image
	cModel	Integer	The color model: RGB, HIS, etc,
	bNewImage	Integer	1 = create new image 0 = use the image specified by colorDoc as the destination image
See Also	IpCmChannelMerge


IpCmTransform

Syntax	IpCmTransform(cmOut, cmIn, bNewImage)
Description	This function transforms the active image to another color model.  Equivalent to the Color Transform command.
Parameters	cmOut	Integer	An enumerated integer, which identifies the color model to which the active image is to be transformed: CM_RGB CM_HSI CM_HSV CM_YIQ See definitions under Comments, below.
	cmIn	Integer	An enumerated integer, which identifies the color model in which the active image is currently expressed (or is to be interpreted).  Must be one of the following: CM_RGB CM_HSI CM_HSV
			CM_YIQ See definitions under Comments, below.
	bNewImage	Integer	An integer value of 0 or 1 specifying whether the transformed image is to be written to a new image window, or back into the active image window.  Where: 0  -  Writes the transformed results to the active window. 1  -  Writes the transformed results to a new image window.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpCmTransform(CM_HSI, CM_RGB, 0) This statement will convert RGB image data to HSI image data.
Comments	The following table describes the values allowed in the cmOut and cmIn parameters.
cmColor	DESCRIPTION
CM_RGB	Red, Green and Blue (RGB) model.
CM_HSI	Hue, Saturation and Intensity (HSI) model
CM_HSV	Hue, Saturation and Value (HSV) model
CM_YIQ	Luminance, In-Phase and Quadrature (YIQ) model.
See Also	IpCmChannelExtract,  IpCmChannelMerge


IpDde

Syntax	IpDde(Cmd, String1, String2)
Description	This function gives access to the Dynamic Data Exchange protocol, used by many popular Windows programs to exchange data. It complements the data export via DDE function found in the data generating tools.
Parameters	Cmd	Integer	Command ID.
	String1	LPSTR(C), String(Basic)	First parameter of the command.
	String2	LPSTR(C), String(Basic)	Second parameter of the command.
Comments	The commands used with this function are listed in the table below. The commands and formats shown with the examples of  DDE_EXEC are specific to the English-language version of Excel. To determine which commands and formats are supported by a given program under DDE, consult the documentation for that product.  For non-English versions of Excel, record the command in an Excel macro and observe what kind of string it generates. Any macro command can be sent to Excel using DDE if the command is enclosed in brackets [ ]. Note that in the examples above, whenever a BASIC string containing quotes has to be generated, that string must be split into its component parts. For instance, the string                                                 [SELECT("R1C9")]  is generated by adding together five strings:                      "[SELECT("      chr$(34)     "R1C9"  chr$(34)  and     ")]" . If the program called by DDE_OPEN resides in a directory in the system Path,   your application will attempt to start that program if it is not already running.
Example	q$ = chr$(34) ' ASCII code for quote. ' Open communication with sheet1 of Excel ret = IpDde(DDE_OPEN, "excel", "sheet1") ' Put value 1.234 into cell on 2nd row and 3rd column. ret = IpDde(DDE_PUT, "R2C3", "1.234") 'Get value back from Excel Dim tmp$ as string * 100 Dim retval as single ret = IpDde(DDE_GET, "R2C3", tmp$) retval = val(tmp$) ' Execute commands in Excel: ' Open communication with Excel itself ret = IpDde(DDE_OPEN, "excel", "system") ' Select sheet2 ret= IpDde(DDE_EXEC, "[ACTIVATE(" = q$ +"sheet2" + q$ + ")]", "") Select cell in first row and 9th column ret = IpDde(DDE_EXEC, "[SELECT(" + q$ + R1C9" + q$ + ")]", "") 'Paste contents of clipboard ret = IpDde (DDE_EXEC, "[PASTE()]","") ' End communication ret = IpDde (DDE_CLOSE, "", "")
IpDde commands are as follows:

Command	String1	String2	Return Value	Description
DDE_OPEN	DDE server name, usually the name of the executable file (e.g. Excel)	Topic name, depending on the program (e.g." Sheet2" in Excel)	0 if successful, negative number if failed.	Initiates communication with the DDE server program.
DDE_CLOSE	Not used.	Not used.	None.	Ends communication with the DDE server.
DDE_PUT	Item name. In Excel, the coordinates of a cell.	A string containing the data to be sent.	0 if successful, negative number if failed.	Sends a data item to the DDE server.
DDE_GET	Item name. In Excel, the coordinates of a cell.	A string receivng the data sent by the DDE server.	0 if successful, negative number if failed.	Requests a data item from the DDE server.
DDE_SET	Must be one of the following: Row Col Row_Inc Col_Inc Topic	Item name. In Excel, the coordinates of a cell.	0 if successful, negative number if failed.	Sends a data item to the DDE server.
DDE_EXEC	Command to be executed by the DDE server.	Not used.	0 if successful, negative number if failed.	Sends a command to be executed by the DDE server.


IpDocClick

Syntax	IpDocClick(Message, CurPos)
Description	This function prompts the user to point to an image and press the left mouse button.  It will write the position of the cursor to a variable that you specify.
Parameters	Message	String	A string of text that is to be displayed in the message box.
	CurPos	POINTAPI	The address (name) of the point-structure variable (of IPBASIC type, POINTAPI) that will receive the position of the cursor when the user presses the left mouse button in the image.
Return Value	The document ID, or -1 if the user clicked in non-image space (or terminated without clicking on an image).
Example	The following example asks the user to select two points in an image and then measures a profile between those points.
dim mypt1 as pointapi, mypt2 as pointapi

dim docid1 as integer, docid2 as integer

docid1 = IpDocClick("Select the 1st point", mypt1)

if docid1 >= 0 then

docid2 = IpDocClick("Select the 2nd point", mypt2)

if docid2 = docid1 then

ret = IpProfCreate()

ret = IpProfLineMove(mypt1.x, mypt1.y, mypt2.x, mypt2.y)

end if

end if

Comments	The coordinates returned in CurPos are actual image coordinates.  They are not affected by zoom and pan settings. If  -1 is returned, the contents of CurPos is not set and, therefore, might not be valid.
See Also	IpBlbGet(GETHIT),  IpDocGet


IpDocClose

Syntax	IpDocClose( )
Description	This function closes the active image window.
See Also	IpAppCloseAll


IpDocCloseEx

Syntax	IpDocCloseEx(docID)
Description	This function  closes the document by document ID.
Parameters	docid	Integer	Identifies the document to be closed.
Comments	The workspace identified by the document ID does not have to be active.
See Also	IpDocPutArea,  IpDocGetLine,  IpDocPutLine,  IpDocOpenVri,  IpDocClose,  IpAoiGet


IpDocCloseVri

Syntax	IpDocCloseVri(docInst)
Description	This function closes a document instance.
Parameters	docInst	Long	The handle (type short in C) to the document instance as returned by IpDocOpenVri or IpDocOpenAoi.
Example	The following example opens and then closes a document instance. Dim docInst as long Dim aArea as RECT docInst=IpDocOpenVri(DOCSEL_ACTIVE, IMA_RD, aArea) . . . ret=IpDocCloseVri(docInst)
Return Value	Returns an image instance  (Long in BASIC, HANDLE in C)
See Also	IpDocOpenVri,  IpDocOpenAoi,  IpDocGetLine,  IpDocPutLine


IpDocFind

Syntax	IpDocFind(document  name )
Description	This function  finds a document by name.
Return Value	Returns the Document ID.
See Also	IpDocPutArea,  IpDocGetLine,  IpDocPutLine,  IpDocOpenVri,  IpDocClose,  IpAoiGet


IpDocGet

Syntax	IpDocGet(Cmd, Param, OutVal)
Description	Use this function to get information relating to the current image (document).
Parameters	Cmd	Integer	A command ID, which specifies the type of  information you want to retrieve.  See table below.
	Param	Integer	Parameter of the command. See table below.
	OutVal	Any	The address (name) of the variable that will receive the requested data.  Be sure this variable is of the type required by Cmd.  See Cmd description under Comments, below.
Example	The following examples get information about the active document.
Dim DocId as integer, hVri as integer

1. The following statement gets the active document ID.

ret = IpDocGet(GETACTDOC, 0, DocId)

2. The following statement gets the window handle of the active document, where
   DocId   was obtained as shown in the first example, above.

Dim WndHandle as integer	16-Bit IPP
Dim WndHandle as long 	32-bit IPP

ret = IpDocGet(GETDOCWND, DocId, WndHandle)

 'or:

ret = IpDocGet(GETDOCWND, DOCSEL_ACTIVE, WndHandle)

3. The following example gets the Vri of the active document , where
   DocId   was obtained as shown in the first example, above.

ret = IpDocGet(GETDOCVRI, DocId, hVri)

 'or:

ret = IpDocGet(GETDOCWND, DOCSEL_ACTIVE, hvri)

4. The following example gets the list of documents displayed.

DocList(30) as integer

Dim numdocs as integer

numdocs = IpDocGet(GETDOCLST, 30, DocList(0))

5. The following example gets information about the active document.

Dim dInfo as IPDOCINFO

ret = IpDocGet(GETDOCINFO, DOCSEL_ACTIVE, dInfo)

6. The following example gets information about the instance associated with the
    active document.

Dim iInfo as IPDOCINFO

Dim docInst as Long

iInst = IpDocOpenAoi(DOCSEL_ACTIVE, IMA_RD)

ret = IpDocGet(GETINSTINFO, docId, imInfo)

7. The following example gets the description of the active document.

Dim descript as string *255

ret = IpDocGet(INF_DESCRIPTION, DOCSEL_ACTIVE, descript)

Comments	When passing an array to the program from a BASIC program, be sure to pass the first element of the array by reference (See GETDOCLST statement in example, above). In the following table, everywhere a Document ID is passed in Param, DOCSEL_ACTIVE can be passed instead, to designate the active document. In the following table, when passing a string to get the document title, description, date, etc. make sure the string is defined with a fixed size long enough to contain the results.
Command	Description	PARAM (type)	OutVal (type)	Return Value
GETACTDOC	This command gets the active Document ID. The ID number is written to OutVal.	Not used by GETACTDOC.  Must be set to 0.	Address of the integer receving the doc ID. (Integer)	None.
GETDOCVRI	This command gets the image bitmap handle of the document specified in Param.  The VRI handle is written to OutVal.	Document ID, or  DOCSEL_ACTIVE to designate the active image. (integer)	Address of the integer variable receving the VRI handle. (Integer)	None.
GETDOCWND	This command gets the window handle of the document.  The window handle is written to OutVal.	Document ID, or  DOCSEL_ACTIVE to designate the active image. (integer)	Address of a window handle . (BASIC, Integer for 16-bit, or Long for 32-bit C, HWND far *)	None.
GETDOCLST	This command gets the list of open documents.  The Document IDs are written to OutVal( ).	The maximum number of Ids  allocated in OutVal (i.e., the size of the array).	An array of intergers receiving the list of documents (Integer)	Number of doc Ids returned.
GETNUMDOC	This command gets the number of open documents.  This number is written to OutVal.	Not used by GETNUMDOC.  Must be set to 0.	Address of interger (Integer)	None.
GETDOCINFO	This command gets document size and class information.  The requested information is written to OutVal.	Document ID, or  DOCSEL_ACTIVE to designate the active image.	Address of IPDOCINFO structure.	0 if successful
GETINSTINFO	This command gets document ID information.  The requested information is written to OutVal.	Document ID, or  DOCSEL_ACTIVE to designate the active image.	Address of IPDOCINFO structure.	0 if successful
INF_ARTIST	Get document artist name.	Document ID	Address of string	0 if successful
INF_DATE	Get document date.	Document ID	Address of string	0 if successful
INF_TITLE	Get document title.	Document ID	Address of string	0 if successful
INF_DESCRIPTION	Get document description.	Document ID	Address of string	0 if successful
INF_NAME	Get document name, or image path and file name.	Document ID	Address of string	0 if successful
INF_DPIX	Get document horizontal DPI	Document ID	Address of Long	0 if successful
INF_DPIY	Get document vertical  DPI	Document ID	Address of Long	0 if successful


The following table describes the IPDOCINFO structure:

C DEFINITION	BASIC DEFINITION	DESCRIPTION
short Width;	Width As integer	Width of document (or document instance)
short Height;	Height As integer	Height of document (or document instance)
short Class;	Class As integer	Class of document, as follows  IMC_BILEVEL  -  1bpp IMC_GRAY  -  8bpp IMC_PALETTE  -  8bpp IMC_RGB  -  24bpp IMC_GRAY12  -  12bpp IMC_GRAY16   16bpp IMC_FLOAT  -  32bpp
short Bpp;	Bpp As integer	Bits per pixel of document (bpp).  See above.
RECT Extent;	Extent As RECT	For a document the left and top values are always 0.  The right and bottom values are Width-1 and Height-1.   For an instance, RECT will be the extent of the area that was opened for read/write (see IpDocOpenVri).
See Also	IpDocOpenAoi,  IpDocOpenVri  also, Info Command


IpDocGetArea

Syntax	IpDocGetArea(DocID, rArea, ImageBuffer, gMode)
Description	This function reads a rectangular area from an image bitmap into a user-defined array.  There is no command equivalent to this function; it is one that must be manually written with the macro editor. Currently, this function cannot be used with Bilevel images.  If you want to obtain, and manipulate a block of data from a Bilevel image, convert it first to Gray Scale. Note - Because of array size limitation in IPBASIC (64K), this function is intended to be used with a Visual Basic program.
Parameters	DocID	Integer	An integer representing the document's ID, or  DOCSEL_ACTIVE to designate the active image.
	rArea	RECT	A rectangle specifying the area of the document to be  read.
	ImageBuffer	See below	The address (name) of the array variable that will receive the requested data.  The type and size of this array is dependent upon the source image's class.  See ImageBuffer table under Comments, below.
	gMode	Integer	A value of 0 or CPROG specifying the manner in which the image data are to be written to the ImageBuffer.  Where: 0 -  writes the data in BASIC mode CPROG -  writes the data in C mode See Comments, below, for more about gMode.
Return Value	This function returns a 0 if successful.
Example	The following example obtains a block of 8-bit Gray Scale image data and inverts its pixel values.
Dim i as integer

Dim j as integer

Dim Reg as RECT

Reg.left = 100

Reg.top = 100

Reg.right = 200

Reg.bottom= 150

Redim ImBuf(Reg.left to Reg.right,Reg.top to Reg.bottom) as integer

ret=IpDocGetArea(DOCSEL_ACTIVE,Reg,ImBuf(Reg.left,Reg.top),0)

for j=Reg.top to Reg.bottom

Print j

for i=Reg.left to Reg.right

ImBuf(i,j)=255-ImBuf(i,j)

next i

next j

ret = IpDocPutArea(DOCSEL_ACTIVE, Reg, ImBuf(Reg.left,Reg.top), 0)

The following example reads an entire 8-bit Gray Scale image.

Dim iInfo as IPDOCINFO

ret=IpDocGet(GETDOCINFO, DOCSEL_ACTIVE, iInfo)

Redim ImBuf(1 to iInfo.Width,1 to iInfo.Height) as integer

ret=IpDocGetArea(DOCSEL_ACTIVE,iInfo.Extent,ImBuf(1,1),0)

' refresh the display of the active document.

ret=IpAppUpdateDoc(DOCSEL_ACTIVE)

Comments	The gMode parameter determines how IMC_GRAY, IMC_PALETTE and IMC_RGB data are written to your array.  These image classes use 8 bits to represent each pixel (or color channel).  BASIC, however, does not have an 8-bit data type (the 16-bit integer type is the smallest numeric data unit).  So, when these image data are written in BASIC mode (i.e., gMode = 0), each pixel (or color channel) is converted to 16-bits.  Pixel values do not change (0 to 255), but the storage requirement is twice that of the source image data.  If you are going to manipulate the image data with a BASIC program, you must set gMode to 0. In a C program, 8-bit pixels can be directly manipulated in an array of the BYTE (8-bit) data type.  Therefore, if you are extracting data to an array that will be manipulated by C, set gMode to CPROG so that the data are written without the 8- to 16-bit conversion.  This will result in faster processing times and greatly reduced storage requirements.   The ImageBuffer table, below, describes the data types and storage requirements of each mode.
If the Image Class is...	ImageBuffer size must be	If  gMode is...	ImageBuffer Data Type must be
IMC_GRAY	(rArea width, rArea height)	0	Integer
		CPROG	BYTE
IMC_PALETTE	(rArea width, rArea height)	0	Integer
		CPROG	BYTE
IMC_RGB	(3 * rArea.width, rArea height)	0	Integer
		CPROG	BYTE
IMC_GRAY12	(rArea.width, rArea height)	0	Integer
		CPROG	short
IMC_FLOAT	(rArea width, rArea height)	0	Single
		CPROG	float
IMC_BILEVEL	This class is not supported by IpDocGetArea.
	If you need to extract data from a Bilevel image, convert it to Gray Scale, beforehand.
	Remember, a True Color image (i.e., IMC_RGB) will require 3 times as many elements per line as a Gray Scale (IMC_GRAY) image does, because each pixel is comprised of a 3-byte "chunk" of Red, Green and Blue values. Also, BASIC arrays are different from the C arrays used in this program  in that they include a header containing information about the array itself.  To emulate a C array when calling an Auto-Pro function, a BASIC program should pass the address of the first element of the array (i.e. pass the first element "by reference").  See the call to IpDocGetArea in the example, above.
See Also	IpDocPutArea,  IpDocGetLine,  IpDocPutLine,  IpDocOpenVri,  IpDocClose,  IpAoiGet


IpDocGetLine

Syntax	IpDocGetLine(docInst, LineNum, LineBuffer)
Description	This function reads a line from a document bitmap into a user-defined buffer.  There is no  command equivalent to this function; it is one that must be manually written with the macro editor. Before calling IpDocGetLine, you must open the document for read and/or write access using IpDocOpenVri or IpDocOpenAoi.
Parameters	docInst	Long	The handle (type short in C) to the document instance as returned by IpDocOpenVri or IpDocOpenAoi.
	LineNum	Integer	The number of the line (in the instance) that is to be read, where first line (i.e., the uppermost line) in the instance is line 0, the next line is line 1, and so forth.
	LineBuffer	See below	The address (name) of a one-dimensional array variable that will receive the requested data.  The type and size of this array is dependent upon the source image's class.  See LineBuffer table under Comments, below.
Return Value	0 if successful.  Non-0, otherwise.
Example	The following example inverts the red channel in the AOI of the active RGB image.
Dim i as integer

Dim j as integer

Dim imInfo as IPDOCINFO

Dim docInst as Long

docInst=IpDocOpenAoi(DOCSEL_ACTIVE,IMA_RDWR)

if docInst=0 then GoTo erroropen

ret=IpDocGet(GETINSTINFO,DOCSEL_ACTIVE,imInfo)

Redim LineBuf(1 to imInfo.Width * 3) as integer

for j=1 to imInfo.Height

ret=IpDocGetLine(docInst,j-1,LineBuf(1))

for i=1 to imInfo.Width * 3 step 3

LineBuf(i) = 255-LineBuf(i)

next i

ret=IpDocPutLine(docInst,j-1,LineBuf(1),1)

next j

' close the instance.

ret=IpDocCloseVri(docInst)

' refresh the display of the active document.

ret=IpAppUpdateDoc(DOCSEL_ACTIVE)

Comments	The table, below, describes the data type and storage requirements of LineBuffer, for each image class.
If the Image Class is...	LineBuffer size must be...	If  your program is...	LineBuffer data type must be
IMC_GRAY	Instance width	BASIC	Integer
		C	BYTE
IMC_PALETTE	Instance width	BASIC	Integer
		C	BYTE
IMC_RGB	3 * Instance width	BASIC	Integer
		C	BYTE
IMC_GRAY12	Instance width	BASIC	Integer
		C	short
IMC_FLOAT	Instance width	BASIC	Single
		C	float
IMC_BILEVEL	Instance width	BASIC	Integer
		C	BYTE
	Remember, a True Color image (i.e., IMC_RGB) will require 3 times as many elements per line as a Gray Scale (IMC_GRAY) image does, because each pixel is comprised of a 3-byte "chunk" of Red, Green and Blue values. Also, BASIC arrays are different from the C arrays used in this application in that they include a header containing information about the array itself.  To emulate a C array when calling an Auto-Pro function, a BASIC program should pass the address of the first element of the array (i.e. pass the first element "by reference").  See the call to IpDocGetLine in the example above.
See Also	IpDocOpenVri,  IpDocOpenAoi,  IpDocPutLine,  IpDocGetArea


IpDocMaximize

Syntax	IpDocMaximize( )
Description	This function maximizes (enlarges to maximum size) the active image window.  Equivalent to clicking the Maximize button on the image window's Control bar.
See Also	IpDocMinimize,  IpDocRestore,  IpAppMaximize


IpDocMinimize

Syntax	IpDocMinimize( )
Description	This function minimizes (reduces to an icon) the active image window.  Equivalent to clicking the Minimize button on the image window's Control bar.
See Also	IpDocMaximize,  IpDocRestore,  IpAppMinimize


IpDocMove

Syntax	IpDocMove(x, y)
Description	This function moves the active image window to the specified position within the  imaging area.  Equivalent to dragging the active image to a new position with the mouse.
Parameters	x	Integer	An integer specifying the x-coordinate of the pixel-position to which the upper-left corner of the image window is to be moved.
	y	Integer	An integer specifying the y-coordinate of the pixel-position to which the upper-left corner of the image window is to be moved.
Example	ret = IpDocMove(0,0) This statement will move the active image window such that it is positioned in the upper-left corner of the imaging area.
Comments	The origin (i.e., 0, 0) of the coordinate system referenced by the x and y parameters of this function is the pixel in the upper-left corner of the imaging area, not the upper-left corner of the screen.
See Also	IpDocMaximize,  IpDocMinimize,  IpDocRestore


IpDocOpenAoi

Syntax	IpDocOpenAoi(docID, oMode)
Description	This function opens an image bitmap for direct read and/or write operations (you must Open a document before using the IpDocGetLine or IpDocPutLine functions).  If the document has an active AOI, only the rectangular area bounding the AOI will be opened.  Otherwise, the entire document is opened.
Parameters	docID	Long	An integer representing the document's ID, or  DOCSEL_ACTIVE to designate the active image.
	oMode	Integer	An enumerated integer specifying the mode in which the instance is to be opened.  Where: IMA_RD -  specifies read-only mode IMA_RDWR -  specifies read/write mode Additionally, the CPROG flag can be added to this expression to signify that the calling program is written in C.  See Comments, below.
Return Value	An image instance (Long in BASIC, HANDLE in C), or 0 if the open failed.
Example	The following example opens the active image (or AOI) in read-only mode.
Dim docInst as long

docInst = IpDocOpenAoi(DOCSEL_ACTIVE,IMA_RD)

if docInst<>0 then

' Process image data w/IpDocGetLine & IpDocPutLine

.

.

.

   ' Close instance

   ret = IpDocCloseVri(docInst)

end if

Comments	Use this function instead of IpDocOpenVri when the area inside an AOI must be processed.  This allows you to modify the AOI with IpDocPutLine , even if it is non-rectangular.  If you are calling this function from a C program, be sure to add the CPROG flag to oMode (i.e., IMA_RD+CRPOG or IMA_RDWR+CPROG).  This reduces the processing and storage requirements significantly, by retaining the 8-bit structure of the IMC_GRAY, IMC_PALETTE and  IMC_RGB image types.  Because BASIC does not have an 8-bit data type (the 16-bit, Integer type is the smallest, numeric data unit), image data must be converted to 16-bit integers in order to be accessed directly (the pixel values do not change, but the storage requirement is twice that of the source image data).  In a C program, the 8-bit pixels are directly accessible via the BYTE (8-bit) data type.  Therefore, if you are calling IpDocOpenAoi from a C program, add CPROG to the oMode expression; if you calling it from a BASIC program, leave this flag off.  The instance must be closed with IpDocCloseVri when it is no longer in use.
See Also	IpDocOpenVri,  IpDocCloseVri,  IpDocGetLine,  IpDocPutLine,  IpAoiGet


IpDocOpenVri

Syntax	IpDocOpenVri(DocID, oMode, rArea)
Description	This function opens an image bitmap for direct read and/or write operations (for example, you must open the document before using the IpDocGetLine or IpDocPutLine functions). If you want to automatically open an instance based upon the active AOI, use IpDocOpenAoi instead of this function.
Parameters	DocID	Long	An integer representing the document's ID, or  DOCSEL_ACTIVE to designate the active image.
	oMode	Integer	An enumerated integer specifying the mode in which the instance is to be opened.  Where: IMA_RD -  specifies read-only mode IMA_RDWR -  specifies read/write mode Additionally, the CPROG flag can be added to this expression to signify that the calling program is written in C.  See Comments, below.
	rArea	RECT	Image coordinates defining the area to be opened, which may be the entire image.
Return Value	An image instance (Long in BASIC, HANDLE in C), or 0 if the open failed.
Example	The following example opens the entire active image in read-only mode. Dim docInst as long Dim iInfo as IPDOCINFO ret=IpDocGet(GETDOCINFO,DOCSEL_ACTIVE,iInfo) docInst=IpDocOpenVri(DOCSEL_ACTIVE,IMA_RD,iInfo.Extent) if docInst <> 0 then ' Process image data w/IpDocGetLine & IpDocPutLine   . . . ' Close instance ret=IpDocCloseVri(docInst) end if
Comments	Use IpDocOpenAoi instead of this function when the area inside an AOI must be processed.  This allows you to modify the AOI with IpDocPutLine , even if it is non-rectangular.  If you are calling this function from a C program, be sure to add the CPROG flag to oMode (i.e., IMA_RD+CRPOG or IMA_RDWR+CPROG).  This reduces the processing
	and storage requirements significantly by retaining the 8-bit structure of the IMC_GRAY, IMC_PALETTE and  IMC_RGB image types.   Because BASIC does not have an 8-bit data type (the 16-bit, Integer type is the smallest, numeric data unit), image data must be converted to 16-bit integers in order to be accessed directly (the pixel values do not change, but the storage requirement is twice that of the source image data).  In a C program, the 8-bit pixels are directly accessible via the BYTE (8-bit) data type.  Therefore, if you are calling IpDocOpenVri from a C program, add CPROG to the oMode expression; if you calling it from a BASIC program, leave this flag off.  The instance must be closed with IpDocCloseVri when it is no longer in use.
See Also	IpDocCloseVri,  IpDocGetLine,  IpDocPutLine,  IpDocOpenAoi,  IpAoiGet


IpDocPutArea

Syntax	IpDocPutArea(DocID, rArea, ImageBuffer, pMode)
Description	This function writes a user-defined array of image data to an  image.    There is no command equivalent to this function; it is one that must be manually written with the macro editor. Currently, this function cannot be used with Bilevel images.  If you want to write to a Bilevel image, convert it first to Gray Scale.
Parameters	DocID	Integer	An integer representing the document's ID, or  DOCSEL_ACTIVE to designate the active image.
	rArea	RECT	A rectangle specifying the area of the document to be modified.
	ImageBuffer	See below	The address (name) of the array variable containing the data to be written to rArea.  The type and size of this array is dependent upon the source image's class.  See ImageBuffer table under Comments, below.
	pMode	Integer	A value of 0 or CPROG specifying the manner in which the image data are formatted in the ImageBuffer.  Where: 0 -  reads the data in BASIC mode CPROG -  reads the data in C mode See Comments, below, for more about pMode.
Return Value	0 if successful.
Example	The following example inverts the pixel values in an area of an 8-bit Gray Scale image.
Dim i as integer

Dim j as integer

Dim Reg as RECT

Reg.left=100

Reg.top=100

Reg.right=200

Reg.bottom=150

Redim ImBuf(Reg.left to Reg.right,Reg.top to Reg.bottom) as integer

ret=IpDocGetArea(DOCSEL_ACTIVE,Reg,ImBuf(Reg.left,Reg.top),0)

for j=Reg.top to Reg.bottom

for i=Reg.left to Reg.right

ImBuf(i, j)=Not ImBuf(i,j)

next i

next j

ret=IpDocPutArea(DOCSEL_ACTIVE,Reg,ImBuf(Reg.left,Reg.top),0)

' refresh the display of the active document.

ret = IpAppUpdateDoc(DOCSEL_ACTIVE)

Comments	The pMode parameter specifies how IMC_GRAY, IMC_PALETTE and IMC_RGB data are formatted in your ImageBuffer.  These image classes use 8 bits to represent each pixel (or color channel).  BASIC, however, does not have an 8-bit data type.  The 16-bit Integer type is its smallest, numeric data unit.  So, in a BASIC program, ImageBuffer contains a 16-bit value, which must be converted to 8-bits before being written to the image (note that the pixel values, 0 - 255, are not changed; the unused, high-order bits are merely stripped away).  If you are writing image data from a BASIC program, you must set pMode to 0 ensure this conversion is performed. In a C program, 8-bit image pixels can be represented by an array of the BYTE (8-bit) data type.  Therefore, if you are writing data from a C program, you must set pMode to CPROG to ensure that the data are written without any 8- to 16-bit conversion (C programs are able to process images faster and with less memory because of this).   The ImageBuffer table, below, describes the data types and storage requirements of each mode.
If the Image Class is...	ImageBuffer size must be	If  pMode is...	ImageBuffer Data Type must be
IMC_GRAY	(rArea width, rArea height)	0	Integer
		CPROG	BYTE
IMC_PALETTE	(rArea width, rArea height)	0	Integer
		CPROG	BYTE
IMC_RGB	(3 * rArea.width, rArea height)	0	Integer
		CPROG	BYTE
IMC_GRAY12	(rArea.width, rArea height)	0	Integer
		CPROG	short
IMC_FLOAT	(rArea width, rArea height)	0	Single
		CPROG	float
IMC_BILEVEL	This class is not supported by IpDocPutArea.
	If you need to write data to a Bilevel image, convert it to Gray Scale, beforehand.
	Remember, a True Color image (i.e., IMC_RGB) will require 3 times as many elements per line as a Gray Scale (IMC_GRAY) image does, because each pixel is comprised of a 3-byte "chunk" of Red, Green and Blue values. Also, BASIC arrays are different from the C arrays used in this program  in that they include a header containing information about the array itself.  To emulate a C array when calling an Auto-Pro function, a BASIC program should pass the address of the first element of the array (i.e. pass the first element "by reference").  See the call to IpDocPutArea in the example above.
See Also	IpDocGetArea,  IpDocGetLine,  IpDocPutLine,  IpDocOpenVri,  IpDocClose


IpDocPutLine

Syntax	IpDocPutLine(docInst, LineNum, LineBuffer, bAoi)
Description	This function writes a line of bitmap data to an image.  There is no  command equivalent to this function; it is one that must be manually written with the macro editor. Before calling IpDocGetLine, you must open the document for read/write access using IpDocOpenVri or IpDocOpenAoi.
Parameters	docInst	Long	The handle (type short in C) to the document instance as returned by IpDocOpenVri or IpDocOpenAoi.
	LineNum	Integer	The number of the line (in the instance) to which the data are to be written, where first line (i.e., the uppermost line) in the instance is line 0, the next line is line 1, and so forth.
	LineBuffer	See below	The address (name) of the one-dimensional array variable that contains the bitmap data.  The type and size of this array is dependent upon the source image's class.  See LineBuffer table under Comments, below.
	bAoi	Integer	An integer value of 0 or 1 specifying whether all pixels in the instance are to be modified, or just those encompassed by the active AOI.  Where: 0 -  modifies all pixels 1 -  modifies only AOI pixels This parameter is applied only when an instance has been opened with IpDocOpenAoi.  It is ignored when an instance is opened with IpDocOpenVri.  When this is the case, set bAoi to 0.
Return Value	0 if successful.  Non-0 otherwise.
Example	The following example inverts the red channel values within the AOI of the active RGB image.
Dim i as integer

Dim j as integer

Dim imInfo as IPDOCINFO

Dim docInst as long

docInst=IpDocOpenAoi(DOCSEL_ACTIVE, IMA_RDWR)

if docInst=0 then GoTo erroropen

ret=IpDocGet(GETINSTINFO,DOCSEL_ACTIVE, imInfo)

Redim LineBuf(1 to imInfo.Width * 3) as integer

for j=1 to imInfo.Height

ret=IpDocGetLine(docInst,j-1,LineBuf(1))

for i=1 to imInfo.Width * 3 step 3

LineBuf(i)=255-LineBuf(i)

next i

ret=IpDocPutLine(docInst,j - 1,LineBuf(1),1)

next j

' close the instance.

ret=IpDocCloseVri(docInst)

' refresh the display of the active document.

ret=IpAppUpdateDoc(DOCSEL_ACTIVE)

Comments	The table, below, describes the data type and storage requirements of LineBuffer, for each image class.
If the Image Class is...	LineBuffer size must be...	If  your program is...	LineBuffer data type must be
IMC_GRAY	Instance width	BASIC	Integer
		C	BYTE
IMC_PALETTE	Instance width	BASIC	Integer
		C	BYTE
IMC_RGB	3 * Instance width	BASIC	Integer
		C	BYTE
IMC_GRAY12	Instance width	BASIC	Integer
		C	short
IMC_FLOAT	Instance width	BASIC	Single
		C	float
IMC_BILEVEL	Instance width	BASIC	Integer
		C	BYTE
	Remember, a True Color image (i.e., IMC_RGB) will require 3 times as many elements per line as a Gray Scale (IMC_GRAY) image does because each pixel is comprised of a 3-byte "chunk" of Red, Green and Blue values. Also, BASIC arrays are different from the C arrays used in this program in that they include a header containing information about the array itself.  To emulate a C array when calling an Auto-Pro function, a BASIC program should pass the address of the first element of the array (i.e. pass the first element "by reference").  See the call to IpDocPutLine in the example above.
See Also	IpDocOpenVri,  IpDocOpenAoi,  IpDocPutLine,  IpDocGetArea,  IpAoiGet


IpDocRestore

Syntax	IpDocRestore( )
Description	This function returns the selected image window to its previous screen position and size, from a minimized or maximized state.  Equivalent to clicking the Restore button on a maximized window or double-clicking the icon of a minimized window.
See Also	IpDocMaximize,  IpDocMinimize,  IpAppRestore


IpDocSize

Syntax	IpDocSize(Width, Height)
Description	This function changes the size of the active image window to the specified width and height.
Parameters	Width	Integer	An integer specifying the width, in pixels, at which you want the image window displayed.
	Height	Integer	An integer specifying the height, in pixels, at which you want the image window displayed.
Example	ret = IpDocSize(200, 300) This statement will resize the active image window to 200 by 300 pixels.
Comments	The image window must be in the "restored" or maximized state when this function is performed.  Sizing a minimized image may produce unexpected results.
See Also	IpAppRestore,  IpAppMove


IpDraw

Syntax	IpDraw(Points, numpoints, Attrib)
Description	Draws a line, polygon, or points (markers).
Parameters	Points	POINTAPI	The name and first element of  an array containing the vertices of the line.
	numpoints	Integer	Number of points to be drawn
	Attrib	Integer	Specifies attributes of the object, or line: Valid values are: ATT_CONTROLS For a polyline, highlights all verticies  of the polyline ATT_NOCOPY Prevents the points of the line from being copied into the local memory  space.
Return Value	Returns the new drawing ID
See Also	IpDrawClear, IpDrawClearDoc, IpDrawGet, IpDrawSet, IpDrawText,
Comments	For all drawing or overlay functions, an object or drawing is a line, text, marker/point, or polygon that can be moved. The color of the object can also bet set by ORing the color (1-15) with the above parameters.


IpAnotAttr

Syntax	IpAnotAttr(attr, value)
Description	Describes the type of line to be drawn on the image or workspace.
Parameters	attr	Integer	Attribute to be changed. Valid values are: DRAW_FILLCOLOR  sets background color DRAW_LINECOLOR sets foreground color DRAW_LINEWIDTH sets width of lines
	value	Long	For  DRAW_FILLCOLOR and DRAW_LINCOLOR, this value is used to pass the red, green, and blue values of the desired color. To set these values, use the following  expression: Red x 65536 + Greeen x 256 + Blue Red, Green, and Blue can have values in the range 0 -255. For DRAW_LINEWIDTH, the value indicates whether  thick or thin lines should be drawn, according to the following: DRAW_THINLINE = thin lines DRAW_THICKLINE =  thick lines
Return Value	Returns the new value indicating the type of line.
See Also	IpAnotLine,  IpAnotBox  IpAnotEllipse
Comments	For all drawing or overlay functions, an object or drawing is a line, text, marker/point, or polygon that can be moved.


IpAnotBox

Syntax	IpAnotBox(IpBoxRect, Filled)
Description	Draws a box in the area indicated
Parameters	IpBoxRect	RECT	The name of the variable containing the box coordinates.
	Filled	Integer	Indicates if the box is filled or not
See Also	IpAnotAttr, IpAnotLine, IpAnotEllipse
Comments	For all drawing or overlay functions, an object or drawing is a line, text, marker/point, or polygon that can be moved.


IpAnotEllipse

Syntax	IpDrawEllipse(Center, XRadius, Yradius, bFilled)
Description	Draws an ellipse in the area indicated
Parameters	Center	POINTAPI	Indicates the center point of the ellipse
	XRadius	Integer	Indicates the length of the x-axis radius
	YRadius	Integer	Indicates the length of the y-axis radius
	bFilled	Integer	A value of 0 or 1 specifying if the ellipse will be filled or not. 0 = not filled 1 = filled
See Also	IpAnotAttr, IpAnotLine,  IpAnotBox,
Comments	For all drawing or overlay functions, an object or drawing is a line, text, marker/point, or polygon that can be moved.
Example	The following example draws an ellipse around the point 50, 50. The ellipse will be 40 pixels wide (x-radius) and 20 pixels high (y-radius), and will be filled with the current color.
Dim thePoint As POINTAPI

thePoint.x = 50

the Point.y = 50

ret = IpAnotEllipse(50, 20, 10, 1)


IpDrawClear

Syntax	IpDrawClear(objid)
Description	Erases the drawing.
Parameters	objid	Integer	Identifies the drawing to be erased.
See Also	IpDraw,  IpDrawClearDoc, IpDrawGet, IpDrawSet, IpDrawText,
Comments	For all drawing or overlay functions, an object or drawing is a line, text, marker/point, or polygon that can be moved.


IpDrawClearDoc

Syntax	IpDrawClearDoc(docid)
Description	Erases all drawings or object from the image docid.
Parameters	docid	Integer	Identifies the document containing the objects to be erased.
See Also	IpDraw, IpDrawGet, IpDrawSet, IpDrawText, IpDrawClear,
Comments	For all drawing or overlay functions, an object or drawing is a line, text, marker/point, or polygon that can be moved.


IpDrawGet

Syntax	IpDrawGet(command, objid, IpParam)
Description	Gets status, position, and other parameters for a given drawing or object.
Parameters	command	Integer	Identifies data to retrieve. Valid values are: GETCURPOS  Returns the cursor position at the point  where the mouse button was last held down. GETNUMPTS  Returns the number of points in the object GETPOINTS  Retrieves the objects points GETSTATUS  Returns a non-zero value if the object has been changed, and sets the objects status to zero. GETEDITPOINTReturns the currently selected point  of the object.
	objid	Integer	Identifies the object
	IpParam	Any	Results are returned in this variable.
See Also	IpDraw,  IpDrawSet, IpDrawText,  IpDrawClearDoc, IpDrawClear,
Comments	For all drawing or overlay functions, an object or drawing is a line, text, marker/point, or polygon that can be moved.


IpAnotLine

Syntax	IpAnotLine(IpPoints, numpoints, Endpoint, Filled)
Description	Draws a line throught the points indicated
Parameters	IpPoints	LPPOINT	The name and first element of  an array containing the vertices of the line.
	numpoints	Integer	Number of points to be drawn
	Filled	Integer	Indicates if the line is filled or not
	Endpoint	Integer	For single lines, indicates the type of line ending. Must be one of the following
	Value	Description
	DRAW_PLAINLINE	No endpoints.
	DRAW_LARGEARROWRIGHT	A large arrow on the right endpoint.
	DRAW_LARGEARROWLEFT	A large arrow on the left endpoint.
	DRAW_LARGEARROWBOTH	A large arrow on both endpoints.
	DRAW_SMALLARROWRIGHT	A small arrow on the right endpoint.
	DRAW_SMALLARROWLEFT	A small arrow on the left endpoint.
	DRAW_SMALLARROWBOTH	A small arrow on both endpoints.
	DRAW_CIRCLEARROW	A circle on the left endpoint and a large arrow on the right endpoint
	DRAW_ARROWCIRCLE	A largearrow on the left endpoint and a circle on the right endpoint
	DRAW_DIAMONDBOTH	Diamonds on both endpoints
	DRAW_CIRCLEBOTH	Circles on both endpoints
See Also	IpAnotEllipse IpAnotAttr, IpAnotBox,
Comments	For all drawing or overlay functions, an object or drawing is a line, text, marker/point, or polygon that can be moved.


IpDrawSet

Syntax	IpDrawSet(command, objid, IpParam)
Description	Sets status, position, and other parameters for a given drawing or object.
Parameters	command	Integer	Idenfies the parameter to set.
	objid	Integer	Identifies the object
	IpParam	Any	Idenfities other parameters for the given object.
See Also	IpDraw,  IpDrawGet, IpDrawText,  IpDrawClearDoc, IpDrawClear,
Comments	For all drawing or overlay functions, an object or drawing is a line, text, marker/point, or polygon that can be moved.


 IpDrawText

Syntax	IpDrawText(text, pos, Attrib)
Description	Draws text contained in text, at a location pos
Parameters	text	String	Contains text to be drawn
	pos	POINTAPI	Indicates point where text will be drawn.
	Attrib	Integer	Color of text
Return Value	Returns the new drawing ID
See Also	IpDraw,  IpDrawGet, IpDrawSet,  IpDrawClearDoc, IpDrawClear,
Comments	For all drawing or overlay functions, an object or drawing is a line, text, marker/point, or polygon that can be moved.


IpFftForward

Syntax	IpFftForward(DisplayType, bFullFft)
Description	This function performs an FFT transform of the active image or AOI.  Equivalent to the FFT command's Forward button and the Forward FFT Options dialog box.
Parameters	DisplayType	Integer	An enumerated integer, which specifies the way in which the transform results will be displayed.  Must be one of the following: FFT_PHASE FFT_SPECTRUM See definitions under Comments, below.
	bFullFft	Integer	An integer value of 0 or 1 specifying whether the process will produce a full- or half-set of FFT data.  Where:
			0  -  Generates a half-set of FFT data. 1  -  Generates a full set of FFT data.
Return Value	This function returns the Document ID of the FFT image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpFftForward(FFT_SPECTRUM, 0) This statement will perform an FFT transform and display the results in spectrum form.  Only a half-set of data will be generated.
Comments	The following table describes the values allowed in the DisplayType parameter:
VALUE	DESCRIPTION
FFT_PHASE	Displays the phase of the FFT.
FFT_SPECTRUM	Displays FFT data in the traditional "cloud of points" form.
See Also	IpFftInverse


IpFftHiPass

Syntax	IpFftHiPass(Type, Transition, PreserveNil)
Description	This function filters the FFT data to allow only the frequencies outside the specified range to remain in the image.  Equivalent to applying the Hi Pass option from the Filter group box in the FFT dialog box.
Parameters	Type	Integer	An enumerated integer specifying the way in which frequencies within the selected range will be treated.  Must be one of the following: FFT_HANNING FFT_NOTCH See definitions under Comments, below.
	Transition	Integer	An integer representing a percentage, from 0 to 50 (inclusive), specifying the rate at which the selected frequencies will be attenuated.  The closer this value is to 0, the more closely the result will resemble the results of the FFT_NOTCH Type.
	PreserveNil	Integer	An integer value of 0 or 1 specifying whether the zero frequency component is to be preserved.  Where: 0  - Preserves the Zero Frequency Component 1  - Does not preserve the Zero Frequency Component
Example	This set of statements will attenuate all frequencies within the AOI defined by ipRect.  A transition value of 30% will be applied during frequency attenuation.  The Zero Frequency Component will not be preserved.
ipRect.left = 66

ipRect.right = 189

ipRect.top = 58

ipRect.bottom = 196

ret = IpAoiCreateBox(ipRect)

ret = IpFftHiPass(FFT_HANNING, 30, 1)

Comments	Before calling the IpFftHiPass function, you must define ipRect such that it describes an AOI encompassing the selected frequencies (see example above). The following table describes the values allowed in the Type parameter:
VALUE	DESCRIPTION
FFT_NOTCH	Sets the selected frequencies to NULL.  Equivalent to selecting the "Rectangle" option in the "Inverse/Filter" dialog box.
FFT_HANNING	Attenuates the selected frequencies at the rate specified by Transition.  Equivalent to selecting the "Hanning" option in the "Inverse/Filter" dialog box.
	The Transition value is ignored when the FFT_NOTCH Type is specified.  Set it to 0.
See Also	IpFftLoPass,  IpFftSpikeCut


IpFftInverse

Syntax	IpFftInverse(DocId, PreserveData)
Description	This function performs an inverse transform of the active FFT image window.  Equivalent to the FFT command's Inverse button and the options in the Inverse/Filter Options dialog box.
Parameters	DocId	Integer	An integer specifying the ID of the image into which the inverse transform results are to be written, or one of the following: FFT_NEWIMAGE FFT_SOURCE Where, FFT_NEWIMAGE writes the result to a new image window, and FFT_SOURCE writes the result back to the image from which the FFT was generated.
	PreserveData	Integer	A value of 0 or 1 specifying whether the FFT data will be cleared from the FFT window when the inverse transform is complete.  Where: 0  -  Clears the data from the FFT window. 1  -  Keeps the data in the FFT window.
Return Value	This function returns the Document ID of the resulting image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpFftInverse(FFT_NEWIMAGE, 1) This statement will perform an inverse transformation and write the results into a new
	image window.  Data in the FFT window will be preserved so that it can be filtered again without having to do a forward FFT.
See Also	IpFftForward


IpFftLoad

Syntax	IpFftLoad(FileName)
Description	This function loads FFT data from a file into an image window.  Equivalent to the Load button in the FFT dialog box.
Parameters	FileName	String	A string specifying the name of the file from which the FFT data will be read.
Return Value	This function returns the Document ID of the FFT image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpFftLoad("C:\APPNAME\DNOISE.FFT") This statement will load the DNOISE.FFT file from the \APPNAME directory on drive C: .
See Also	IpFftSave


IpFftLoPass

Syntax	IpFftLoPass(Type, Transition)
Description	This function filters the FFT data to allow only the frequencies within the specified range to remain in the image.  Equivalent to applying the Lo Pass option from the Filter group box in the FFT dialog box.
Parameters	Type	Integer	An enumerated integer specifying the way in which frequencies outside the selected range are to be treated.  Must be one of the following: FFT_HANNING FFT_NOTCH See definitions under Comments, below.
	Transition	Integer	An integer representing a percentage, from 0 to 50 (inclusive), specifying the rate at which the selected frequencies will be attenuated.  The closer this value is to 0, the more closely the result will resemble the results of the FFT_NOTCH Type.
Example	This set of statements will attenuate all frequencies outside of the AOI defined by ipRect.  A transition value of 30% will be applied during frequency attenuation.
ipRect.left = 66

ipRect.right = 189

ipRect.top = 58

ipRect.bottom = 196

ret = IpAoiCreateBox(ipRect)

ret = IpFftLoPass(FFT_HANNING, 30)

Comments	Before calling the IpFftLoPass function, you must define ipRect such that it describes an AOI encompassing the selected frequencies (see example above). The following table describes values allowed in the Type parameter:
VALUE	DESCRIPTION
FFT_NOTCH	Sets the selected frequencies to NULL.  Equivalent to selecting the Rectangle option in the Inverse/Filter dialog box.
FFT_HANNING	Attenuates the selected frequencies at the rate specified by Transition.  Equivalent to selecting the Hanning option in the Inverse/Filter dialog box.
	The Transition value is ignored when the FFT_NOTCH Type is specified.  Set it to 0.
See Also	IpFftHiPass,  IpFftSpikeCut


IpFftSave

Syntax	IpFftSave(FileName)
Description	This function saves the current FFT data to a file.  Equivalent to the Save button in the FFT dialog box.
Parameters	FileName	String	A string specifying the name of the file to which the FFT data will be written.
Example	ret = IpFftSave("C:\APPNAME\DNOISE.FFT") This statement will save the FFT data to the DNOISE.FFT file in the \APPNAME directory on the C: drive.
Comments	If the specified file name already exists, it will be automatically overwritten.   See Appendix B in the Reference Guide for a description of the FFT file format.
See Also	IpFftLoad


IpFftShow

Syntax	IpFftShow(bShow)
Description	This function shows or hides the FFT dialog box.  Equivalent to selecting the FFT command to open the window or clicking its close button to close it.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether the FFT window is to be shown.  Where: 0  - Closes the window if it is already open. 1  - Opens the window.
Example	ret = IpFftShow(1) ret = IpFftForward(FFT_SPECTRUM, 0) This set of statements opens the FFT window and produces an FFT spectrum.
Comments	The FFT window does not have to be open during an FFT operation.  Its disposition, visible or hidden, is entirely your choice.  You will want to display the window if your users need to make a choice within it.  But, if your objective is simply to filter a spectrum in a predefined way, you neednt display the FFT window.


IpFftSpikeBoost

Syntax	IpFftSpikeBoost(Type, Transition, Symmetrical)
Description	This function accentuates the selected frequencies in a set of FFT data.  Equivalent to applying the Spike Boost option from the Filter group box in the FFT dialog box.
Parameters	Type	Integer	An enumerated integer specifying the way in which the selected frequencies will be treated.  Must be one of the following: FFT_HANNING FFT_NOTCH See definitions under Comments, below.
	Transition	Integer	An integer representing a percentage, from 0 to 50 (inclusive), specifying the rate at which the selected frequencies will be attenuated.  The closer this value is to 0, the more closely the result will resemble the results of the FFT_NOTCH Type.
	Symmetrical	Integer	An integer value of 0 or 1 specifying whether both halves of the FFT data set will be affected by the frequency filter.  Where: 0  -  Disables Symmetrical editing. 1  -  Enables Symmetrical editing.
Example	ipRect.left = 66

ipRect.top = 58

ipRect.right = 189

ipRect.bottom = 196

ret = IpAoiCreateBox(ipRect)

ret = IpFftSpikeBoost(FFT_HANNING, 30, 0)

	This set of statements will accentuate all frequencies within the AOI defined by ipRect (i.e., 66,58 and 189,196).  A transition value of 30% will be applied during frequency accentuation.
Comments	Before calling the IpFftSpikeBoost function, you must define ipRect such that it describes an AOI encompassing the selected frequencies (see example above). The following table describes the values allowed in the Type parameter:
VALUE	DESCRIPTION
FFT_NOTCH	Sets the selected frequencies to NULL.  Equivalent to selecting the "Rectangle" option in the "Inverse/Filter" dialog box.
FFT_HANNING	Accentuates the selected frequencies at the rate specified by Transition.  Equivalent to selecting the "Hanning" option in the "Inverse/Filter" dialog box.
	The Transition value is ignored when the FFT_NOTCH Type is specified.  Set it to 0.
See Also	IpFftHiPass,  IpFftLoPass


IpFftSpikeCut

Syntax	IpFftSpikeCut(Type, Transition, Symmetrical)
Description	This function removes or attenuates the selected frequencies in a set of FFT data.  Equivalent to applying the Spike Cut option from the Filter group box in the FFT dialog box.
Parameters	Type	Integer	An enumerated integer specifying the way in which the selected frequencies will be treated.  Must be one of the following: FFT_HANNING FFT_NOTCH See definitions under Comments, below.
	Transition	Integer	An integer representing a percentage, from 0 to 50 (inclusive), specifying the rate at which the selected frequencies will be attenuated.  The closer this value is to 0, the more closely the result will resemble the results of the FFT_NOTCH Type.
	Symmetrical	Integer	An integer value of 0 or 1 specifying whether both halves of the FFT data set will be affected by the frequency filter.  Where: 0  -  Disables Symmetrical editing. 1  -  Enables Symmetrical editing.
Example	This set of statements will attenuate all frequencies within the AOI defined by ipRect (i.e., 66,58 and 189,196).  A transition value of 30% will be applied during frequency attenuation.
ipRect.left = 66

ipRect.top = 58

ipRect.right = 189

ipRect.bottom = 196

ret = IpAoiCreateBox(ipRect)

ret = IpFftSpikeCut(FFT_HANNING, 30, 0)

Comments	Before calling the IpFftSpikeCut function, you must define ipRect such that it describes an AOI encompassing the selected frequencies (see example above). The following table describes the values allowed in the Type parameter:
VALUE	DESCRIPTION
FFT_NOTCH	Sets the selected frequencies to NULL.  Equivalent to selecting the "Rectangle" option in the "Inverse/Filter" dialog box.
FFT_HANNING	Attenuates the selected frequencies at the rate specified by Transition.  Equivalent to selecting the "Hanning" option in the "Inverse/Filter" dialog box.
	The Transition value is ignored when the FFT_NOTCH Type is specified.  Set it to 0.
See Also	IpFftHiPass,  IpFftLoPass


IpFltClose

Syntax	IpFltClose(Shape, Passes)
Description	This function applies the closing filter to the active image or AOI.  Equivalent to selecting the Close option within the Filter command window.
Parameters	Shape	Integer	An enumerated integer specifying the shape and size of the filtering kernel.  Must be one of the following: MORPHO_2x2SQUARE MORPHO_3x1ROW MORPHO_1x3COLUMN MORPHO_3x3CROSS MORPHO_5x5OCTAGON MORPHO_7x7OCTAGON MORPHO_11x11OCTAGON See definitions under Comments, below.
	Passes	Integer	An integer between 1 and 100 (inclusive) specifying the number of times the filter is to be applied to the image.
Example	ret = IpFltClose(MORPHO_2x2SQUARE, 3) This statement will filter the image data using a 2 x 2 square closing filter.  The filter will be applied 3 times.
Comments	The following table describes the values allowed in the Shape parameter:  These values are equivalent to the options presented by the Filtering window's Options group box when a morphological filter is selected.
VALUE	DESCRIPTION
MORPHO_2x2SQUARE	Applies a 2 x 2 square filtering kernel.
MORPHO_3x1ROW	Applies a 3 x 1 horizontal filtering kernel.
MORPHO_1x3COLUMN	Applies a 1 x 3 vertical filtering kernel.
MORPHO_3x3CROSS	Applies a 3 x 3 cross filtering kernel.
MORPHO_5x5OCTAGON	Applies a 5 x 5 octagonal filtering kernel.
MORPHO_7x7OCTAGON	Applies a 7 x 7 octagonal filtering kernel.
MORPHO_11x11OCTAGON	Applies a 11 x 11 octagonal filtering kernel.
See Also	IpFltOpen,  IpFltErode,  IpFltDilate


IpFltConvolveKernel

Syntax	IpFltConvolveKernel(KernelName, Strength, Passes)
Description	This function filters the image data using the convolution filter contained in the specified file.  Equivalent to selecting the Other option within the Filter command window.
Parameters	KernelName	String	A string specifying the file in which the kernel coefficients are contained.
	Strength	Integer	An integer between 1 and 10 (inclusive) specifying the amount of the filtered result that is to be applied to the image.  A value of 10 indicates that the full result (100%) is to be applied.  Lesser values apply the result at reduced strengths.
	Passes	Integer	An integer between 1 and 100 (inclusive) specifying the number of times the filter is to be applied to the image.
Example	ret = IpFltConvolveKernel("VERTEDGE.7x7", 10, 1) This statement will filter the image data using the kernel contained in the file VERTEDGE.7x7.  This filter will be applied one time at full strength (10).
Comments	See Appendix B in the  Reference Guide  for a description of a kernel file.


IpFltDilate

Syntax	IpFltDilate(Shape, Passes)
Description	This function applies the Dilation filter to the active image or AOI.  Equivalent to selecting the Dilate option within the Filter command window.
Parameters	Shape	Integer	An enumerated integer specifying the shape and size of the filtering kernel.  Must be one of the following: MORPHO_2x2SQUARE MORPHO_3x1ROW MORPHO_1x3COLUMN MORPHO_3x3CROSS MORPHO_5x5OCTAGON MORPHO_7x7OCTAGON MORPHO_11x11OCTAGON See definitions under Comments, below.
	Passes	Integer	An integer between 1 and 100 (inclusive) specifying the number of times the filter is to be applied to the image.
Example	ret = IpFltDilate(MORPHO_1x3COLUMN, 2) This statement will filter the image data using a 1 x 3 vertical dilation filter.  The filter will be applied 2 times.
Comments	The following table describes the values allowed in the Shape parameter:  These values are equivalent to the options presented within the Filtering window's Options group box when a morphological filter is selected.
VALUE	DESCRIPTION
MORPHO_2x2SQUARE	Applies a 2 x 2 square filtering kernel.
MORPHO_3x1ROW	Applies a 3 x 1 horizontal filtering kernel.
MORPHO_1x3COLUMN	Applies a 1 x 3 vertical filtering kernel.
MORPHO_3x3CROSS	Applies a 3 x 3 cross filtering kernel.
MORPHO_5x5OCTAGON	Applies a 5 x 5 octagonal filtering kernel.
MORPHO_7x7OCTAGON	Applies a 7 x 7 octagonal filtering kernel.
MORPHO_11x11OCTAGON	Applies a 11 x 11 octagonal filtering kernel.
See Also	IpFltOpen,  IpFltErode,  IpFltClose


IpFltDistance

Syntax	IpFltDistance(Threshold, Mode, Passes)
Description	This function applies the distance filter to the active image or AOI.
Parameters	Threshold	Integer	An integer value between 1 and 100 inclusive that describes the intensity of the filter
	Mode	Integer	Specifies how diagonal distances are counted relative to horizontal and vertical distances.  Must be one of the following: DISTANCE_SQUARE - horizontal and vertical distances are given the same weight as diagonal distances. DISTANCE_DIAGONAL - diagonal distances are weighted more  than horizontal and vertical distances.


IpFltErode

Syntax	IpFltErode(Shape, Passes)
Description	This function applies the Erosion filter to the active image or AOI.  Equivalent to selecting the Erode option within the Filter command window.
Parameters	Shape	Integer	An enumerated integer specifying the shape and size of the filtering kernel.  Must be one of the following: MORPHO_2x2SQUARE MORPHO_3x1ROW MORPHO_1x3COLUMN MORPHO_3x3CROSS MORPHO_5x5OCTAGON MORPHO_7x7OCTAGON MORPHO_11x11OCTAGON See definitions under Comments, below.
	Passes	Integer	An integer between 1 and 100 (inclusive) specifying the number of times the filter is to be applied to the image data.
Example	ret = IpFltErode(MORPHO_3x1ROW, 2) This statement will filter the image data using a 3 x 1 horizontal erosion filter.  The filter will be applied 2 times.
Comments	The following table describes the values allowed in the Shape parameter.  These values are equivalent to the options presented within the Filtering window's Options group box when a morphological filter is selected.
VALUE	DESCRIPTION
MORPHO_2x2SQUARE	Applies a 2 x 2 square filtering kernel.
MORPHO_3x1ROW	Applies a 3 x 1 horizontal filtering kernel.
MORPHO_1x3COLUMN	Applies a 1 x 3 vertical filtering kernel.
MORPHO_3x3CROSS	Applies a 3 x 3 cross filtering kernel.
MORPHO_5x5OCTAGON	Applies a 5 x 5 octagonal filtering kernel.
MORPHO_7x7OCTAGON	Applies a 7 x 7 octagonal filtering kernel.
MORPHO_11x11OCTAGON	Applies a 11 x 11 octagonal filtering kernel.
See Also	IpFltOpen,  IpFltDilate,  IpFltClose


IpFltExtractBkgnd

Syntax	IpFltExtractBkgnd(BrightOnDark, ObjectSize)
Description	This function extracts the background from the active image or AOI.  Equivalent to selecting the Background option within the Filter command window.
Parameters	BrightOnDark	Integer	An integer value of 0 or 1 specifying whether the objects are dark or light.  Where: 0  - Specifies dark objects on a bright background.  Equivalent to the "Bright" background selection in the "Option" group box.
			1  - Specifies bright objects on a dark background.  Equivalent to the "Dark" background selection in the "Option" group box.
	ObjectSize	Integer	An integer between 7 and 100 (inclusive) that describes the size of the objects in the image, in pixels.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpFltExtractBkgnd(0, 25) This statement will extract the background from an image containing dark objects that are smaller than 25 pixels in diameter.
See Also	IpFltFlatten


IpFltFlatten

Syntax	IpFltFlatten(BrightOnDark, ObjectSize)
Description	This function flattens the background of the active image or AOI.  Equivalent to selecting the Flatten option within the Filter command window.
Parameters	BrightOnDark	Integer	An integer value of 0 or 1 specifying whether the objects are dark or light.  Where: 0  - Specifies dark objects on a bright background.  Equivalent to the "Bright" background selection in the "Option" group box. 1  - Specifies bright objects on a dark background.  Equivalent to the "Dark" background selection in the "Option" group box.
	ObjectSize	Integer	An integer between 7 and 100 (inclusive) that describes the size of the objects in the image, in pixels.
Example	ret = IpFltFlatten(1, 40) This statement will flatten the background of an image containing bright objects that are smaller than 40 pixels in diameter.
See Also	IpFltExtractBkgnd


IpFltGauss

Syntax	IpFltGauss(Size, Strength, Passes)
Description	This function applies the Gauss filter to the active image or AOI.  Equivalent to selecting the Gauss  option within the Filter command window. Use this filter to soften an image by eliminating high-frequency information using a Gauss function. This has the effect of blurring sharp edges. The operation of the Gauss filter is similar to the LoPass filter, but it degrades the image less than the LoPass filter.
Parameters	Size	Integer	An integer value of 3, 5 or 7, which specifies the size of the kernel to be applied during the filtering operation.
	Strength	Integer	An integer between 1 and 10 (inclusive) specifying the amount of the filtered result to be applied to the image.  A value of 10 indicates that the full result (100%) is to be applied.  Lesser values apply the result at reduced strengths.
	Passes	Integer	An integer between 1 and 100 (inclusive) specifying the number of times the filter is to be applied to the image.
Example	ret = IpFltGauss(5, 8, 2) This statement will filter the image data using the 5 x 5 kernel.  The results will be applied at reduced strength (8).  The filter will be applied twice.


IpFltHiPass

Syntax	IpFltHiPass(Size, Strength, Passes)
Description	This function applies the HiPass filter to the active image or AOI.  Equivalent to selecting the HiPass option within the Filter command window.
Parameters	Size	Integer	An integer value of 3, 5 or 7 specifying the size of the kernel to be applied during the filtering operation.  Convolution kernels are always square, so this value specifies both length and width (e.g., 3 x 3).
	Strength	Integer	An integer between 1 and 10 (inclusive) specifying the amount of the filtered result to be applied to the image.  A value of 10 indicates that the full result (100%) is to be applied.  Lesser values apply the result at reduced strengths.
	Passes	Integer	An integer between 1 and 100 (inclusive) specifying the number of times the filter is to be applied to the image.
Example	ret = IpFltHiPass(5, 8, 2) This statement will filter the image data using the 5 x 5 kernel.  The results will be applied at reduced strength (8).  The filter will be applied twice.


IpFltLaplacian

Syntax	IpFltLaplacian(Size, Strength, Passes)
Description	This function applies the Laplacian filter to the active image or AOI.  Equivalent to selecting the Laplacian option within the Filter command window.
Parameters	Size	Integer	An integer value of 3, 5 or 7 specifying the size of the kernel to be applied during the filtering operation.
	Strength	Integer	An integer between 1 and 10 (inclusive) specifying the amount of the filtered result to be applied to the image.  A value of 10 indicates that the full result (100%) is to be applied.  Lesser values apply the result at reduced strengths.
	Passes	Integer	An integer between 1 and 100 (inclusive) specifying the number of times the filter is to be applied to the image.
Example	ret = IpFltLaplacian(5, 8, 2) This statement will filter the image data using the 5 x 5 kernel.  The results will be applied at reduced strength (8).  The filter will be applied twice.


IpFltLocalHistEq

Syntax	IpFltLocalHistEq(WindowSize, StepSize, EqualType, StdDev)
Description	This function applies local histogram equalization techniques to the image and adjusts the image intensities accordingly. The effect is to bring out image details that might not be discernable using global enhancements such as Best Fit or global Histogram Equalization.
Parameters	WindowSize	Integer	The size of the window upon which to calculate the local histogram. Smaller windows will track smaller details more effectively, while larger windows will provide a smoother overall effect
	StepSize	Integer	The distance over which a particular histogram will be applied before recalculation. This parameter is limited to a maximum of WindowSize. Smaller values provide closer tracking of local effects, while larger values are more efficient.
	EqualType	Integer	The type of histogram equalization to apply. The values are as follows: LOCEQ_LINEAR - 1: See Global Histogram  Equalization. LOCEQ_BELL - 2: See Global Histogram Equalization LOCEQ_LOG - 3: See Global Histogram Equalization LOCEQ_EXP - 4: See Global Histogram Equalization LOCEQ_BESTFIT - 5: See Global Histogram  Equalization LOCEQ_STDDEV - 6: The image values at +/- the  StdDev parameter will be stretched to the  maximum  and minimum intensities. This provides an effect akin  to the BESTFIT method, but  with much less  sensitivity to outlying values
	StdDev	float	Only used if EQ_STDDEV is specified, this floating point value specifies the number of standard deviations +/- that are stretched to maximum and minimum intensities. For a normal distribution of intensities in a random image a value of 1.0 includes 67% of the values, 2.0 includes 95%, and 3.0 includes 99%. This parameter is limited to a range of 0.1 to 5.0.
Example	ret = IpFltLocalHistEq( 30, 5, 6, 1.5 )
Comments	LHE is accessed via the Filter dialog. Functionally, it belongs to the same group as Hipass and Sharpen.


IpFltLoPass

Syntax	IpFltLoPass(Size, Strength, Passes)
Description	This function applies the LoPass filter to the active image or AOI.  Equivalent to selecting the LoPass option within the Filter command window.
Parameters	Size	Integer	An integer value of 3, 5 or 7, which specifies the size of the kernel to be applied during the filtering operation.
	Strength	Integer	An integer between 1 and 10 (inclusive) specifying the amount of the filtered result to be applied to the image.  A value of 10 indicates that the full result (100%) is to be applied.  Lesser values apply the result at reduced strengths.
	Passes	Integer	An integer between 1 and 100 (inclusive) specifying the number of times the filter is to be applied to the image.
Example	ret = IpFltLoPass(5, 8, 2) This statement will filter the image data using the 5 x 5 kernel.  The results will be applied at reduced strength (8).  The filter will be applied twice.


IpFltMedian

Syntax	IpFltMedian(Size, Passes)
Description	This function applies the Median filter to the active image or AOI.  Equivalent to selecting the Median option within the Filter command window.
Parameters	Size	Integer	An integer value of 3, 5 or 7 specifying the size of the kernel to be applied during the filtering operation.
	Passes	Integer	An integer between 1 and 100 (inclusive) specifying the number of times the filter is to be applied to the image data.
Example	ret = IpFltMedian(5, 2) This statement will filter the image data using the 5 x 5 kernel.  The filter will be applied twice.
See Also	IpFltLoPass


IpFltReduce

Syntax	IpFltReduce(Threshold, Mode, Passes)
Description	This function applies the reducing filter to the active image or AOI.
Parameters	Threshold	Integer	An integer value between 1 and 100 inclusive that describes the intensity of the filter
	Mode	Integer	Neighbor mode.  Must be one of the following: REDUCE_4NEIGHBOR - only pixels adjacent horizontally or vertically are included. REDUCE_8NEIGHBOR - all neighboring pixels, including ones diagonally adjacent, are included


IpFltShow

Syntax	IpFltShow(bShow)
Description	This function displays or hides the Filter dialog box.  Equivalent to selecting the Filtering command to open the window and clicking its Close button to close it.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether the Filtering window is to be shown.  Where: 0  - Closes the window if it is already open. 1  - Opens the window.
Example	This set of statements will open the Filtering window, filter an image using the open and closing filters, then close the Filtering window.
ret = IpFltShow(1)

ret = IpFltOpen(MORPHO_2x2SQUARE, 1)

ret = IpFltClose(MORPHO_7x7OCTAGON, 1)

ret = IpFltShow(0)

Comments	The Filtering window does not have to be open during a filtering operation.  Its disposition, visible or hidden, is entirely your choice.  You will want to display the window when your users are required to make choices within it.  However, if your objective is simply to filter an image in a predefined way, you need not display the Filtering window.


IpFltOpen

Syntax	IpFltOpen(Shape, Passes)
Description	This function applies the Opening filter to the active image or AOI.  Equivalent to selecting the Open option within the Filter command window.
Parameters	Shape	Integer	An enumerated integer specifying the shape and size of the filtering kernel.  Must be one of the following: MORPHO_2x2SQUARE MORPHO_3x1ROW MORPHO_1x3COLUMN MORPHO_3x3CROSS MORPHO_5x5OCTAGON MORPHO_7x7OCTAGON MORPHO_11x11OCTAGON See definitions under Comments, below.
	Passes	Integer	An integer between 1 and 100 (inclusive) specifying the number of times the filter is to be applied to the image.
Example	ret = IpFltOpen(MORPHO_3x3CROSS, 5) This statement will filter the image data using a 3 x 3 cross opening filter.  The filter will be applied 5 times.
Comments	The following table describes the values allowed in the Shape parameter:  These values are equivalent to the options presented within the Filtering window's Options group box when a morphological filter is selected.
VALUE	DESCRIPTION
MORPHO_2x2SQUARE	Applies a 2 x 2 square filtering kernel.
MORPHO_3x1ROW	Applies a 3 x 1 horizontal filtering kernel.
MORPHO_1x3COLUMN	Applies a 1 x 3 vertical filtering kernel.
MORPHO_3x3CROSS	Applies a 3 x 3 cross filtering kernel.
MORPHO_5x5OCTAGON	Applies a 5 x 5 octagonal filtering kernel.
MORPHO_7x7OCTAGON	Applies a 7 x 7 octagonal filtering kernel.
MORPHO_11x11OCTAGON	Applies a 11 x 11 octagonal filtering kernel.
See Also	IpFltClose,  IpFltDilate,  IpFltErode


IpFltPhase

Syntax	IpFltPhase( )
Description	This function applies the Phase filter to the active image or AOI.  Equivalent to selecting the Phase option within the Filter command window.


IpFltPrune

Syntax	IpFltPrune(Threshold, Passes)
Description	This function applies the pruing filter to the active image or AOI.
Parameters	Threshold	Integer	An integer value between 1 and 100 inclusive that describes the intensity of the filter
	Passes	Integer	An integer between 1 and 65535 (inclusive) that describes the number of passes.
Example	ret = IpFltPrune ( 50,2)
Comments	This statement applies the Prune filter with a 50%  threshold. The filter is applied twice.


IpFltRoberts

Syntax	IpFltRoberts( )
Description	This function applies the Roberts filter to the active image or AOI.  Equivalent to selecting the Roberts option within the Filter command window.


IpFltSharpen

Syntax	IpFltSharpen(Size, Strength, Passes)
Description	This function applies the Sharpen filter to the active image or AOI.  Equivalent to selecting the Sharpen option within the Filter command window.
Parameters	Size	Integer	An integer value of 3, 5 or 7 specifying the size of the kernel to be applied during the filtering operation.
	Strength	Integer	An integer between 1 and 10 (inclusive) specifying the amount of the filtered result to be applied to the image.  A value of 10 indicates that the full result (100%) is to be applied.  Lesser values apply the result at reduced strengths.
	Passes	Integer	An integer between 1 and 100 (inclusive) specifying the number of times the filter is to be applied to the image.
Example	ret = IpFltSharpen(5, 8, 2) This statement will filter the image data using the 5 x 5 kernel.  The results will be applied at reduced strength (8).  The filter will be applied twice.
See Also	IpFltHiPass


IpFltSobel

Syntax	IpFltSobel( )
Description	This function applies the Sobel filter to the active image or AOI.  Equivalent to selecting the Sobel option within the Filter command window.


IpFltThin

Syntax	IpFltThin(Threshold)
Description	This function applies the Thinning filter to the active image or AOI.  Equivalent to selecting the Thinning option within the Filter command window.
Parameters	Threshold	Integer	An integer between 1 and 100 (inclusive) specifying the gray level at which the image should be binarized before the filter is applied.  This value represents a percentage of the intensity range, e.g., a value of 50 specifies the intensity level at the 50% point in the range.
Example	ret = IpFltThin(25) This statement will apply the Thinning filter to the image data, which is first binarized at the 25% gray level.


IpFltVariance

Syntax	IpFltVariance(SizeX, SizeY)
Description	This function applies the Variance filter to the active image or AOI.  Equivalent to selecting the Variance option within the Filter command window.
Parameters	SizeX	Integer	An integer specifying the size of the kernel in the X direction.
	SizeY	Integer	An integer specifying the size of the kernel in the Y direction.
Example	ret = IpFltVariance(5, 5) This statement will filter the image data using a 5 x 5 kernel.


IpFltUserDilate

Syntax	FltUserDilate(KernelName, Passes)
Description	This function applies a morphological dilation filter with a user-defined kernel to active image or AOI with a user-defined kernel.
Parameters	Threshold	String	A string specifying a file name for the kernel filter.
	Passes	Integer	An integer between 1 and 65535 (inclusive).
Example	ret = FltUserDilate ("mykernel.3x3", 2)
Comments	This statement will apply the dilation  function using the kernel file, "mykernel.3x3". The filter will be applied twice.


IpFltUserErode

Syntax	FltUserErode(KernelName,Passes)
Description	This function applies a morphological erosion filter to the active image or AOI with a user-defined kernel.
Parameters	Threshold	String	A string specifying a file name for the kernel filter.
	Passes	Integer	An integer between 1 and 65535 (inclusive).
Example	ret = FltUserErode ("mykernel.3x3", 2)
Comments	This statement will apply the erosion function using the kernel file, "mykernel.3x3". The filter will be applied twice.


IpFltWatershed

Syntax	IpFltWatershed(Threshold)
Description	This function applies the Watershed filter to the active image or AOI.  Equivalent to selecting the Watershed option within the Filter command window.
Parameters	Threshold	Integer	An integer between 1 and 100 (inclusive) specifying the gray level at which the image should be binarized before the filter is applied.  This value represents a percentage of the intensity range, e.g., a value of 50 specifies the intensity level at the 50% point in the range.
Example	ret = IpFltWatershed(30) This statement will apply the Watershed filter to the image data, which is first binarized at the 30% gray level.


IpFTPOpen

Syntax	IpFTPOpenFile (Server, FileName)
Description	This function opens the named file.
Parameters	FileName	String	Name of the file (including server dirrectory if any)
	Server	String	Name or IP address of the Internet file server.
See Also	IpFTPSave


 IpFTPSave

Syntax	IpFTPSave (Server, FileName)
Description	This function saves the specified document.
Parameters	FileName	String	Name of the file (including server dirrectory if any)
	Server	String	Name or IP address of the Internet file server.
See Also	IpFTPOpen


IpGetLine

Syntax	IpGetLine(message,LinePts, numpoints, maxpoints, Attrib)
Description	Ask the user to click on a line or polygon. The line or polygon is returned in LinePts and numpoints; maxpoints indicates the maximum number of points that can be clicked in. The function returns the new object id. A different message can be displayed for each point by separating messages with ASCII character 10.
Parameters	message	String (Basic) LPSTR (C)	The message relating to a point or points.
	LinePts	LPPOINT	Defines the line.
	Numpoints	LPInteger	Defines the polygon.
	Maxpoints	Integer	Maximum number of points that can be clicked in.
	Attrib	Integer	Other attributes of the line or polygon
Example	Dim lineid as integer, numpts as integer Dim linePts(2) as POINTAPI Dim message as string message = "Click 1st point" + chr$(10) + "click 2nd point" lineid = IpGetLine(message, linePts(0), numpts, 2, 0)
Comments	For all drawing or overlay functions, an object or drawing is a line, text, marker/point, or polygon that can be moved.


IpHstCreate

Syntax	IpHstCreate( )
Description	This function opens the Histogram window for the active image.  Equivalent to selecting the Histogram command.
Return Value	This function returns the Histogram ID if successful.  A -1 is returned if an error occurred.
Comments	An image must be open before calling this function.  The newly created histogram window becomes the "active" (i.e., selected) histogram as soon as it is created.
See Also	IpHstMove,  IpHstDestroy,  IpHstSelect


IpHstDestroy

Syntax	IpHstDestroy( )
Description	This function closes the active histogram window and clears any data associated with it.  Equivalent to selecting the Close command in the Histogram window's File menu.
Comments	Note that this function operates upon the "active" histogram window (i.e., the one most recently opened or selected).  If the currently active histogram is not the one you want to use, you must use IpHstSelect to explicitly select (make active) the appropriate window before calling IpHstDestroy.
See Also	IpHstCreate,  IpHstSelect


IpHstEqualize

Syntax	IpHstEqualize(Method)
Description	This function will redistribute the active image's histogram using the specified method.  Equivalent to selecting an equalization method with the Equalize command.
Parameters	Method	Integer	An enumerated integer specifying the equalization method to use.  Must be one of the following types: EQ_BESTFIT EQ_BELL EQ_LINEAR EQ_LOGARITHMIC EQ_EXPONENTIAL See definitions under Comments, below.
Example	ret = IpHstEqualize(EQ_BELL) This statement will equalize the histogram using the "Bell" method.
Comments	The following table describes the values allowed in the Method parameter:
	Method	DESCRIPTION
	EQ_BESTFIT	Assigns bottom 3% as Shadow point, upper 3% as Highlight point and distributes the remainder evenly across the scale. (Equivalent to BestLut in the Image menu.)
	EQ_BELL	Distributes the histogram evenly around the center of the intensity scale.
	EQ_LINEAR	Distributes the histogram equally across the intensity scale.
	EQ_LOGARITHMIC	Shifts the histogram to the lower-end of the intensity scale.
	EQ_EXPONENTIAL	Shifts the histogram to the upper-end of the intensity scale.


IpHstGet

Syntax	IpHstGet(Cmd, Param, OutVal)
Description	Use this function to get information relating to the selected histogram.  There is no command equivalent to this function; it is one that must be manually written with the macro editor.
Parameters	Cmd	Integer	A command ID, which specifies the type of  information you want to retrieve.  Must be one of the following: GETINDEX GETNUMPTS
			GETVALUES GETSTATS GETRANGE See definitions under Comments, below.
	Param	Integer	An integer specifying data with which Cmd will operate.  See definitions under Comments, below, for the values required by each command
	OutVal	See below	The address (name) of the variable that will receive the requested data.  Be sure this variable is of the type required by Cmd.  See Cmd description under Comments, below.
Return Value	All commands listed below return 0 if successful.  A negative error, otherwise.
Example	The following example calculates the mean value in the active histogram.
Dim numbins As Integer

Dim hstSum As Single, totalPix as single, Mean as single

Dim i As Integer

ret=IpHstGet(GETNUMPTS,0,numbins)

Redim hstdat(numbins) As Single

ret=IpHstGet(GETVALUES,numbins,hstdat(0))

hstSum=0#

totalPix=0#

For i=0 To numbins - 1

hstSum=hstSum + hstdat(i) * i

totalPix=totalPix + hstdat(i)

Next i

If totalPix > 0# Then

Mean=hstSum/totalPix

End If

.

.

.

The following example gets the mean value directly

.

.

.

Redim stats(10) As Single

ret = IpHstGet(GETSTATS, 0, stats(0))

Mean = stats(0)

StdDev = stats(1)

Sum = stats(2)

Comments	Note that this function operates upon the "active" histogram window (i.e., the one most recently opened or selected).  If the currently active histogram is not the one you want to use, you must use IpHstSelect to explicitly select (make active) the appropriate window before calling IpHstGet. Histograms of RGB images contain 3 times as much data as an equivalent Gray Scale histogram. The data are organized Red channel first, then Green, then Blue. When passing an array to your application from a BASIC program, be sure to pass the first element of the array by reference (See IpHstGet(GETSTATS) statement in example, above).
	For future extension, statistics and range arrays should be large enough to store at least 10 elements. Cmd options are as follows:
Cmd VALUE	DESCRIPTION
GETINDEX	Use this command to determine the active histogram's ID.  The ID will be written to OutVal.  This value can be used later to select this histogram with IpHstSelect( ).
		Param VALUE		OutVal TYPE
		Not used by GETINDEX.  Must be set to 0.		BASIC, Integer C, LPSHORT
GETNUMPTS	Use this command to determine the number of bins into which the histogram is divided.  This number will be written to OutVal.
		Param VALUE		OutVal TYPE
		Not used by GETNUMPTS.  Must be set to 0.		BASIC, Integer C, LPSHORT
GETVALUES	Use this command to get the selected histogram's values.  These values will be written to the one-dimensional array you have specified in OutVal.  For a True Color histogram the entire Red channel histogram is written into the array first, then the Green channel, then the Blue channel.
		Param VALUE		OutVal TYPE
		An integer specifying the length of your OutVal array.  If you are getting data from a True Color image, your array must be large enough to hold 3 times the number of points in the histogram. Note - you can use GETNUMPTS to determine the number of elements needed in this array.		BASIC , Single. C,  LPFLOAT Note - OutVal must specify an array.
GETSTATS	Use this command to get the statistical data associated with the selected histogram.  For True Color images, information will be obtained for the color channel you specify in Param (see below). This command writes the statistics to a 10-element array in OutVal, as follows: OutVal (0) -  Mean value OutVal (1) -  Standard Deviation OutVal (2) -  Sum OutVal (3) -  Minimum gray level (X-MIN) OutVal (4) -  Maximum gray level (X-MAX) OutVal (5) -  Not Currently Used
GETSTATS	OutVal (6) -  Not Currently Used OutVal (7) -  Not Currently Used OutVal (8) -  Not Currently Used OutVal (9) -  Not Currently Used
		Param VALUE		OutVal TYPE
		An integer specifying the color channel for which statistics are to be obtained.  Where: 0 -  Red Channel 1 -  Green Channel 2 -  Blue Channel This parameter is ignored if the image is not True Color.  When this is the case, just set Param to 0.		BASIC, Single. C,  float Note - OutVal must specify a 10-element array.
GETRANGE	Use this command to get the range information associated with the selected histogram.  For True Color images, information will be obtained for the color channel you specify in Param (see below). This command will write the range information to a 10-element array in OutVal, as follows: OutVal (0) -  Start range (X1) OutVal (1) -  End range (X2) OutVal (2) -  Sum of histogram inside range (Area) OutVal (3) -  Sum, above, as a percent of total histogram (%) OutVal (4) -  Histogram value at start of range (X1) OutVal (5) -  Histogram value at end of range (X2) OutVal (6) -  Bin number at start of range (0-based) OutVal (7) -  Bin number at end of range (0-based) OutVal (8) -  Not Currently Used OutVal (9) -  Not Currently Used
		Param VALUE		OutVal TYPE
		An integer specifying the color channel for which range information is to be obtained.  Where: 0 -  Red Channel  1 -  Green Channel 2 -  Blue Channel This parameter is ignored if the image is not True Color.    When this is the case, just set Param to 0.		BASIC, Single. C,  float Note - OutVal must specify a 10-element array.
See Also	IpHstCreate,  IpHstSelect


IpHstMaximize

Syntax	IpHstMaximize( )
Description	This function enlarges the active histogram window to full screen.  Equivalent to clicking the maximize button on the Histogram window Control bar.
Comments	Note that this function operates upon the "active" histogram window (i.e., the one most recently opened or selected).  If the currently active histogram is not the one you want to use, you must use IpHstSelect to explicitly select (make active) the appropriate window before calling IpHstMaximize.
See Also	IpHstMinimize,  IpHstRestore,  IpHstSelect


IpHstMinimize

Syntax	IpHstMinimize( )
Description	This function reduces the active histogram window to an icon.  Equivalent to clicking the minimize button on the Histogram window Control bar.
Comments	Note that this function operates upon the "active" histogram window (i.e., the one most recently opened or selected).  If the currently active histogram is not the one you want to use, you must use IpHstSelect to explicitly select (make active) the appropriate window before calling IpHstMinimize.
See Also	IpHstMaximize,  IpHstRestore,  IpHstSelect


IpHstMove

Syntax	IpHstMove(x, y)
Description	This function moves the active (i.e., selected) histogram window to the specified location.  Equivalent to dragging the Histogram window with the mouse.
Parameters	x	Integer	An integer specifying the x-coordinate of the screen position to which you want the upper-left corner of the Histogram window moved.
	y	Integer	An integer specifying the y-coordinate of the screen position to which you want the upper-left corner of the Histogram window moved.
Example	ret = IpHstMove(10, 40)  This statement will move the active histogram window 11 pixels to the right, and 41 pixels down from the upper-left corner of the screen.
Comments	The origin ( 0, 0 ) for the coordinate system used by the x and y parameters is the upper-left corner of the screen.  Note that this function operates upon the "active" histogram window (i.e., the one most recently opened or selected).  If the currently active histogram is not the one you want to use, you must use IpHstSelect to explicitly select (make active) the appropriate window before calling IpHstMove.
See Also	IpHstRestore, IpHstMaximize, IpHstMinimize, IpHstSelect


IpHstRestore

Syntax	IpHstRestore( )
Description	This function returns the active histogram window to its previous screen position and size.  Equivalent to clicking the Restore button on a maximized histogram window, or double-clicking the icon of a minimized histogram window.
Comments	Note that this function operates upon the "active" histogram window (i.e., the one most recently opened or selected).  If the currently active histogram is not the one you want to use, you must use IpHstSelect to explicitly select (make active) the appropriate window before calling IpHstRestore.
See Also	IpHstMinimize,  IpHstMaximize


IpHstSave

Syntax	IpHstSave(FileName, SaveMode)
Description	This function saves, or appends, the active histogram data or statistics to the specified file.  Equivalent to the Save Histogram, Append Histogram, Save Statistics, and Append Statistics commands on the File menu in the Histogram command window.
Parameters	FileName	String	A string specifying the name of the file to which the histogram data will be written.   This parameter is ignored when data is stored to the Clipboard.  When this is the case, set Filename to an empty string (i.e., "").
	SaveMode	Integer	An enumerated integer, or an expression involving the addition of two or more enumerated integers, specifying the type of data to be stored and the place to which it is to be stored.  Must contain one or more of the following: S_DATA     or    S_STATS S_APPEND     or    S_CLIPBOARD S_HEADER S_LEGEND S_X_AXIS
			See Comments, below, for a definition of each name.  See Example below for usage.
Example	ret = IpHstSave("C:\APPNAME\HISTO.HST", S_DATA) This statement will save the current histogram data to a file called HISTO.HST in the \APPNAME directory on the C: drive.  If the file already exists, it will be overwritten. ret = IpHstSave("C:\APPNAME\HISTO.HST", S_STATS+S_APPEND) This statement will append the current histogram statistics to a file called HISTO.HST in the \APPNAME directory on the C: drive.
	ret = IpHstSave("C:\APPNAME\HISTO.HST", S_DATA+S_HEADER+S_LEGEND) This statement will save the current histogram data to a file called HISTO.HST in the \APPNAME directory on the C: drive.   The header and legend information will be stored with the data.  If the file HISTO.HST already exists, it will be overwritten. ret = IpHstSave("", S_CLIPBOARD) This statement will save the current histogram data to the Clipboard (the function defaults to S_DATA).  Note that the FileName parameter specifies a zero-length string. ret = IpHstSave("C:\APPNAME\HISTO.HST",S_APPEND+S_DATA+S_X_AXIS) This statement will append the current histogram data to a file called HISTO.HST in the \APPNAME directory on the C: drive.  The X-axis data will be stored with the statistics.
Comments	Note that this function operates upon the "active" histogram window (i.e., the one most recently opened or selected).  If the currently active histogram is not the one you want to use, you must use IpHstSelect to explicitly select (make active) the appropriate window before calling IpHstSave. The following options can be used in the expression comprising the SaveMode parameter.
USAGE	Save Mode	DESCRIPTION
Use one or none...	S_DATA	Specifies that histogram data is to be stored.
	S_STATS	Specifies that histogram statistics are to be stored.
		Note - if neither S_DATA nor S_STATS is included in the expression, S_DATA is assumed.
Use one or none...	S_APPEND	Specifies that the data/statistics are to be appended to the specified file.
	S_CLIPBOARD	Specifies that the data/statistics are to be saved to the Clipboard.  When this option is used, the FileName parameter is ignored.
		Note - if neither S_APPEND nor S_CLIPBOARD is included in the expression, histogram data/statistics are saved to a new file (if the file already exists, it will be overwritten).
Use any, all or none...	S_HEADER	Specifies that the header is to be stored along with the data/statistics.
	S_LEGEND	Specifies that the legend is to be stored along with the data/statistics.
	S_X_AXIS	Specifies that the X-axis information is to be stored along with the data/statistics.
See Also	IpHstSelect


IpHstScale

Syntax	IpHstScale(bVert, bAuto, From, End)
Description	This function scales the X and Y axes of the active histogram to the specified points.  Equivalent to the Scaling command in the Histogram window.
Parameters	bVert	Integer	An integer value of 0 or 1 that determines whether the X- or Y-axis is to be scaled by this function.  Where:   0 - Specifies the X-axis. 1 - Specifies the Y-axis.
	bAuto	Integer	An integer value of 0 or 1 that determines whether the selected axis should be automatically scaled to encompass the minimum and maximum values in its range.  Where:   0 - Disables automatic scaling (scales the axis to the specified From and End values) 1 - Enables automatic scaling (scales the axis to minimum and maximum values)
	From	Float	A number (of IPBASIC type, Single) specifying the beginning of the axis.  This value is ignored if bAuto is set to 1.  When this is the case, set From to 0.
	End	Float	A number (of IPBASIC type, Single) specifying the end of the axis.  This value is ignored if bAuto is set to 1.  When this is the case, set End to 0.
Example	ret = IpHstScale(1, 0, 0.0, 1000.0) This statement will scale the Y-axis of the histogram from 0 to 1000.
Comments	Note that this function operates upon the "active" histogram window (i.e., the one most recently opened or selected).  If the currently active histogram is not the one you want to use, you must use IpHstSelect to explicitly select (make active) the appropriate window before calling IpHstScale.
See Also	IpHstSelect


IpHstSelect

Syntax	IpHstSelect(HstId)
Description	This function activates the specified histogram window.  It selects the histogram upon which all subsequent histogram functions will operate.  Equivalent to clicking the Histogram window to activate it.
Parameters	HstId	Integer	An integer specifying the ID of the histogram that is to be selected.  See comments, below, for more information about this number.
Example	ret = IpHstSelect(0)  This statement makes histogram window "0" the active histogram.
Comments	A histogram "ID" (HstId) is assigned to a histogram window when it is created.  The window retains this ID for the duration of its existence.  A histogram window is given the lowest unused ID number available at the time it is created.  If a histogram window is opened while no other histograms are open, it is assigned an ID of "0".   If another histogram is created while "0" is open, the new histogram will be assigned an ID of "1".  If "0" is closed, and another histogram is opened (while "1" is still open), the new window will get an ID of "0", since it is the lowest, unused ID available.


IpHstSetAttr

Syntax	IpHstSetAttr(AttrType, AttrValue)
Description	This function selects, sets or deselects options relating to the Histogram window.
Parameters	AttrType	Integer	An enumerated integer specifying the option to be set.  Must be one of the following: ACCUMULATE BIN CHANNEL1 CHANNEL2 CHANNEL3 COLORMODEL GRID ICAL LINETYPE SCAL STATISTICS See definitions under Comments, below.
	AttrValue	Integer	An integer specifying how the AttrType option is to be set.  See definitions under Comments, below, for the values allowed by each option.
Example	ret = IpHstSetAttr(BIN, 100) This statement will set the number of bins in the histogram to 100.
Comments	AttrType options are as follows:
AttrType	DESCRIPTION	ALLOWED VALUES
ACCUMULATE	Determines whether the	0  -  Normal Form
	histogram is displayed in	1  -  Accumulated form
	normal or cumulative
	form.  Equivalent to
	selecting Accumulate
	in the Histogram
	window Report menu.
BIN	Specifies the number of	An integer specifying
	bins into which the histo-	the number of bins.
	gram is to be divided.
	Equivalent to setting the
	Bins value in the
	Histogram window's
	Report menu.
CHANNEL1	Enables or disables the	0  -  Disables Channel.
	histogram of the Red, Hue	1  - Enables Channel.
	or Y channel, depending upon the color model.
CHANNEL2	Enables or disables the	0  -  Disables Channel.
	histogram of the Green,	1  - Enables Channel.
	Saturation or In-Phase channel, depending upon the color model selected.
CHANNEL3	Enables or disables the	0  -  Disables Channel.
	histogram of the Blue,	1  - Enables Channel.
	Intensity, Value or Quadrature channel, depending upon the color model selected.
COLORMODEL	Selects the color model	CM_RGB
	in which the histogram	CM_HSI
	is to be displayed.	CM_HSV
	Equivalent to selecting	CM_YIQ
	color model in the
	Histogram window's
	Color menu.
GRID	Determines whether the	0  -  Selects Graph form.
	histogram is displayed in	1  -  Se130lects Table form.
	table or graph form.
	Equivalent to setting the
	Table option in the
	Histogram window's
	Report menu.
ICAL	Specifies whether the	0  -  Disables Calibration.
	intensity calibration is to be	1  -  Enables Calibration.
	applied to the histogram.
	Equivalent to setting the
	Intensity Cal option in
	the Histogram window
	Report menu.
LINETYPE	Determines whether the	0  -  Selects Line form.
	histogram is to be shown	1  -  Selects Bar form.
	in bar or line form.
	Equivalent to setting the
	Bar or Line option in
	the Histogram window
	Report menu.
SCAL	Specifies whether the	0  -  Disables Calibration.
	spatial calibration is to be	1  -  Enables Calibration.
	applied to the histogram.
	Equivalent to setting the
	Spatial Cal option in
	the Histogram window
	Report menu.
STATISTICS	Specifies whether statistics or range information is to be displayed in the histo-	0  -  Suppresses display  of statistics and  range information.
	gram window.  Equivalent	1  -  Displays Statistics.
	to setting the Statistics	2  -  Displays Range Info.
	or Range/Area option
	in the Histogram
	window's Report menu.
	Note that this function operates upon the "active" histogram window (i.e., the one most recently opened or selected).  If the currently active histogram is not the one you want to use, you must use IpHstSelect to explicitly select (make active) the appropriate window before calling IpHstSetAttr.


IpHstSize

Syntax	IpHstSize(cx, cy)
Description	This function changes the size of the active histogram window to the specified width and height.  Equivalent to resizing Histogram window with the mouse.
Parameters	cx	Integer	An integer specifying the width, in pixels, at which the Histogram window is to be displayed.
	cy	Integer	An integer specifying the height, in pixels, at which the Histogram window is to be displayed.
Example	ret = IpHstSize(400, 175) This statement will resize the Histogram window to dimensions of 400 pixels wide by 175 pixels tall.
Comments	Note that this function operates upon the "active" histogram window (i.e., the one most recently opened or selected).  If the currently active histogram is not the one you want to use, you must use IpHstSelect to explicitly select (make active) the appropriate window before calling IpHstSize.
See Also	IpHstMove,  IpHstMinimize,  IpHstMaximize,  IpHstRestore,  IpHstSelect


IpHstUpdate

Syntax	IpHstUpdate( )
Description	This function updates the data within the active histogram window.  Equivalent to selecting the Update command within the Histogram window.
Comments	Note that this function operates upon the "active" histogram window (i.e., the one most recently opened or selected).  If the currently active histogram is not the one you want to use, you must use IpHstSelect to explicitly select (make active) the appropriate window before calling IpHstUpdate.
See Also	IpHstSelect


IpICalCreate

Syntax	IpICalCreate( )
Description	This function creates a new intensity calibration set.  Equivalent to clicking New in the Intensity Calibration dialog box.
See Also	IpICalSelect,  IpICalDestroy


IpICalDestroy

Syntax	IpICalDestroy( )
Description	This function deletes the current intensity calibration set.  Equivalent to clicking Delete in the Intensity Calibration dialog box.
See Also	IpICalCreate,  IpICalSelect


IpICalLinearize

Syntax	IpICalLinearize(bNewImage, bInvert, bScale)
Description	This function uses the current intensity calibration, if any, to transform the pixel values of the active image into calibrated values.  This is particularly useful for combining images that have non-linear calibrations (e.g., Optical Density calibration).  Equivalent to the Linearize Image and Linearize New commands.
Parameters	bNewImage	Integer	A value of 0 or 1, specifying whether the linearization is to be applied directly to the current image ("Linearize Image") or is to be written to a new, linear, floating-point image ("Linearize New").  Where: 0  -  Performs the transformation based upon the range allowed by the current document's class (result written to current window).  Equivalent to the "Linearize Image" command, 1  - Performs the transformation based upon a floating-point scale (result written to a new, Floating Point window).  The range of the floating-point scale is determined by bScale.  Equivalent to the "Linearize New" command.
	bInvert	Integer	A value of 0 or 1, specifying whether the pixel values are to be inverted during transformation.  Where: 0  -  Does not invert the pixel values. 1  - Inverts the pixel values so that dark becomes bright, and bright becomes dark. This option can be used to keep an image with a non-linear, decreasing calibration (e.g., Optical Density) from being visually inverted when it is linearized.  Regardless of whether bInvert is used, a calibrated analysis of the image will yield the same results.
	bScale	Integer	A value of 0 or 1, specifying whether the range of a floating-point transformation is determined by the image's class.  Where: 0  -  The range is determined by the minimum/maximum calibrated values in the image (i.e., the calibrated values become the pixel values). 1  - The range is determined by the original image's class (0 - 255 for Gray Scale, 0 - 4095 for Gray Scale 12).  A linear calibration is  attached to the image, which maps the calibrated values into that range.
			The bScale parameter is ignored when bNewImage is set to 1 (when this is the case, just set bScale to 0).  bScale is used only when an image is linearized to a new, Floating Point window.
Return Value	0 if successful.  A negative value, otherwise.
Example	The following example linearizes two images with similar optical density calibrations, before subtracting them (subtracting non-linearly calibrated images would not yield the correct result).
'select background image

ret = IpAppSelectDoc(0)

' linearize background image to new floating point image.

ret = IpICalLinearize(1, 0, 0)

'select foreground image

ret = IpAppSelectDoc(1)

' linearize foreground image to new floating point image.

ret = IpICalLinearize(1, 0, 0)

' perform subtraction of linearized images

ret = IpOpImageArithmetics(2, 0.0, OPA_SUB, 0)

Comments	After the transformation, the image will always have a linear calibration.  That is, one in which equal differences in pixel values generate equal differences in calibration unit. Ignoring round-off errors, the results of a calibrated histogram, line profile, or any other calibrated intensity analysis operation, is not changed by a linearization transformation.  Round-off errors will result during in-place transformations of  8 or 12 bit images (when data precision is paramount, always use a floating-point transformation — i.e., bNewImage = 1, bScale = 0).
See Also	IpICalCreate,  IpOpBkgndCorrect


IpICalMove

Syntax	IpICalMove(x, y)
Description	This function moves the Intensity Calibration dialog box to the specified screen position.  Equivalent to dragging the dialog box to a new position with the mouse.
Parameters	x	Integer	An integer specifying the x-coordinate of the screen position to which you want the upper-left corner of the Intensity Calibration window moved.
	y	Integer	An integer specifying the y-coordinate of the screen position to which you want the upper-left corner of the Intensity Calibration window moved.
Example	ret = IpICalMove(6, 26) This statement will move the Intensity Calibration window to screen position 6, 26 (near the upper-left corner of the screen).


IpICalReset

Syntax	IpICalReset( )
Description	This function resets the current calibration to default values.  Equivalent to clicking Defaults in the Intensity Calibration dialog box.


IpICalSelect

Syntax	IpICalSelect(szICal)
Description	This function selects a calibration set to attach to an image.  Equivalent to selecting a set in the Name field in the Intensity Calibration dialog box.
Parameters	szICal	String	A string specifying the name of the calibration set that is to be made active.
Example	ret = IpICalSelect("DNA Gel") This statement will activate an intensity calibration called "DNA Gel".
Comments	The activated calibration set becomes the calibration for the active image (if there is one), and all image windows opened thereafter.
See Also	IpICalCreate,  IpICalSetName,  IpICalDestroy


IpICalSetName

Syntax	IpICalSetName(szICal)
Description	This function changes the name of the current calibration set.  Equivalent to retyping the name in the Name field of the Intensity Calibration dialog box.
Parameters	szICal	String	A string specifying the new name of the selected calibration set.
Example	ret = IpICalSetName("DNA Density") This statement will change the name of the current calibration set to "DNA Density".


IpICalSetOptDens

Syntax	IpICalSetOptDens(BlackLevel, IncidentLevel)
Description	This function establishes the Black level and Incident level to be applied to the optical density curve.  Equivalent to completing the Optical Density Calibration dialog box.
Parameters	BlackLevel	Float	A number (of IPBASIC type, Single) specifying the value representing the pixel intensity of totally opaque material.
	IncidentLevel	Float	A number (of IPBASIC type, Single) specifying the value representing the pixel intensity of totally transparent material.
Example	ret = IpICalSetOptDens(23.0, 179.5) This statement will set the Black level to 23.0 and the Incident level to 179.5.


IpICalSetPoints

Syntax	IpICalSetPoints(ipICalPoints, NumPoints, fitmode)
Description	This function establishes the points defining a custom calibration curve.  Equivalent to completing the Freeform Intensity Calibration dialog box.
Parameters	ipICalPoints	Float (Basic) LPFLOAT (C)	The name and first element of an array containing the calibration points (of IPBASIC type, Single).  By default, this array is defined as ipICal.
	NumPoints	Integer	An integer specifying the number of point definitions (coordinate pairs) contained in the array ipICal.
	fitmode	Integer	An integer between 1 and 10 (inclusive) specifying the degree of fit to be applied to the custom curve.
Example	This set of statements will create the custom calibration curve from the points defined in ipICalPoints (i.e., the even-odd pairs of 0,50   100,150   170,220 and 255,300).  A degree-of-fit value of 4 will be applied when the curve is calculated.
ipICal(0) = 0

ipICal(1) = 50

ipICal(2) = 100

ipICal(3) = 150

ipICal(4) = 170

ipICal(5) = 220

ipICal(6) = 255

ipICal(7) = 300

IpICalSetPoints(ipICal(0), 4, 4)


IpICalSetSamples

Syntax	IpICalSetSamples(NumSamples)
Description	This function sets the number of samples to be used to define the X-axis of the calibration curve.  Equivalent to selecting a Number of Samples value in the Intensity Calibration dialog box.
Parameters	NumSamples	Integer	An integer specifying the number of samples comprising the X-axis.
Example	ret = IpICalSetSamples(100) This statement will set the number of samples to 100.


IpICalSetUnitName

Syntax	IpICalSetUnitName(UnitName)
Description	This function changes the name of the current intensity unit.  Equivalent to typing a name in the Unit Name field within the Intensity Calibration dialog box.
Parameters	UnitName	String	A string specifying the unit name.
Example	ret = IpICalSetUnitName("Degrees") This statement will set the intensity unit name to "Degrees".


IpICalShow

Syntax	IpICalShow(bShow)
Description	This function displays the Intensity Calibration dialog box.  It is also used to close the dialog box if it is open.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether to open or close the Intensity Calibration dialog box.  Where: 0  - Closes the Intensity Calibration dialog box if it is open. 1  - Opens the Intensity Calibration dialog box.
Example	ret = IpICalShow(1) This statement will display the Intensity Calibration dialog box.
Comments	The dialog box does not have to be opened before assigning and selecting calibration values.


IpICalShowFormat

Syntax	IpICalShowFormat(bOptDens)
Description	This function specifies whether the calibration is in freeform or Optical Density format.  Equivalent to selecting either the Freeform or Standard Optical Density radio button in the Intensity Calibration window.
Parameters	bOptDens	Integer	An integer value of 0 or 1 specifying the format of the calibration curve.  Where: 0  -  Specifies "Freeform" calibration. 1  -  Specifies "Standard Optical Density" calibration.
Example	ret = IpICalShowFormat(0) This statement specifies that the calibration curve is to be defined by the points contained in ipICal.
See Also	IpICalSetPoints,  IpICalSetOptDens


IpIniFile

Syntax	IpIniFile(ValType, ValName, lpValue)
Description	This function is used to read and write user-defined settings from/to the IPMACRO.INI file.  There is no  command equivalent to this function; it is one that must be manually written with the macro editor.
Parameters	ValType	Integer	An enumerated integer that specifies whether the setting is to be read or written to the IPMACRO.INI file, and identifies the setting's data type.  Must be one of the following. GETINT GETFLOAT GETString SETINT SETFLOAT SETString See definitions under Comments, below.
	ValName	String	A string specifying the name of the variable to be read or written.
	lpValue	See below	The address (name) of the variable that will receive the requested data when ValType is set to read (get).  Or, the address (name) of the variable that holds the setting when ValType is set to write (set).  Be sure this variable is one that is compatible with the type of data written or returned by the command you have specified in ValType.  See ValType description under Comments, below.
Return Value	0 if successful.  Negative if the specified variable (to be read) cannot be found in the file.
Example	The following example reads three settings from the IPMACRO.INI file, and writes them to variables named var1, var2 and var3.
Dim var1 as integer

Dim var2 as single

Dim var3 as String * 255

.

.

.

ret = IpIniFile(GETINT, "MyInteger", var1)

ret = IpIniFile(GETFLOAT, "MySingle", var2)

ret = IpIniFile(GETString, "MyString", var3)

The following example writes values of the three variables, var1, var2 and var3, as settings in the IPMACRO.INI file.

Dim var1 as integer

Dim var2 as single

Dim var3 as string

var1 = 123

var2 = 1.234

var3 = "c:\AppName\images\spots.tif"

ret = IpIniFile(SETINT, "MyInteger", var1)

ret = IpIniFile(SETFLOAT, "MySingle", var2)

ret = IpIniFile(SETString, "MyString", var3)

.

.

.

Comments	Variables are written in an ASCII file called IPMACRO.INI.  Each variable generates an assignment line consisting of the setting's name, an "=" symbol and the setting's value.  The example above would generate the following lines in the IPMACRO.INI file: MyInteger=123 MySingle=1.234 MyString=c:\AppName\images\spots.tif ValType options are as follows:
ValType	DESCRIPTION
GETINT	This command reads an integer value from ValName in the IPMACRO.INI file.  The integer is written to the variable you have specified in lpVal.  Be sure this variable is of BASIC type, Integer (C, LPSHORT).
GETFLOAT	This command reads a floating-point value from ValName in the IPMACRO.INI file.  This number is written to the variable you have specified in lpVal.  Be sure this variable is of BASIC type, Single (C, LPFLOAT).
GETString	This command reads a string value from ValName in the IPMACRO.INI file.  This string is written to a fixed-length string variable you have specified in lpVal.  Be sure this variable is a of BASIC type, String (C, LPSTR). Important - be sure the length of your fixed-length string is large enough to accommodate the returned string.
SETINT	This command writes an integer value to ValName in the IPMACRO.INI file.  The integer value is obtained from the contents of the variable you have specified in lpVal.  Be sure this variable is of BASIC type, Integer (C, LPSHORT).
SETFLOAT	This command writes a floating-point value to ValName in the IPMACRO.INI file.  The floating-point number is obtained from the contents of the variable you have specified in lpVal.  Be sure this variable is of BASIC type, Single (C, LPFLOAT).
SETString	This command writes a string to ValName in the IPMACRO.INI file.  The string is obtained from the contents of the variable specified in lpVal.  Be sure this variable is of BASIC type, String (C, LPSTR).
See Also	GetPrivateProfileInt,  WritePrivateProfileString  (these are Windows functions).


IpListPts / IpMorePts

Syntax	IpListPts(Points, ListString) IpMorePts(ListString)
Description	These functions are used to fill an array of points from a string that defines a list of pixel coordinates.  IpMorePts is used after IpListPts if more than a single image line is needed.  There are no commands equivalent to these function; they are ones that must be manually written with the macro editor.
Parameters	Points	POINTAPI	The address (name) of the array of point coordinates (BASIC type, POINTAPI) that will be filled from the string specified in ListString.
	ListString	String	A string containing a list of the point coordinates.  See Comments, below, for more about the structure of this list.
Return Value	IpListPts returns the number of points found in ListString.   IpMorePts returns the total number of points found in all the strings since, and including, the last IpListPts call.
Example	In the following example IpListPts and IpMorePts are used to create an array defining the outline of a freeform AOI.  Contrast this method with the other way of setting POINTAPI elements using individual assignment statements (also shown below).
' The new way:

Dim AoiPts(10) as POINTAPI

Dim numPts as integer

numPts=IpListPts(AoiPts(0),"101 147 150 121 193 145 193 198 ")

numPts=IpMorePts("153 221 153 222 153 221 124 216 ")

numPts=IpMorePts("105 205 90 180")

ret=IpAoiCreateIrregular(AoiPts(0), numPts)

' The old way:

Dim AoiPts(10) as POINTAPI

AoiPts(0).x = 101

AoiPts(0).y = 147

AoiPts(1).x = 150

AoiPts(1).y = 121

AoiPts(2).x = 193

AoiPts(2).y = 145

AoiPts(3).x = 193

AoiPts(3).y = 198

AoiPts(4).x = 153

AoiPts(4).y = 221

AoiPts(5).x = 153

AoiPts(5).y = 222

AoiPts(6).x = 153

AoiPts(6).y = 221

AoiPts(7).x = 124

AoiPts(7).y = 216

AoiPts(8).x = 105

AoiPts(8).y = 205

AoiPts(9).x = 90

AoiPts(9).y = 180

ret = IpAoiCreateIrregular(AoiPts(0), 10)

Comments	ListString must specify a list of coordinates, separated by spaces, where the first number is the horizontal position of the first point, the second number is the vertical position of the first point, and so on.  The example below illustrates how three points — 10,16  150,120  70,200 — would be defined as a string: "10 16 150 120 70 200" Because a point is made up of two coordinates (X and Y), there must be an even number of items in the string (i.e., the number of points read from ListString will be half the number of items in the string). IpMorePts cannot be called alone.  It has to follow a call to IpListPts or IpMorePts.   When passing an array to this program  from a BASIC program, be sure to pass the first element of the array by reference (See IpListPts statement in example, above).


IpLutApply

Syntax	IpLutApply( )
Description	This function makes permanent the current Brightness, Contrast and Gamma adjustments.  Equivalent to selecting Apply LUTs on the Image menu or clicking the Apply button on the Ribbon.
Comments	This function clears the Lookup Table (LUT).  If you want to save the LUT, you must do so before you perform this function.
See Also	IpLutReset, IpLutSave


IpLutBinarize

Syntax	IpLutBinarize(MinRange, MaxRange, WhiteOnBlack)
Description	This function reduces your image or AOI to two colors: black and white.  Equivalent to selecting the Threshold command.
Parameters	MinRange	Integer	An integer from 0 - 255 specifying the lowest value in the range to be highlighted.
	MaxRange	Integer	An integer from 0 - 255 specifying the highest value in the range to be highlighted.
	WhiteOnBlack	Integer	An integer value of 0 or 1 specifying whether pixels within the range are to be set to White or Black.  Where:
			0 - Sets the range to Black.  Equivalent to the "Black on White" option in the "Binarize" dialog box. 1 - Sets the range to White.  Equivalent to the "White on Black" option in the "Binarize" dialog box.
Example	ret = IpLutBinarize(100, 255, 1)  This statement will set pixels with values between 100 and 255 (inclusive) to white;  all other pixels will be set to black.
Comments	If your image is True Color or Palette, the luminance channel will be used for the conversion. In 12-bit and floating-point images, the normalized equivalents to the MaxRange and MinRange values will be used. This function maintains the pixel depth (BPP) of the original image.


IpLutLoad

Syntax	IpLutLoad(FileName)
Description	This function loads intensity and color adjustments that have been saved.  Equivalent to selecting Load LUT from the LUT command on the File menu.
Parameters	FileName	String	A string specifying the name of the file from which the LUT values will be read.
Example	ret = IpLutLoad("C:\APPNAME\HPLJ.LUT") This statement will recall the lookup table settings from the file HPLJ.LUT in the \APPNAME directory on the C: drive.
See Also	IpLutSave


IpLutReset

Syntax	IpLutReset(Channel, Type)
Description	This function resets any BCG and/or advanced control modifications you have made but not yet applied to your image.   Equivalent to Reset LUTs on the Image menu (however, it offers more functionality than this command).
Parameters	Channel	Integer	An integer from 0 to 4 specifying the channel to be reset.  Where: 0 - Luminance 1 - Red 2 - Green 3 - Blue 4 - All 4 Channels
	Type	Integer	An enumerated integer specifying the property to be reset in the specified channel.  Must be one of the following: LUT_HISHAD LUT_BRIGHTNESS LUT_CONTRAST LUT_GAMMA LUT_4TONES LUT_8TONES LUT_FREEFORM LUT_ALL See definitions under Comments, below.
Example	ret = IpLutReset(4, LUT_ALL)  This statement will reset the LUT for all properties of all channels. ret = IpLutReset(0, LUT_8TONES)  This statement will reset the LUT for the luminance channel of the 1/8-tone curve.
Comments	Selecting the Reset LUTs command always records an IpLutReset(4,LUT_ALL) statement, however, once recorded, this statement can be modified to reset only a single channel and/or property.  The following table describes the values allowed in the Type parameter.
Type	DESCRIPTION
LUT_HISHAD	Resets the Highlight and Shadow controls for the specified channel.
LUT_BRIGHTNESS	Resets the Brightness control for the specified channel.
LUT_CONTRAST	Resets the Contrast control for the specified channel.
LUT_GAMMA	Resets the Gamma control for the specified channel.
LUT_4TONES	Resets the 1/4-tone curve for the specified channel.
LUT_8TONES	Resets the 1/8-tone curve for the specified channel.
LUT_FREEFORM	Resets the Composite curve for the specified channel.
LUT_ALL	Resets all controls for the specified channel.
See Also	IpLutApply,  IpLutSave


IpLutSave

Syntax	IpLutSave(FileName, Description)
Description	This function saves the Lookup Table (LUT) settings.  Equivalent to selecting Save LUT from the LUT command.
Parameters	FileName	String	A string specifying the name of the file to which the LUT values are to be written.
	Description	String	A string containing information describing the file.
Example	ret = IpLutSave("C:\APPNAME\FILENAME.LUT", "For Scanned Images") This statement will create a new Lookup Table file called FILENAME.LUT in the \APPNAME directory on the C: drive.
See Also	IpLutApply,  IpLutLoad


IpLutSetAttr

Syntax	IpLutSetAttr(AttrType, AttrValue)
Description	This function selects, deselects or sets a Lookup Table (LUT) attribute.  Equivalent to adjusting the LUT using the BCG controls or the Show Map command.
Parameters	AttrType	Integer	An enumerated integer specifying the attribute type to be set.  Must be one of the following: LUT_BRIGHTNESS LUT_CONTRAST LUT_GAMMA COLORMODEL CHANNEL CURVE GRID UNIT See definitions under Comments, below.
	AttrValue	Integer	An integer value specifying the setting for the attribute.  See Comments, below, for the allowed settings for each AttrType.
Example	ret = IpLutSetAttr(CHANNEL, 2) ret = IpLutSetAttr(LUT_BRIGHTNESS, 78) The statements above select the Green channel and adjust its BRIGHTNESS to a value of 78. ret = IpLutSetAttr(LUT_4TONES, 4) This statement selects the 1/4 Tone response curve on the "Color Map" window.
Comments	The following table describes the values allowed in the AttrType parameter.
AttrType	DESCRIPTION	ALLOWED VALUES
LUT_BRIGHTNESS	Adjusts the Brightness value of the selected channel by the specified amount.	0 - 100
LUT_CONTRAST	Adjusts the Contrast value of the selected channel by the specified amount.	0 - 90 -1 inverts the lookup table -2 inverts the image data
LUT_GAMMA	Adjusts the Gamma value of the selected channel by the specified amount.	10 - 970
CURVE	Selects a curve of the type	3  - Selects Hilight/ Shadow
	specified by AttrValue.	4  - Selects 1/4 Tone Curve
		5  - Selects 1/8 Tone Curve
		6  - Selects Composite Curve
COLORMODEL	Selects the Color Model.	0  - Selects RGB
		1  - Selects CMY
CHANNEL	Selects the active Channel.	0  - Luminance
		1  - Red or Cyan
		2  - Green or Magenta
		3  - Blue or Magenta
GRID	Selects whether or not to	0  - Suppresses the grid
	display the Grid.	1  - Displays the grid
UNIT	Selects the Unit type.	0  - pixel
		1  - percent
See Also	IpLutSetControl


IpLutSetControl

Syntax	IpLutSetControl(ControlType, ipLutControls, Count)
Description	This function sets the values associated with the specified LUT curves.  Equivalent to modifying the intensity curve in the Color Map dialog box.
Parameters	ControlType	Integer (Basic) LPSHORT (C)	An enumerated integer specifying the kind of control to be activated.  Must be one of the following: LUT_HISHAD LUT_4TONES LUT_8TONES LUT_FREEFORM See definitions under Comments, below.
	ipLutControls	Integer	The name and first element of an array containing the integer values to which the controls are to be set.  By default this array is defined as Lut.
	Count	Integer	An integer specifying the number of elements to be used in the Lut array.
Comments	The value of Count is dependent on the value of ControlType, as follows:
ControlType	Count
LUT_HISHAD	2
LUT_4TONES	5
LUT_8TONES	9
LUT_FREEFORM	256
Example	These statements set the 1/4-tone control points to 0, 100, 169, 231 and 255.
Lut(0) = 0

Lut(1) = 100

Lut(2) = 169

Lut(3) = 231

Lut(4) = 255

ret = IpLutSetControl(LUT_4TONES, Lut(0), 5)

See Also	IpLutSetAttr


IpLutShow

Syntax	IpLutShow(Show)
Description	This function is used to open or close the Color Map window.  Equivalent to selecting the Show Map command to open the window, and double-clicking its control box to close it.
Parameters	Show	Integer	An integer value of 0 or 1 specifying whether the "Color Map" window is to be shown.  Where: 0  - Closes the window if it is already open. 1  - Opens the window.
Example	ret = IpLutShow(1)  This statement will open the Color Map window if it is not already open; if already open, it has no effect.
Comments	The Color Map window does not have to be open during execution of any LUT function.  Its disposition, visible or hidden, is entirely your choice.  You will want to display the window if your users will be required to make choices within it, but if your objective is simply to adjust the LUT values, you may want to run without opening it.


IpMacroLoad

Syntax	IpMacroLoad(scriptFile)
Description	This function loads the specified script file and makes it the active script file.  Equivalent to the Change and Reload buttons in the Macro dialog box.
Parameters	scriptFile	String	A string specifying the name of the script file that is to be loaded.  If a zero-length string is specified (i.e., ""), the current script file is assumed.
Example	ret = IpMacroLoad("C:\APPNAME\SLIDEPRC.SCR") This statement will load the SLIDEPRC.SCR script file from \APPNAME on the C: drive. ret = IpMacroLoad("") This statement will refresh the active script file with the current contents of its disk file.
Comments	Once a script file is loaded, it becomes the current script file.
See Also	IpMacroRun


IpMacroRun

Syntax	IpMacroRun(MacroName, scriptFile)
Description	This function loads and executes the specified macro from the specified script file.  It can be used to transfer control to another script file in an Auto-Pro macro.  It can also be used to execute a macro from a Visual BASIC or Visual C++ program.
Parameters	MacroName	String	A string specifying the name of the macro to be run.
	scriptFile	String	A string specifying the name of the script file containing the macro.  If a zero-length string is specified (i.e., ""), the current script file is assumed.
Example	ret = IpMacroRun("PREP1","C:\APPNAME\UTILTIIES.SCR") This statement will execute the macro "PREP1" in the "UTILITIES.SCR" script file.
Comments	When this function is used in an Auto-Pro macro, it differs from the IPBASIC Call statement in two important ways: 1. It can be used to execute a macro that does not reside in the current script file. 2. It does not return to the calling macro after execution of the specified macro.  In this respect, it behaves like a "GoTo" operation instead of a "Call" operation.   In a Visual Basic or Visual C++ program, this function must be used to invoke a macro that is defined in this program  (i.e., one whose statements have not been ported into the Visual Basic or Visual C++ environment).
See Also	Call,  IpMacroLoad


IpMacroStop

Syntax	IpMacroStop(Message, Mode)
Description	This function stops the macro, displays a message in a dialog box and waits for the user to click one of the dialog's buttons before continuing.  This function can be written into your macro using the macro editor, or it can be inserted while the macro is being recorded, using the Stop/Message command.
Parameters	Message	String	A string specifying the message that is to be displayed in the message box.
	Mode	Integer	An expression specifying the dialog box's mode (modal or modeless) and button configuration.  Where: 0 -  Issues a "modeless" message box. MS_MODAL -  Issues a "modal" message box. When an MS_MODAL dialog is used, the following flags can also be set:
			MS_YESNO MS_OKCAN MS_YESNOCAN MS_STOP MS_EXCLAM MS_QUEST MS_DEF2 MS_DEF3 See Comments, below, for definitions.
Example	The following example will issue a message box containing the message "Error: Could Not Find Image".  The application  will be disabled until the Continue button is clicked.  Then, control will be transferred to the line labeled ErrExit:
If count%= 0 Then

ret = IpMacroStop("Error: No Objects Found", MS_MODAL)

GoTo ErrExit

End If

The following example issues a modal message box configured with "Yes" and "No" buttons.  If the user clicks "Yes", the filter statement will be executed, otherwise it will be skipped.

ret=IpMacroStop("Filter Image?",MS_MODAL+MS_YESNO+ MS_QUEST)

if ret=1 then

ret=IpFltSobel()

End If

The set of statements below will issue a "modeless" message box, allowing the user to move their AOI before continuing to the next step.

ret=IpAoiCreateBox(ipRect)

ret=IpMacroStop("Move Box to Required Location",0)

ret=IpFltSobel

Comments	The Mode parameter determines the status of the application  while the message box is active, where: 0 -  specifies that the application is to remain active, and accessible to the user, while the message box is displayed.  This mode can be used to instruct the user to make or modify certain selections during playback.   MS_MODAL -  specifies that the application e is to remain inactive, and inaccessible to the user, while the message box is displayed.  This mode can be used to issue an error message, or convey other "read-only" type information to your user.  It can also be combined with the following flags to equip the message box with special buttons and symbols.
FLAG	DESCRIPTION
MS_YESNO	Displays a "Yes" and a "No" button in the message box.  Returns a 0 when the user clicks "No"; 1 when the user clicks "Yes."
MS_OKCAN.	Displays an OK and a Cancel button in the message box.    Returns a 1 when the user clicks OK; 2 when the user clicks "Cancel."
MS_YESNOCAN	Displays a "Yes," a "No" and a Cancel button in the message box.  Returns a 0 when the user clicks "No"; 1 when the user clicks "Yes"; 2 when the user clicks "Cancel."
MS_STOP	Displays a red stop sign symbol in the message box.  Cannot be used concurrently with MS_EXCLAM or MS_QUEST (i.e., only one symbol is allowed per message).
MS_EXCLAM	Displays an exclamation symbol in the message box.  Cannot be used concurrently with MS_STOP or MS_QUEST (i.e., only one symbol is allowed per message).
MS_QUEST	Displays a question mark symbol in the message box.  Cannot be used concurrently with MS_EXCLAM or MS_STOP (i.e., only one symbol is allowed per message).
MS_DEF2	Defaults to the second button from the left when the user presses The Enter key.  If not used, the first button is the default.
MS_DEF3	Defaults to the third button from the left when user presses the Enter key.  If not used, the first button is the default.
See Also	IpTemplateMode


IpMacroWait

Syntax	IpMacroWait(delay)
Description	This function pauses the macro for a specified duration.  You might insert this command to "slow down" a particular step so that its results can be easily observed on the screen.  Or, you might use it to allow sufficient time for an external event to occur (e.g., await a result from an external application).  This function can be written into your macro using the macro editor, or it can be inserted while the macro is being recorded, using the Delay command.
Parameters	delay	Integer	An integer that specifies the length of the delay, in tenths (i.e., 1/10) of a second.
Example	The statement below stops the macro for 5 seconds. ret = IpMacroWait(50)
Comments	The application is disabled while the macro is stopped.
See Also	IpMacroStop


IpMail

Syntax	IpMail (IpTo, IpCC, IpSubuct, IpMessage, IpAttachment)
Description	This function enables you to compose and send Internet mail.
Parameters	IpTo	String	Name of the recipient. At least one to recipent must be specified.
	IpCC	String	Name of the recipient getting carbon copy.
	IpSubject	String	Specifies the text for the subject line. A subject must be specified.
	IpMessage	String	Specifies the text for the message, or a valid file name. If a file name is used, the text from the file will be inserted in the message line. Some amount of message text must be specified.
	IpAttachment	String	Specifies an image, a valid file name, or a null string ( ). If lpAttachment specifies image, there is an active image open, and if the image has been saved to disk, then the image is used as the message attachment. If lpAttachment specifies a valid file name, then the specified file is used as the message attachment. If lpAttachment specifies a null string, then the message will be sent with no attachment. Specification of image when none is open or when the active image has not been saved to disk, or specification of an invalid file name in lpAttachment will result in an error.
Return Value	1= success, 0 = failed. Return value should IPCERR_XXX where 0 = IPCERR_NONE. Actually, the macro will indeed return IPCERR values. Success will indeed be IPCERR_NONE, failure will be one of the others
Comments	In template mode, the supplied information will be filled in and the dialog displayed. When not in template mode, the message will be sent as specified.  With internet mail, it may not be possible to return an error if invalid addresses are provided.


IpMeasAttr

Syntax	IpMeasAttr(AttrType, AttrValue)
Description	This function selects, sets or deselects options relating to the Measurements window.
Parameters	AttrType	Integer	An enumerated integer specifying the option to be set.  Must be one of the following: MEAS_DISPCOLOR MEAS_LABELCOLOR MEAS_STATS MEAS_THICKMODE See definitions under Comments, below.
	AttrValue	Integer	An integer specifying how the option specified by AttrType is to be set.  See definitions under Comments, below, for the values allowed by each option.
Example	ret = IpMeasShow(1) ret = IpMeasAttr(THICKMODE, 1)  This pair of statements will open the Measurements window, then set the option to display the maximum value of a thickness measurement.
Comments	The Measurements command window must be open before this function is called. AttrType options are as follows:
AttrType	DESCRIPTION	ALLOWED VALUES
MEAS_DISPCOLOR	Selects the color to be used	0  -  Red
	to display the measure-	1  -  Green
	ment outlines in the image.	2  -  Blue
	Equivalent to selecting	3  -  Yellow
	the outline color in the	4  -  Cyan
	Measurement Options	5  -  Magenta
	dialog box.	6  -  White
		7  -  Black
MEAS_LABELCOLOR	Specifies the color to be	0  -  Red
	used to label the measure-	1  -  Green
	ments.  Equivalent  to	2  -  Blue
	selecting the label color	3  -  Yellow
	in the Measurement	4  -  Cyan
	Options dialog box.	5  -  Magenta
		6  -  White
		7  -  Black
MEAS_STATS	Specifies whether the data-	0  -  Displays Measurements
	sheet is to display measure-	1  -  Displays Statistics
	ments or statistics.
	Equivalent to setting the
	Measurements List or
	Statistics option on the
	Measurements window's
	View menu.
MEAS_THICKMODE	Selects the measurement	0  -  Minimum thickness
	result that is to be reported	1  -  Maximum thickness
	when a Thickness	2  -  Both thicknesses
	measurement is performed.
	Equivalent to selecting the
	Display Thickness option
	in the Measurement
	Options dialog box.
See Also	IpMeasShow


IpMeasDelete

Syntax	IpMeasDelete(Index)
Description	This function deletes the selected (tagged) measurements, or all measurements.   Equivalent to the Delete and Delete All  buttons in the Measurements window.
Parameters	Index	Integer	An enumerated integer specifying whether tagged measurements or all measurements are to be deleted.  Where: MEAS_TAG  - Deletes only selected records (i.e., ones tagged with IpMeasTag). MEAS_ALL  - Deletes all datasheet records.
Example	This set of statements will select, then delete, the first and third measurements listed in the Measurements datasheet.
ret = IpMeasTag(0,1)

ret = IpMeasTag(2,1)

ret = IpMeasDelete(MEAS_TAG)

The statement below will delete all measurements in the Measurements datasheet.

ret = IpMeasDelete(MEAS_ALL)

Comments	The Measurements command window must be open before this function is called.
See Also	IpMeasShow,  IpMeasTag


IpMeasGet

Syntax	IpMeasGet(Cmd, Param, OutVal)
Description	Use this function to get information relating to the Measurements tool associated with the  current image.  There is no  command equivalent to this function; it is one that must be manually written with the macro editor.
Parameters	Cmd	Integer	A command ID, which specifies the type of  information you want to retrieve.  Must be one of the following: GETNUMOBJ
			GETVALUES GETTYPE GETLABEL GETINDEX GETNUMPTS GETPOINTS GETSTATS See definitions under Comments, below
	Param	Integer	An integer specifying data with which Cmd will operate.  See definitions under Comments, below, for the values required by each command
	OutVal	See below	The address (name) of the variable that will receive the requested data.  Be sure this variable is of the type required by Cmd.  See Cmd description under Comments, below.
Return Value	All commands listed below return 0 if successful.  A negative value, otherwise.
Example	The following example transforms the area measurements into AOIs and XORs them.
Dim numpoints As Integer, numobj As Integer

Dim status As Integer, i As Integer

ret = IpMeasGet(GETNUMOBJ, 0, numobj)

For i = 0 To numobj - 1

ret = IpMeasGet(GETTYPE, i, status)

ret = IpMeasGet(GETNUMPTS, i, numpoints)

If status = MEAS_AREA Then

If numpoints > 0 Then

Redim blbpts(numpoints) As pointapi

ret = IpMeasGet(GETPOINTS, i, blbpts(0))

ret = IpAoiCreateIrregular(blbpts(0), numpoints)

ret = IpOpNumberLogic(0, OPL_NOT, 0)

End If

End If

Next i

Comments	Cmd options are as follows:.
Cmd VALUE	DESCRIPTION
GETNUMOBJ	This command gets the number of active measurements in the datasheet.  This number is written to OutVal.
		Param VALUE		OutVal TYPE
		Not used by GETNUMOBJ.  Must be set to 0.		BASIC, Integer C, LPSHORT
GETVALUES	This command gets the three values associated with a specific measurement in the datasheet.  These values are written to the 3-element array specified in OutVal.
		Param VALUE		OutVal TYPE
		The ID number of the measurement for which you want values, where the first measurement in the datasheet is measurement 0, the next measurement is 1, and so forth.		BASIC, Single C, LPFLOAT Note - OutVal must specify a 3-element array.
GETTYPE	This command is used to determine the type of a specified measurement.  OutVal is set to one of the following: MEAS_ANGLE MEAS_AREA MEAS_LENGTH MEAS_THICK MEAS_TRACE
		Param VALUE		OutVal TYPE
		The ID number of the measurement about which you are inquiring, where the first measurement in the datasheet is measurement 0, the next measurement is 1, and so forth.		BASIC, Integer C, LPSHORT
GETLABEL	This command is used to get the numeric portion of a measurement's label (the label is the number displayed with the measurement in the image and the datasheet; e.g., A1, L2, G3).  This number is written to OutVal.
		Param VALUE		OutVal TYPE
		The ID number of the measurement for which you want a label, where the first measurement in the datasheet is 0, the next measurement is 1, and so forth.		BASIC, Integer C, LPSHORT
GETINDEX	This command is used to get a measurement's ID number based upon its label number.  The ID is written to OutVal.
		Param VALUE		OutVal TYPE
		The label number of the measurement for which you want an ID.  The label number is the number displayed with the measurement in the image and the		BASIC, Integer C, LPSHORT
		datasheet; e.g., A1, L2, G3 (specify just theThe label number of the measurement for which you want an ID.  The label number is the number displayed with the  numeric portion of this label). Note - measurement labeling begins with 1, not 0.
GETNUMPTS	This command gets the number of points defining the outline of the specified measurement.  This value is written to OutVal.   For a MEAS_LENGTH measurement, OutVal will be 2. For a MEAS_ANGLE measurement, OutVal will be 4. For a MEAS_THICK measurement, OutVal will be 4 (points required to define the smallest and the longest lines between surfaces) For a MEAS_AREA or MEAS_TRACE measurement, OutVal will be 2 or more points.
		Param VALUE		OutVal TYPE
		The ID number of the measurement about which you are inquiring, where the first measurement in the datasheet is 0, the next measurement is 1, and so forth.		BASIC, Integer C, LPSHORT
GETPOINTS	This command gets the coordinates defining the outline of the measurement specified in Param.  These coordinates are written to the array specified by OutVal.  This array must be large enough to contain the number of points indicated by GETNUMPTS (see above).
		Param VALUE		OutVal TYPE
		The ID number of the measurement for which you want an outline, where the first measurement in the datasheet is 0, the next measurement is 1, and so forth.		BASIC, POINTAPI C,  LPPOINT Note - OutVal must be an array of GETNUMPTS elements.
GETSTATS	Use this command to get the statistical data associated with a measurement type (e.g., length, area, thickness).  The statistics are written to an 8-element array in OutVal, as follows: OutVal (0) -  Minimum value OutVal (1) -  ID of the measurement with the minimum value OutVal (2) -  Maximum value OutVal (3) -  ID of the measurement with the maximum value
	OutVal (4) -  Range of values OutVal (5) -  Mean value OutVal (6) -  Standard Deviation OutVal (7) -  Sum of Values OutVal (8) -  Number of measurements
		Param VALUE		OutVal TYPE
		An enumerated integer specifying the measurement type for which you want statistics.  Must be one of the following: MEAS_ANGLE MEAS_AREA MEAS_LENGTH MEAS_THICK MEAS_TRACE		BASIC , Single. C,  LPFLOAT Note - OutVal must specify an 8-element array.
When passing an array to the program  from a BASIC program, be sure to pass the first element of the array by reference (See IpMeasGet statement in example, above)

See Also	IpMeasShow,  IpMeasTool


IpMeasLoadOutline

Syntax	IpMeasLoadOutline(OutlineFile)
Description	This function loads an outline file into the active image.  Equivalent to the Load Outlines command located on the Measurements window's File menu.
Parameters	OutlineFile	String	A string specifying the name of the file from which the outlines are to be read.
Example	ret = IpMeasLoadOutline("C:\APPNAME\SLIDE1.OUT") This statement will load outlines from SLIDE1.OUT in the \APPNAME directory on the C: drive.
Comments	The Measurements command window must be open before this function is called. The file specified by OutlineFile must be a binary .OUT file, not an ASCII outline file.  See IpMeasSaveOutline.
See Also	IpMeasSaveOutline,  IpMeasShow


IpMeasMove

Syntax	IpMeasMove(x, y)
Description	This function moves the Measurements window to the specified location.     Equivalent to dragging the Measurements window with the mouse.
Parameters	x	Integer	An integer specifying the x-coordinate of the screen position to which the upper-left corner of the Measurements window is to be moved.
	y	Integer	An integer specifying the y-coordinate of the screen position to which the upper-left corner of the Measurements window is to be moved.
Example	ret = IpMeasMove(6, 26) This statement will move the Measurements window to screen position 6, 26, a position near the upper-left corner of the screen.
Comments	The origin ( 0, 0 ) for the coordinate system used by the x and y parameters is the upper-left corner of the screen.


IpMeasRestore

Syntax	IpMeasRestore( )
Description	This function returns the Measurements window to its previous screen position and size.  Equivalent to clicking the Restore button on a maximized Measurements window, or double-clicking the icon of a minimized Measurements Window.
See Also


IpMeasSaveData

Syntax	IpMeasSaveData(DataFile)
Description	This function saves the current measurement data to a file.  Equivalent to the Save Data command on the File menu in the Measurements command window.
Parameters	DataFile	String	A string specifying the name of the file to which the measurement data will be written.
Example	ret = IpMeasSaveData("C:\APPNAME\MEASDATA.TLS") This statement will save the current measurement data to a file called MEASDATA.TLS in the \APPNAME directory on the C: drive.
Comments	The Measurements command window must be open before this function is called.
See Also	IpMeasSaveOutline,  IpMeasShow


IpMeasSaveOutline

Syntax	IpMeasSaveOutline(OutlineFile)
Description	This function saves the current measured object outlines to a file.  Equivalent to the Save Outlines command on the File menuin the Measurements window.
Parameters	OutlineFile	String	A string specifying the name of the file to which the current measurement outlines will be written.  The file name's extension determines the format in which it is saved.  Where: .OUT  -  Specifies a binary outline file. Anything else specifies an ASCII-format outline file.
Example	ret = IpMeasSaveOutline("C:\APPNAME\MEASOUT.OUT") This statement will save the current outlines in binary format to the MEASOUT.OUT file in the \APPNAME directory on the C: drive.
Comments	The Measurements command window must be open before this function is called.
See Also	IpMeasLoadOutline, IpMeasShow


IpMeasShow

Syntax	IpMeasShow(bShow)
Description	This function is used to open or close the Measurements command window.  Equivalent to selecting the Measurements command to open the window, and clicking the Close button within it to close it.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether the Measurements command window is to be shown.  Where: 0  - Closes the window if it is already open. 1  - Opens the window.
Example	ret = IpMeasShow(1) This statement will make the Measurements command window visible during execution of the macro.
Comments	The Measurements command window must be open before any measurement functions are performed.


IpMeasSize

Syntax	IpMeasSize(cx, cy)
Description	This function changes the size of the Measurements window to the specified width and height.  Equivalent to resizing the Line Profile window with the mouse.
Parameters	cx	Integer	An integer specifying the width, in pixels, at which  the Measurements window is to be displayed.
	cy	Integer	An integer specifying the height, in pixels, at which the Measurements window is to be displayed.
Example	ret = IpMeasSize(400, 175) This statement will resize the Measurements window to dimensions of 400 pixels wide by 175 pixels tall.
See Also	IpMeasMove,  IpMeasRestore


IpMeasTag

Syntax	IpMeasTag(Index, OnOff)
Description	This function selects/deselects a measurement record.  Equivalent to clicking the measurement record in the Measurements datasheet.
Parameters	Index	Integer	An integer specifying the position of the record in the datasheet (where the first record occupies position 0), or MEAS_ALL, to specify all records in the datasheet.
	OnOff	Integer	An integer value of 0 or 1 specifying whether the record is to be selected or deselected.  Where: 0  -  Deselects 1  -  Selects
Example	ret = IpMeasTag(0, 1) ret = IpMeasTag(2, 1) The statements above will select the first and third measurement records in the Measurements datasheet. ret = IpMeasTag(MEAS_ALL, 0) This statement will deselect all measurement records in the Measurements datasheet.
Comments	This function is used to select individual measurements for deletion by the IpMeasDelete function.  It is also used to select the pair of measurements upon which a thickness measurement with IpMeasTool(MEAS_THICK) is performed.  The Measurements command window must be open before this function is called.
See Also	IpMeasDelete,  IpMeasTool,  IpMeasShow


IpMeasTool

Syntax	IpMeasTool(Tool)
Description	This function selects a measurement tool.  Equivalent to clicking one of the measurement tool buttons (e.g., Length, Area, Thickness) in the Measurements window.
Parameters	Tool	Integer	An enumerated integer specifying the tool to be selected.  Must be one of the following: MEAS_LENGTH MEAS_AREA MEAS_ANGLE MEAS_TRACE MEAS_THICK See definitions under Comments, below.
Example	The statements below will select the length tool, allow the user to make length measurements, then save the measurement data to a file called MEASDATA.TLS in the \APPNAME directory on the C: drive
ret = IpMeasTool(MEAS_LENGTH)

ret = IpMeasSaveData("C:\APPNAME\MEASDATA.TLS")

The following statements will select the first and third measurement records in the Measurements datasheet, then perform a thickness measurement upon the two.

ret = IpMeasTag(0, 1)

ret = IpMeasTag(2, 1)

ret = IpMeasTool(MEAS_THICK)

.

Comments	The Measurements command window must be open before this function is called. The allowed Tool values are as follows:
Tool	DESCRIPTION
MEAS_LENGTH	Selects the "Length" tool.  Equivalent to clicking the "Length" button in the Measurements window.  Regardless of whether template mode is on or off, this command will give control to the user.  Macro execution will resume when the user clicks OK, Cancel or the right mouse button.
MEAS_AREA	Selects the Area tool.  Equivalent to clicking the Area button in the Measurements window.  Regardless of whether template mode is on or off, this command will give control to the user.  Macro execution will resume when the user clicks OK, Cancel or the right mouse button.
MEAS_ANGLE	Selects the Angle tool.  Equivalent to clicking the Angle button in the Measurements window.  Regardless of whether template mode is on or off, this command will give control to the user.  Macro execution will resume when the user clicks OK,  Cancel or the right mouse button.
MEAS_TRACE	Selects the Trace tool.  Equivalent to clicking the Trace button in the Measurements window.  Regardless of whether template mode is on or off, this command will give control to the user.  Macro execution will resume when the user clicks OK, Cancel or the right mouse button.
MEAS_THICK	Selects the Thick tool.  Equivalent to clicking the Thick button in the Measurements window.   If template mode is off, this option will automatically measure the thickness between the first two tagged records in the datasheet.   If template mode is on, this command will give control to the user.  Macro execution will resume after the user selects two measurements.
See Also	IpMeasTag,  IpMeasShow


IpOpBkgndCorrect

Syntax	IpOpBkgndCorrect(WsBackId, BlackLevel, bNewImage)
Description	This function corrects for uneven background lighting in the active image.  Equivalent to the Background Correction option button in the Background Correction dialog box.
Parameters	WsBackId	Integer	An integer specifying the ID of the open image to be used as the background image.  See Comments, below, for more about this ID number.
	BlackLevel	Integer	An integer between 0 and 255 specifying the black level.
	bNewImage	Integer	An integer value of 0 or 1 specifying whether the transformed image is to be written to a new image window, or back into the active image window.  Where: 0  - Writes the transformed results to the active window. 1  - Writes the transformed results to a new image window.
Return Value	This function returns the Document ID of the resulting image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret =  IpOpBkgndCorrect(0, 50, 1) This statement will perform a background correction on the active window, using image 0 as the characteristic background image.  The corrected result will be written to a new window.  A value of 50 defines the black level.
Comments	Use this function when you want to correct the background of an image measuring optical density via transmitted light.  It is similar to IpOpBkgndSubtract but uses division instead of subtraction to account for the fact that optical density is not a linear function of the gray scale. A document "ID" is assigned to an image window when it is opened.  It retains this ID for the duration of its existence.  ID's are assigned consecutively in the order in which images are opened.  The next higher number is used when a new window is created — e.g., if image 4 is already open, the next image is assigned an ID of 5. Because of the dynamic nature of document IDs (the mix and sequence of images on your desktop varies from session to session), macros involving multiple images should be recorded and played back from an empty imaging area (i.e., one in which there are no images open).  This measure will ensure that the recorded image numbers select the intended images on playback.
See Also	IpOpBkgndSubtract


IpOpBkgndSubtract

Syntax	IpOpBkgndSubtract(WsBackId, bNewImage)
Description	This function corrects for uneven background lighting of the active image. Equivalent to the Background Subtraction option button in the Background Correction dialog box.
Parameters	WsBackId	Integer	An integer specifying the ID of the open image to be used as the background image.  See Comments, below, for more about this ID number.
	bNewImage	Integer	An integer value of 0 or 1 specifying whether the transformed image is to be written to a new image window, or back into the active image window.  Where: 0  - Writes the results to the active window. 1  - Writes the results to a new image window.
Return Value	This function returns the Document ID of the resulting image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpOpBkgndSubtract(2,0)  This statement will perform a background subtraction using image number 2 as the background image.  The corrected result will be written to the active image window.
Comments	Use this function when you want to flatten the background of an image prior to counting or measuring objects.  IpOpBkgndSubtract compares the active image to the background image and replaces, in the active image, pixels that are deemed to be part of the background with a value close to the mean background intensity. A document "ID" is assigned to an image window when it is opened.  It retains this ID number for the duration of its existence.  ID's are assigned consecutively in the order in which images are opened.  The next higher number is used when a new window is created — e.g., if image 4 is already open, the next image is assigned an ID of 5. Because of the dynamic nature of document IDs (the mix and sequence of images on your desktop varies from session to session), macros involving multiple images should be recorded and played back from an empty imaging area (i.e., one in which there are no images open).  This measure will ensure that the recorded image numbers select the intended images on playback.
See Also	IpOpBkgndCorrect


IpOpImageArithmetics

Syntax	IpOpImageArithmetics(WsId, Number, OpaCode, bNewImage)
Description	This function performs arithmetic operations upon the active image or AOI, in conjunction with a second image.   Equivalent to performing an arithmetic operation using the Other Image option in the Arithmetic Operations dialog box.
Parameters	WsId	Integer	An integer specifying the ID of the open image to be used as the operand.  See Comments, below, for more about this ID number.
	Number	Float	A number (of IPBASIC type, Single) specifying the value to be used to offset or scale the result, as follows: If OpaCode is set to OPA_ADD, OPA_SUB or OPA_DIFF, this value will be added to the result. If OpaCode is set to OPA_MULT or OPA_DIV, the result will be multiplied by this value. For all other operations, this parameter is ignored (just set it to 0).
	OpaCode	Integer	An enumerated integer specifying the kind of arithmetic operation to be performed.  Must be one of the following: OPA_ADD OPA_SUB OPA_DIFF OPA_MULT OPA_DIV OPA_AVG OPA_MAX OPA_MIN See definitions under Comments, below.
	bNewImage	Integer	An integer value of 0 or 1 specifying whether the transformed image is to be written to a new image window, or back into the active image window.  Where: 0  - Writes the transformed results to the active window. 1  - Writes the transformed results to a new image window.
Return Value	This function returns the Document ID of the resulting image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpOpImageArithmetics(0, 20.0, OPA_SUB, 1) This statement will subtract image 0 from the active image, add 20 to the result in each pixel, and write the result to a new image window. ret = IpOpImageArithmetics(2, 0.01, OPA_MULT, 0) This statement will multiply the active image by image 2, multiply the result of each pixel by 0.01, and write the result back to the active image.
Comments	A document "ID" is assigned to an image window when it is opened.  It retains this ID number for the duration of its existence.  ID's are assigned consecutively in the order in which images are opened.  The next higher number is used when a new window is created — e.g., if image 4 is already open, the next image is assigned an ID of 5.
	Because of the dynamic nature of document IDs (the mix and sequence of images on your desktop varies from session to session), macros involving multiple images should be recorded and played back from an empty imaging area (i.e., one in which there are no images open).  This measure will ensure that the recorded image numbers select the intended images on playback.   The following table describes the values allowed in the OpaCode parameter.
OpaCode	DESCRIPTION
OPA_ADD	Adds the active image and the other image.
OPA_SUB	Subtracts the other image from the active image.
OPA_DIFF	Obtains the absolute value of the difference between the active image and the other image.
OPA_MULT	Multiplies the active image by the other image.
OPA_DIV	Divides the active image by the other image.
OPA_AVG	Replaces each pixel with the mean value of the two images.
OPA_MAX	Replaces each pixel with the largest value of the two images.
OPA_MIN	Replaces each pixel with the smallest value of the two images.
See Also	IpOpNumberArithmetics,  IpOpImageLogic,  IpOpNumberLogic


IpOpImageLogic

Syntax	IpOpImageLogic(WsId, OplCode, bNewImage)
Description	This function performs logical operations upon the active image or AOI, in conjunction with a second image.   Equivalent to selecting one of the logical operations with the Other Image option in the Arithmetic Operations dialog box.
Parameters	WsId	Integer	An integer specifying the ID of the open image to be used as the operand.  See Comments, below, for more about this ID number.
	OplCode	Integer	An enumerated integer specifying the kind of logic operation to be performed.  Must be one of the following: OPL_AND OPL_OR OPL_XOR OPL_NAND OPL_NOR See definitions under Comments, below.
	bNewImage	Integer	An integer value of 0 or 1 specifying whether the result is to be written to a new image window, or back into the active image window.  Where: 0  - Writes the transformed results to the active window. 1  - Writes the transformed results to a new image window.
Return Value	This function returns the Document ID of the resulting image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpOpImageLogic(0, OPL_NOR, 0)  This statement will perform a logical "NOR" between the active image and image 0.  The results will be written back to the active image.
Comments	A document "ID" is assigned to an image window when it is opened.  It retains this ID number for the duration of its existence.  ID's are assigned consecutively in the order in which images are opened.  The next higher number is used when a new window is created — e.g., if image window 4 is already open, the next image is assigned an ID of 5. Because of the dynamic nature of document IDs (the mix and sequence of images on your desktop varies from session to session), macros involving multiple images should be recorded and played back from an empty imaging area (i.e., one in which there are no images open).  This measure will ensure that the recorded image numbers select the intended images on playback.   The following table describes the values allowed in the OplCode parameter.
OplCode	DESCRIPTION
OPL_AND	Performs a logical "AND" between your active image and the other image.  Only bit values that are "on" in both operands will be "on" in the result.
OPL_OR	Performs a logical "OR" between your active image and the other image.  Bit values that are "on" in either operand will be "on" in the result.
OPL_XOR	Performs a logical "XOR" between your active image and the other image.  Only when a bit value is "on" in one operand and "off" in the other will the bit be "on" in the result.  If bit values are "on" in both operands, or if they are "off" in both operands, they will be "off" in the result.
OPL_NAND	Performs a logical "NAND" between your active image and the other image.  Bit values that are "off" in either, or both, operands will be "on" in the result.
OPL_NOR	Performs a logical "NOR" between your active image and the other image.  Bit values that are "off" in both images will be "on" in the result.
See Also	IpOpNumberLogic,  IpOpNumberArithmetics,  IpOpImageArithmetics


IpOpNumberArithmetics

Syntax	IpOpNumberArithmetics(Number, OpaCode, bNewImage)
Description	This function performs arithmetic operations upon the active image or AOI, in conjunction with a numeric value.  Equivalent to selecting one of the arithmetic operations and the Number option in the Arithmetic Operations dialog box. Note - if you are working with a True Color image you can use the IpOpNumberRgb function to operate upon the three color channels simultaneously.
Parameters	Number	Float	A number (of IPBASIC type, Single) representing the operand to be used with the active image.
	OpaCode	Integer	An enumerated integer specifying the kind of arithmetic operation to be performed.  Must be one of the following: OPA_ADD OPA_SUB OPA_DIFF OPA_MULT OPA_DIV OPA_AVG OPA_MAX OPA_MIN See definitions under Comments, below.
	bNewImage	Integer	An integer value of 0 or 1 specifying whether the transformed image is to be written to a new image window, or back into the active image window.  Where: 0  - Writes the transformed results to the active window. 1  - Writes the transformed results to a new image window.
Return Value	This function returns the Document ID of the resulting image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpOpNumberArithmetics(120.0, OPA_MAX, 1)  This statement will compare each pixel of the active image or AOI against the value 120.0, select whichever one is higher, and write the result to a new window.
Comments	The following table describes the values allowed in the OpaCode parameter.
OpaCode	DESCRIPTION
OPA_ADD	Adds the active image and Number.
OPA_SUB	Subtracts Number from the active image.
OPA_DIFF	Obtains the absolute value of the difference between the active image pixel and Number.
OPA_MULT	Multiplies the active image pixel by Number.
OPA_DIV	Divides the active image pixel by Number.
OPA_AVG	Replaces pixel with the mean value of the active image pixel and Number.
OPA_MAX	Replaces pixel with the larger of the two values, the one in the active image or Number.
OPA_MIN	Replaces pixel with the smaller of the two values, the one in the active image or Number.
See Also	IpOpNumberRgb,  IpOpImageArithmetics,  IpOpImageLogic,  IpOpNumberLogic


IpOpNumberLogic

Syntax	IpOpNumberLogic(Number, OplCode, bNewImage)
Description	This function performs logical operations upon the active image or AOI in conjunction with a numeric value.  Equivalent to selecting a logic operation and the "Number" option in the Arithmetic Operations dialog box.
Parameters	Number	Integer	An integer specifying the operand to be used with the active image.  This parameter is ignored when OplCode is set to OPL_NOT (in this case, just set Number to 0).
	OplCode	Integer	An enumerated integer specifying the kind of logic operation to be performed.  Must be one of the following: OPL_AND OPL_OR OPL_XOR OPL_NAND OPL_NOR OPL_NOT See definitions under Comments, below.
	bNewImage	Integer	An integer value of 0 or 1 specifying whether the transformed image is to be written to a new image window, or back to the active image.  Where: 0  - Writes the transformed results to the active window.
			1  - Writes the transformed results to a new image window.
Return Value	This function returns the Document ID of the resulting image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpOpNumberLogic(0, OPL_NOT, 1)  This statement will produce a negative image of the active image and write the results to a new window.   ret = IpOpNumberLogic(1, OPL_NOR, 0)  This statement will perform a logical "NOR" between the active image and the number 1, then write the results to the active image.
Comments	The following table describes the values allowed in the OplCode parameter.
OplCode	DESCRIPTION
OPL_AND	Performs a logical "AND" between the active image and Number.  Only bit values that are "on" in both operands will be "on" in the result.
OPL_OR	Performs a logical "OR" between the active image and Number.  Bit values that are "on" in either operand will be "on" in the result.
OPL_XOR	Performs a logical "XOR" between the active image and Number.  Only when a bit value is "on" in one operand and "off" in the other will the bit be "on" in the result.  If bit values are "on" in both operands, or if they are "off" in both operands, they will be "off" in the result.
OPL_NAND	Performs a logical "NAND" between the active image and Number.  Bit values that are "off" in either, or both, operands will be "on" in the result.
OPL_NOR	Performs a logical "NOR" between the active image and Number.  Bit values that are "off" in both images will be "on" in the result.
OPL_NOT	Performs a logical "NOT" on the bit values in the active image.  Every bit value that is "on" in the active image will be "off" in the result.  Every bit value that is "off" in the active image will be "on" in the result.
See Also	IpOpImageLogic,  IpOpNumberArithmetics,  IpOpImageArithmetics


IpOpNumberRgb

Syntax	IpOpNumberRgb(Numbers, OpaCode, bNewImage)
Description	This function is a special version of the IpOpNumberArithmetics function.  It is designed to be used with True Color images, and allows you to, with a single step, arithmetically combine the image's (or AOI's) three color channels with 3 numbers.
Parameters	Numbers	Float (Basic) LPFLOAT (C)	The name of an array of three, single-precision, floating-point values (BASIC type, Single), specifying the operands that are to be arithmetically combined with the three color channels.  The contents of these elements, 0, 1 and 2, are applied to the Red, Green and Blue channels, respectively.
	OpaCode	Integer	An enumerated integer specifying the kind of arithmetic operation to be performed.  Must be one of the following: OPA_ADD OPA_SUB OPA_DIFF OPA_MULT OPA_DIV OPA_AVG OPA_MAX OPA_MIN See IpOpNumberArithmetics for definitions of these values.
	bNewImage	Integer	An integer value of 0 or 1 specifying whether the transformed image is to be written to a new image window, or back into the active image window.  Where: 0  - Writes the transformed results to the active window. 1  - Writes the transformed results to a new image window.
Return Value	The document ID of the current or new image, depending on the value of bNewImage.  If a new image is to be created, a return code of  -1 indicates a failure.
Example	The following example performs a white balance on an RGB image
dim stats(10) as single

dim offsets(3) as single

dim average as single

' Ask the user to place a small AOI over a white or gray area.

ipRect.left = 95

ipRect.top = 33

ipRect.right = 127

ipRect.bottom = 55

ret = IpAoiCreateBox(ipRect)

ret = IpMacroStop("Position box on gray or white area", 0)

' calculate the histogram of the sample.

ret = IpHstCreate()

ret = IpHstSetAttr(ICAL, 0)

' get the average red content.

ret = IpHstGet(GETSTATS, 0, stats(0))

offsets(0) = stats(0)

' get the average green content.

ret = IpHstGet(GETSTATS, 1, stats(0))

offsets(1) = stats(0)

' get the average blue content.

ret = IpHstGet(GETSTATS, 2, stats(0))

offsets(2) = stats(0)

ret = IpHstDestroy()

' calculate the average white content

average = (offsets(0) + offsets(1) + offsets(2) ) / 3

' Add values to each channel in the image.

ret = IpAoiShow(FRAME_NONE)

offsets(0) = average - offsets(0)

offsets(1) = average - offsets(1)

offsets(2) = average - offsets(2)

ret = IpOpNumberRgb(offsets(0), OPA_ADD, 0)

Comments	See Comments under IpOpNumberArithmetics.
See Also	IpOpNumberArithmetics


IpOpShow

Syntax	IpOpShow(bShow)
Description	This function is used to open or close the Arithmetic Operations dialog box.  Equivalent to selecting the Operations command to open the box, and clicking its Close button to close it.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether to open or close the Arithmetic Operations dialog box.  Where: 0  -  Closes the Arithmetic Operations dialog box if it is open. 1  -  Opens the Arithmetic Operations dialog box.
Example	ret = IpOpShow(1) This statement displays the Spatial Calibration dialog box.
Comments	The Arithmetic Operations dialog box does not have to be open during execution of any of the arithmetic or logical operations.  Its disposition, visible or hidden, is entirely your choice.  You will want to display the window if your users will be required to make choices within it, but if your objective is simply to perform a predefined operation, you may want to run without opening it.


IpOutput

Syntax	IpOutput(message)
Description	This function prints a string to the Macro Output window.  There is no command equivalent to this function; it is one that must be manually written with the macro editor.
Parameters	message	String	The string that is it to be printed to the Macro Output window.
Example	The following example prints the number of objects obtained from an earlier procedure.  Notice that a line-ending sequence (i.e., a carriage return and a line feed) is included at the end of the string.  This moves the cursor to the beginning of the next line so that is it in the proper positioned for the next IpOutput or Print statement.
Dim numobj as integer

Dim NL$ as String

NL$ = Chr$(13) + Chr$(10)

ret = IpOutput("Number of objects: " + Str$(numobj)+ NL$)

Comments	This function is similar to the IPBASIC Print function, which you may want to use instead of IpOutput because of the automatic formatting it provides.  Print also lets you print non-string expressions, directly. The Macro Output window is limited to 25,000 characters.  When this limit is reached, the oldest lines in the window are erased.  To generate data files larger than 25,000 characters, save the contents of the window to a file, then append to that file in intervals. It is not necessary to show the Macro Output window to print to it.  In fact, your program will execute faster if you print while the window is closed, since the display will not require any processing.
See Also	Print  IpOutputShow,  IpOutputClear,  IpOutputSave


IpOutputClear

Syntax	IpOutputClear( )
Description	This function clears the contents of the Macro Output window.  It is equivalent to selecting the Clear Screen command on the Macro Output window's Edit menu.
Comments	It is not necessary to show the Macro Output window to clear it.
See Also	IpOutputShow,  IpOutput,  IpOutputSave


IpOutputSave

Syntax	IpOutputSave(Filename, sMode)
Description	This function saves the current contents of the Macro Output window to a file or to the Clipboard.  It is equivalent to selecting the Save, Append or Copy to Clipboard command on the Macro Output window's File menu.
Parameters	Filename	String	A string specifying the name of the file to which the window contents will be will be written.  This parameter is ignored if sMode is set to S_CLIPBOARD.  When this is the case, just set Filename to an empty string (i.e., "").
	sMode	Integer	An enumerated integer specifying whether the data is to be stored as a new file, appended to an existing file or written to the Clipboard.  Where:   0 - Stores data to a new ASCII file (if the file already exists, it will be overwritten). S_APPEND -  Appends data to existing ASCII file. S_CLIPBOARD -  Copies data to the Clipboard.
Example	The following statement saves Macro Output window to an ASCII file. ret = IpOutputSave("c:\AppName\count.txt", 0) The following statement appends Macro Output window to an ASCII file. ret = IpOutputSave("c:\AppName\count.txt", S_APPEND) The following statement copies the Macro Output window to the Clipboard. ret = IpOutputSave("", S_CLIPBOARD)
Comments	It is not necessary to show the Macro Output window to save its contents.
See Also	IpOutputShow,  IpOutput,  IpOutputClear


IpOutputShow

Syntax	IpOutputShow(bShow)
Description	This function is used to open or close the Macro Output window.  Equivalent to selecting the "Output Window" command to open the window, and double-clicking its control box to close it.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether the Macro Output window is to be shown.  Where: 0  - Closes the window if it is already open. 1  - Opens the window.
Example	The following statement displays the Macro Output window. ret = IpOutputShow(1)
Comments	It is not necessary to show the Macro Output window to print to it, save it or clear it.  In fact, your program will execute faster  if you leave the window closed while working with its contents, since the display will not have to be processed.
See Also	IpOutput,  IpOutputClear,  IpOutputSave


IpPalSetGrayBrush

Syntax	IpPalSetGrayBrush(bForeGround, GrayIndex)
Description	This function sets the Foreground or Background color on the gray scale palette.  Equivalent to clicking a color-square in the palette to assign it as the Foreground or Background color.
Parameters	bForeGround	Integer	An integer value of 0 or 1 specifying whether the color is to be selected as the Foreground or Background color.  Where: 0  - Specifies Background color. 1  - Specifies Foreground color.
	GrayIndex	Integer	An integer between 0 and 255 (inclusive) specifying the gray level to be assigned as the Foreground or Background color.
Example	ret = IpPalSetGrayBrush(0, 111) This statement will set the gray scale-palette Background color to gray level 111.
See Also	IpPalSetPaletteBrush,  IpPalSetRGBBrush


IpPalSetPaletteBrush

Syntax	IpPalSetPaletteBrush(bForeGround, PaletteIndex)
Description	This function sets the Foreground or Background color for the palette-class palette.  Equivalent to clicking a color-square in the palette to assign it as the Foreground or Background color.
Parameters	bForeGround	Integer	An integer value of 0 or 1 specifying whether the color is to be selected as the Foreground or Background color.  Where: 0  - Specifies Background color. 1  - Specifies Foreground color.
	PaletteIndex	Integer	An integer between 0 and 255 (inclusive) specifying the index (i.e., palette position) to be assigned as the Foreground or Background color.
Example	IpPalSetPaletteBrush(0, 10) This statement will set the Palette-class Background color to index 10.
See Also	IpPalSetRGBBrush,  IpPalSetGrayBrush


IpPalSetPaletteColor

Syntax	IpPalSetPaletteColor(PaletteIndex, Red, Green, Blue)
Description	This function changes the RGB values assigned to the specified palette index.  Equivalent to double-clicking a color-square in the palette and editing the RGB values within it.
Parameters	PaletteIndex	Integer	An integer between 0 and 255 (inclusive) specifying the index to which the Red, Green and Blue values are to be applied.
	Red	Integer	An integer between 0 and 255 (inclusive) specifying the Red value of the specified palette index.
	Green	Integer	An integer between 0 and 255 (inclusive) specifying the Green value of the specified palette index.
	Blue	Integer	An integer between 0 and 255 (inclusive) specifying the Blue value of the specified palette index.
Example	ret = IpPalSetPaletteColor(111, 0, 0, 192) This statement will set index 111 to a bright blue (0 / 0 / 192).


IpPalSetRGBBrush

Syntax	IpPalSetRGBBrush(bForeGround, Red, Green, Blue)
Description	This function sets the Foreground or Background color for the RGB palette.  Equivalent to clicking a color-square in the palette to assign it as the Foreground or Background color.
Parameters	bForeGround	Integer	An integer value of 0 or 1 specifying whether the color is to be selected as the Foreground or Background color.  Where: 0  - Specifies Background color. 1  - Specifies Foreground color.
	Red	Integer	An integer between 0 and 255 (inclusive) specifying the Red value of the color to be assigned as the Foreground or Background color.
	Green	Integer	An integer between 0 and 255 (inclusive) specifying the Green value of the color to be assigned as the Foreground or Background color.
	Blue	Integer	An integer between 0 and 255 (inclusive) specifying the Blue value of the color to be assigned as the Foreground or Background color.
Example	ret = IpPalSetRGBBrush(0, 255, 255, 0) This statement will set the Background color on the RGB palette to yellow (i.e., 255 / 255 / 0).
See Also	IpPalSetGrayBrush,  IpPalSetPaletteBrush


IpPalShow

Syntax	IpPalShow(bShow)
Description	This function is used to open or close the brush color selection or the image Palette window.  Equivalent to selecting the color patches button/window or  selecting the Edit Palette command.
Parameters	bShow	Integer	An integer value of  specifying whether the window is to be shown.  Where: 1  - Opens the brush color selection window 2 -    Opens the image palette window (for Palette class images only).
Example	ret = IpPalShow(1) This statement will open the brush color selection.


IpPcLoad

Syntax	IpPcLoad(PseudoColorFile)
Description	This function loads a pseudo-color palette from the specified file.  Equivalent to clicking the Load button in the Pseudo-Color dialog box.
Parameters	PseudoColorFile	String	A string specifying the name of the file from which the pseudo-color palette will be read.
Example	ret = IpPcLoad("C:\APPNAME\FOLIAGE.PSC") This statement will load the pseudo-color file from a file called FOLIAGE.PSC in the \APPNAME directory on the C: drive.
See Also	IpPcSave


IpPcSave

Syntax	IpPcSave(PseudoColorFile)
Description	This function saves the current pseudo-color palette to a file.  Equivalent to clicking the Save button in the Pseudo-Color dialog box.
Parameters	PseudoColorFile	String	A string specifying the name of the file to which the current pseudo-color palette will be written.
Example	ret = IpPcSave("C:\APPNAME\BONEMASS.PSC") This statement will save the current pseudo-color palette to the BONEMASS.PSC file in the \APPNAME directory on the C: drive.
See Also	IpPcLoad


IpPcSaveData

Syntax	IpPcSaveData(Filename, Flag)
Description	This function saves the pseudocolor percentage area information into the specified file.
Parameters	Filename	String	Name of the data file.
	Flag	Integer	Valid values for Flag are: S_STATS = append statistical information to the  end of the file S_HEADER =  save with header S_A_AXIS = save with the left column S_DDE = transfer data using DDE S_APPEND = append data to end of file, will  overwrite exiting file if not specified
Comments	Flag values can be "OR'd" together.


IpPcSetColor

Syntax	IpPcSetColor(DivNo, Red, Green, Blue)
Description	This function assigns a color to the specified pseudo-color palette interval.  Equivalent to clicking the Colors button in the Pseudo-Color dialog box, and setting the division and color values in the Division Attributes dialog box.
Parameters	DivNo	Integer	An integer between 1 and 128 (inclusive) specifying the interval to which the specified color is to be assigned.
	Red	Integer	An integer between 0 and 255 (inclusive) specifying the level of Red in the assigned color.
	Green	Integer	An integer between 0 and 255 (inclusive) specifying the level of Green in the assigned color.
	Blue	Integer	An integer between 0 and 255 (inclusive) specifying the level of Blue in the assigned color.
Example	ret = IpPcSetColor(1, 200, 0, 0) This statement will assign the color Red (255, 0, 0) to the first interval in the selected range.
Comments	Note that DivNo numbering begins with one, not zero.
See Also	IpPcSetRange,  IpPcSetDivisions


IpPcSetDivisions

Syntax	IpPcSetDivisions(Divisions)
Description	This function sets the number of colors (intervals) into which the selected intensity-range is divided.  Equivalent to setting the Number of Colors value in the Pseudo-Color dialog box.
Parameters	Divisions	Integer	An integer specifying the number of intervals into which the selected range is to be divided.  Must be a value between 1 and 128 (inclusive).
Example	ret = IpPcSetDivisions(100) This statement will divide the current range into 100 pseudo-color intervals.
See Also	IpPcSetRange


IpPcSetRange

Syntax	IpPcSetRange(DivNo, FromVal, ToVal)
Description	This function specifies the intensity range to which pseudo-coloring is to be applied.  Also used to specify the beginning and ending value of a specified palette interval.  Equivalent to clicking the Colors button in the Pseudo-Color dialog box and setting the range with the · and · markers on the intensity scale.  Also equivalent to setting the interval start/end values in the Division Attributes dialog box.
Parameters	DivNo	Integer	An integer between 1 and 128, specifying the interval for which beginning (FromVal) and endpoints (ToVal) are to be set, or -1 to specify the entire range.
	FromVal	Integer	An integer between 0 and 255 (inclusive) specifying the first value in the specified interval or range.
	ToVal	Integer	An integer between 0 and 255 (inclusive) specifying the last value in the specified interval or range.
Example	ret = IpPcSetRange(2, 60, 100) This statement will assign a range of 60 - 100 (inclusive) to the second interval.  Ret = IpPcSetRange(-1, 0, 110) This statement will set 0 to 110 (inclusive) as the range to which all pseudo-coloring will be applied.
Comments	The FromVal and ToVal values must be expressed as an integer from 0 to 255 (inclusive).  If your image is Gray Scale 12 or Floating Point, the normalized equivalents of these values will be used. When you record a macro that sets ranges, Auto-Pro may record more than one IpPcSetRange statement for each division.  This occurs because one statement is posted when you set the starting value, and another is posted when you set the end value.  You may edit out the unnecessary IpPcSetRange statements, and leave only the single statement that actually sets the range that is to be defined.


IpPcShow

Syntax	IpPcShow(bShow)
Description	This function is used to apply or reset the pseudo-color palette for the active image.  Equivalent to selecting the Pseudo-Color command to open the dialog box, and clicking the OK or Cancel buttons to close it.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether the Pseudo-Color palette is to be applied or removed from the active image.  Where: 0  - Resets the pseudo-color palette, and removes pseudo-coloring from the active image. 1  - Applies the pseudo-color palette to the active image.
Example	ret = IpPcShow(1) This statement will apply the pseudo-color palette to the active image.


IpPlotCreate

Syntax	IpPlotCreate(title)
Description	Create a plot window with the given title.
Parameters	title	String	Names the plot window
See Also	IpPlotData, IpPlotRange, IpPlotSet, IpPlotShow,   IpPlotUpdate, IpPlotDestroy


IpPlotData

Syntax	IpPlotData(plotId, axis, valueType, values, count)
Description	Plots the data in the window referenced by plotID.
Parameters	axis	Integer	Can be either the vertical axis (1) or the horizontal axis (0).
	PlotID	Integer	Integer value greater than zero.
	ValueType	Integer	Type of data to be plotted: PDT_INT16, PDT_INT32, PDT_FLOAT, PDT_DFLOAT
	values	Any	Contains the data to be plotted.
	Count	Integer	Number of elements to be plotted.
See Also	IpPlotCreate, IpPlotRange, IpPlotSet, IpPlotShow,   IpPlotUpdate, IpPlotDestroy
Comments	For most plots, only the y-axis data needs to be set; the x-axis is incremented automatically by default.


IpPlotDestroy

Syntax	IpPlotUpdate (plotID)
Description	Destroys the plot
Parameters	plotID	Integer	Integer value greater than zero.
See Also	IpPlotCreate, IpPlotRange, IpPlotSet, IpPlotShow,   IpPlotUpdate, IpPlotData


IpPlotRange

Syntax	IpPlotRange(plotId, axis, valueType, rangeType, values, )
Description	Sets the range for the values that will be visible on the graph for the horizontal or vertical axis.
Parameters	axis	Integer	Can be either the vertical axis (1) or  the horizontal axis (0).
	PlotID	Integer	Integer value greater than zero.
	ValueType	Integer	Type of data to be plotted: PDT_INT16, PDT_INT32, PDT_FLOAT, PDT_DFLOAT
	rangeType	Integer	Must be one of the following: RGE_FIXEDMIN  values contins the lower range value.  The upper range is calculated automatically from the  data itself. RGE_FIXEDMAX  values contains the upper range  values. RGE_FIXED values contains the upper and lower range  values. RGE_AUTO values is not used. The lower and upper  range values are calculated automatically from the data  itself.
	Values	Any	Contains one or two numbers defining the range.
See Also	IpPlotCreate, IpPlotDestroy, IpPlotSet, IpPlotShow,   IpPlotUpdate, IpPlotData


IpPlotSet

Syntax	IpPlotSet(plotId, commandString, )
Description	Sets the graph parameters, legends, styles, etc.
Parameters	plotID	Integer	Integer value greater than zero.
	CommandString	String	Can contain any number of parameters and is of the following form: [ ] indicate optional parameters.
	Parameter1 [=value1], parameter2 [=value2], parameter3 = [value3]…
	Parameters	Values	Description
	histogram	none	bar chart without gaps between bars
	line	none	line plot
	scattergram	none	points plot
	bars	none	bar chart with gaps
	title	string	title of the graph
	title	on, off	title of the graph on or off
	axis	string	on or off i.e. axis is shown or hidden
	x label	string	title of the x-axis
	x label	on, off	title of the x-axis  on or off
	y label	string	title of the y-axis
	y label	on, off	title of the y-axis  on or off
	majortics	string	major tic marks turned on or off
	minortics	string	minor  tic marks turned on or off
	grid	string	grid on the graph turned on or off
	legend	string	graph legend turned on or off
	line style	string	style of the plot line: solid, dash, dashdot, dot, dashdotdot
	plot title	string	title of the data plot
	x tics	number	number of tics on x-axis
	y tics	number	number of tics on y-axis
See Also	IpPlotCreate, IpPlotDestroy, IpPlotRange, IpPlotShow,   IpPlotUpdate, IpPlotData


IpPlotShow

Syntax	IpPlotShow(plotID, sMode)
Description	Shows or hides the plot
Parameters	plotID	Integer	Integer value greater than zero.
	sMode	Integer	1 = show plot, 0 = hide plot
See Also	IpPlotCreate, IpPlotDestroy, IpPlotRange, IpPlotSet,   IpPlotUpdate, IpPlotData


IpPlotUpdate

Syntax	IpPlotUpdate(plotID)
Description	Updates the plot, after the data has changed
Parameters	plotID	Integer	Integer value greater than zero.
See Also	IpPlotCreate, IpPlotDestroy, IpPlotRange, IpPlotSet,   IpPlotShow, IpPlotData


IpProfCreate

Syntax	IpProfCreate( )
Description	This function opens the Line Profile window for the active image.  Equivalent to selecting the Line Profile command.
Return Value	This function returns the Profile ID if successful.  A negative value is returned if an error occurred.
Comments	An image must be open before calling this function.  The newly created profile window becomes the "active" (i.e., selected) line profile as soon as it is created.
See Also	IpProfMove,  IpProfDestroy,  IpProfSelect


IpProfDestroy

Syntax	IpProfDestroy( )
Description	This function closes the active line profile window and clears any data associated with it.  Equivalent to selecting the Close command in the Line Profile File menu.
Comments	Note that this function operates upon the "active" profile window (i.e., the one most recently opened or selected).  If the currently active profile is not the one you want to use, you must use IpProfSelect to explicitly select (make active) the appropriate window before calling IpProfDestroy.
See Also	IpProfCreate,  IpProfSelect


IpProfGet

Syntax	IpProfGet(Cmd, Param, OutVal)
Description	Use this function to get information relating to the selected line profile.  There is no command equivalent to this function; it is one that must be manually written with the macro editor.
Parameters	Cmd	Integer	A command ID, which specifies the type of  information you want to retrieve.  Must be one of the following: GETINDEX GETNUMPTS GETVALUES GETSTATS GETRANGE GETPOINTS See definitions under Comments, below
	Param	Integer	An integer specifying data with which Cmd will operate.  See definitions under Comments, below, for the values required by each command
	OutVal	See below	The address (name) of the variable that will receive the requested data.  Be sure this variable is of the type required by Cmd.  See Cmd description under Comments, below.
Return Value	All commands listed below return 0 if successful.  A negative error, otherwise.
Example	The following example calculates the mean value of the active profile.
Dim numbins As Integer

Dim ProfArea As Single, Mean as single

Dim i As Integer

ret = IpProfGet(GETNUMPTS, 0, numbins)

Redim profdat(numbins) As Single

ret = IpProfGet(GETVALUES, numbins, profdat(0))

ProfArea = 0#

For i = 0 To numbins - 1

    ProfArea = ProfArea + profdat(i)

Next i

If numbins > 0 Then

    Mean = ProfArea / numbins

End If

.

.

.

The following example gets the mean value directly

.

.

.

Redim stats(10) As Single

ret = IpProfGet(GETSTATS, 0, stats(0))

Mean = stats(0)

The following example shifts the line profile down and to the right.

Redim endPts(2) As POINTAPI

ret = IpProfGet(GETPOINTS, 0, endPts(0))

endPts(0).x = endPts(0).x + 20

endPts(0).y = endPts(0).y + 10

endPts(1).x = endPts(1).x + 20

endPts(1).y = endPts(1).y + 10

ret = IpProfLineMove(endPts(0).x, endPts(0).y, endPts(1).x, endPts(1).y)

Comments	Note that this function operates upon the "active" line profile window (i.e., the one most recently opened or selected).  If the currently active profile is not the one you want to use, you must use IpProfSelect to explicitly select (make active) the appropriate window before calling IpProfGet. Profiles of RGB images contain 3 times as much data as an equivalent Gray Scale profile.   The data are organized Red channel first, then Green, then Blue. When passing an array to the program  from a BASIC program, be sure to pass the first element of the array by reference (See GETVALUES statement in example, above).
Cmd VALUE	DESCRIPTION
GETINDEX	Use this command to determine the active profile's ID.  The ID is written to OutVal.  This value can be used later to select this profile with IpProfSelect( ).
		Param VALUE		OutVal TYPE
		Not used by GETINDEX.  Must be set to 0.		BASIC, Integer C, LPSHORT
GETNUMPTS	Use this command to determine the number of points in the profile.    The number is written to OutVal.
		Param VALUE		OutVal TYPE
		Not used by GETNUMPTS.  Must be set to 0.		BASIC, Integer C, LPSHORT
GETVALUES	Use this command to get the selected profile's values.  The values are written to the one-dimensional array specified in OutVal.  For a True Color profile the entire Red channel profile is written into the array first, then the Green channel, then the Blue channel. Note - do not use the keyword Statistics as the name of your OutVal array.  This is an Auto-Pro reserved word.  Using it as a variable name can cause a GPF.
		Param VALUE		OutVal TYPE
		An integer specifying the length of your OutVal array.    If you are getting data from a True Color image, your array must be large enough to hold 3 times the number of points in the profile. Note - you can use GETNUMPTS to determine the number of elements needed in this array.		BASIC , Single. C,  LPFLOAT Note - OutVal must specify an array.
GETSTATS	Use this command to get the statistical data associated with the selected profile.  For True Color images, information will be obtained for the color channel specified in Param (see below). The statistics are written to a 10-element array in OutVal, as follows: OutVal (0) -  Mean value OutVal (1) -  Standard Deviation OutVal (2) -  Area under the profile OutVal (3) -  Minimum value in profile OutVal (4) -  Maximum value in profile OutVal (5) -  Not Currently Used OutVal (6) -  Not Currently Used OutVal (7) -  Not Currently Used OutVal (8) -  Not Currently Used OutVal (9) -  Not Currently Used
		Param VALUE		OutVal TYPE
		An integer specifying the color channel for which statistics are to be obtained.  Where: 0 -  Red Channel 1 -  Green Channel 2 -  Blue Channel This parameter is ignored if the image is not True Color.  When this is the case, just set Param to 0.		BASIC, Single. C,  LPFLOAT Note - OutVal must specify a 10-element array.
GETRANGE	Use this command to get the range information associated with the selected profile.  For True Color images, information will be obtained for the color channel you specify in Param (see below). The range information is written to a 10-element array in OutVal, as follows: OutVal (0) -  Start range (X1) OutVal (1) -  End range (X2) OutVal (2) -  Area under profile that is inside the range OutVal (3) -  Area, above, as a percent of total area (%) OutVal (4) -  Profile value at start of range (Y1) OutVal (5) -  Profile value at end of range (Y2) OutVal (6) -  Pixel number at start of range (0-based) OutVal (7) -  Pixel number at end of range (0-based) OutVal (8) -  Not Currently Used OutVal (9) -  Not Currently Used
		Param VALUE		OutVal TYPE
		An integer specifying the color channel for which range information is to be obtained.  Where:		BASIC, Single. C,  LPFLOAT
GETRANGE		Param VALUE		OutVal TYPE
(continued)		0 -  Red Channel 1 -  Green Channel 2 -  Blue Channel This parameter not used when the image is not True Color.  Set to 0.		BASIC, Single. C,  LPFLOAT Note - OutVal must specify a 10-element array.
GETPOINTS	Use this command to get the image coordinates for the rectangle defining the start and end points of the profile.  This command writes the coordinates to the 2-element array specified in OutVal.
		Param VALUE		OutVal TYPE
		Not used by GETPOINTS.  Must be 0.		BASIC , POINTAPI C,  LPPOINT
See Also	IpProfCreate,  IpProfSelect


IpProfLineMove

Syntax	IpProfLineMove(x1, y1, x2, y2)
Description	This function defines the position of the line (or rectangle) being profiled.  Equivalent to positioning the defining line with the mouse in the image window.
Parameters	x1	Integer	An integer specifying the x-coordinate of the first point on the line to be profiled.  If a thick profile is being defined, this value specifies the x-coordinate of the  upper-left corner of the rectangle to be profiled.
	y1	Integer	An integer specifying the y-coordinate of the first point on the line to be profiled.  If a thick profile is being defined, this value specifies the y-coordinate of the  upper-left corner of the rectangle to be profiled.
	x2	Integer	An integer specifying the x-coordinate of the last point of the line to be profiled.  If a thick profile is being defined, this value specifies the x-coordinate of the lower-right corner of the rectangle to be profiled.
	y2	Integer	An integer specifying the y-coordinate of the last point of the line to be profiled.  If a thick profile is being defined, this value specifies the y-coordinate of the lower-right corner of the rectangle to be profiled.
Example	ret = IpProfLineMove(0, 0, 100, 216) This statement will define a line that extends from pixel  0, 0  to pixel 100, 216 in the image.
Comments	The parameter values must specify pixel positions in uncalibrated form.    Note that this function operates upon the "active" profile window (i.e., the one most recently opened or selected).  If the currently active profile is not the one you want to use, you must use IpProfSelect to explicitly select (make active) the appropriate window before calling IpProfLineMove. The position to which the profile is moved becomes the default position for the next Line Profile command.
See Also	IpProfSetAttr


IpProfMaximize

Syntax	IpProfMaximize( )
Description	This function enlarges the active line profile window to full screen.  Equivalent to clicking the maximize button on the Line Profile window Control bar.
Comments	Note that this function operates upon the "active" profile window (i.e., the one most recently opened or selected).  If the currently active profile is not the one you want to use, you must use IpProfSelect to explicitly select (make active) the appropriate window before calling IpProfMaximize.
See Also	IpProfMinimize,  IpProfRestore,  IpProfSelect


IpProfMinimize

Syntax	IpProfMinimize( )
Description	This function reduces the active line profile window to an icon.  Equivalent to clicking the minimize button on the Line Profile window Control bar.
Comments	Note that this function operates upon the "active" profile window (i.e., the one most recently opened or selected).  If the currently active profile is not the one you want to use, you must use IpProfSelect to explicitly select (make active) the appropriate window before calling IpProfMinimize.
See Also	IpProfMaximize,  IpProfRestore,  IpProfSelect


IpProfMove

Syntax	IpProfMove(x, y)
Description	This function moves the active (i.e., selected) line profile window to the specified location.  Equivalent to dragging the Line Profile window with the mouse.
Parameters	x	Integer	An integer specifying the x-coordinate of the screen position to which the upper-left corner of the Line Profile window is to be moved.
	y	Integer	An integer specifying the y-coordinate of the screen position to which the upper-left corner of the Line Profile window is to be moved.
Example	ret = IpProfMove(10, 40)  This statement will move the active profile window 11 pixels to the right, and 41 pixels down from the upper-left corner of the screen.
Comments	The origin ( 0, 0 ) for the coordinate system used by the x and y parameters is the upper-left corner of the screen.  Note that this function operates upon the "active" profile window (i.e., the one most recently opened or selected).  If the currently active profile is not the one you want to use, you must use IpProfSelect to explicitly select (make active) the appropriate window before calling IpProfSize.
See Also	IpProfRestore,  IpProfMaximize,  IpProfMinimize,  IpProfSelect


IpProfRestore

Syntax	IpProfRestore( )
Description	This function returns the active line profile window to its previous screen position and size.  Equivalent to clicking the Restore button on a maximized profile window, or double-clicking the icon of a minimized profile window.
Comments	Note that this function operates upon the "active" profile window (i.e., the one most recently opened or selected).  If the currently active profile is not the one you want to use, you must use IpProfSelect to explicitly select (make active) the appropriate window before calling IpProfRestore.
See Also	IpProfMinimize,  IpProfMaximize,  IpProfSelect


IpProfSave

Syntax	IpProfSave(FileName, SaveMode)
Description	This function saves, or appends, the active line profile data or statistics to the specified file.  Equivalent to the Save Profile, Append Profile, Save Statistics, and Append Statistics commands on the File menu in the Line Profile window.
Parameters	FileName	String	A string specifying the name of the file to which the profile data will be written.  This parameter is ignored when the S_CLIPBOARD option in the SaveMode parameter is used.  When this is the case, set FileName to an empty string (i.e., "").
	SaveMode	Integer	An enumerated integer, or an expression involving the addition of two or more enumerated integers, that  specify the kind of profile data to be stored.  This parameter also identifies where the data is to be stored.  Must contain one or more of the following:
			S_DATA     or    S_STATS S_APPEND     or    S_CLIPBOARD S_HEADER S_LEGEND S_X_AXIS See Comments, below, for a definition of each name.   See Example, below, for usage.
Example	ret = IpProfSave("C:\APPNAME\PROF.HST", S_DATA) The statement above will save the current profile data to a file called PROF.HST in the \APPNAME directory on the C: drive.  If the file already exists, it will be overwritten. ret = IpProfSave("C:\APPNAME\PROF.HST", S_STATS+S_APPEND) The statement above will append the current profile statistics to a file called PROF.HST in the \APPNAME directory on the C: drive.  ret = IpProfSave("C:\APPNAME\PROF.HST", S_DATA+S_HEADER+S_LEGEND) The statement above will save the current profile data to a file called PROF.HST in the \APPNAME directory on the C: drive.  The header and legend information will be stored with the data.  If the file already exists, it will be overwritten. ret = IpProfSave("", S_CLIPBOARD) The statement above will save the current profile data to the Clipboard (the function defaults to S_DATA).  Note that the FileName parameter specifies a zero-length string.    ret = IpProfSave("C:\APPNAME\PROF.HST",S_APPEND+S_DATA+S_X_AXIS) The statement above will append the current profile data to a file called PROF.HST in the \APPNAME directory on the C: drive.  The X-axis data will be stored with the statistics.
Comments	Note that this function operates upon the "active" profile window (i.e., the one most recently opened or selected).  If the currently active profile is not the one you want to use, you must use IpProfSelect to explicitly select (make active) the appropriate window before calling IpProfSave. The following options can be used in the expression comprising the SaveMode parameter.
USAGE	Save Mode	DESCRIPTION
Use one or none...	S_DATA	Specifies that line profile data is to be stored.
	S_STATS	Specifies that line profile statistics are to be stored.
		Note - if neither S_DATA nor S_STATS is included in the expression, S_DATA is assumed.
Use one or none...	S_APPEND	Specifies that the data/statistics are to be appended to the specified file.
	S_CLIPBOARD	Specifies that the data/statistics are to be saved to the Clipboard.  When this option is used, the FileName parameter is ignored.
	S_CLIPBOARD (continued)	Note - if neither S_APPEND nor S_CLIPBOARD is included in the expression, line profile data/statistics are saved to a new file (if the file already exists, it will be overwritten).
Use any, all or none...	S_HEADER	Specifies that the header is to be stored along with the data/statistics.
	S_LEGEND	Specifies that the legend is to be stored along with the data/statistics.
	S_X_AXIS	Specifies that the X-axis information is to be stored along with the data/statistics.
See Also	IpProfSelect


IpProfSelect

Syntax	IpProfSelect(ProfId)
Description	This function activates the specified line profile window.  It selects the profile upon which all subsequent line profile functions will operate.  Equivalent to clicking the Line Profile window to activate it.
Parameters	ProfId	Integer	An integer specifying the ID of the profile that is to be selected.  See comments, below, for more information about this ID.
Example	ret = IpProfSelect(0)  This statement makes Line Profile window 0 the active Line Profile.
Comments	A profile "ID" (ProfId) is assigned to a profile window when it is created.  The window retains this ID for the duration of its existence.  A profile window is given the lowest unused ID number available at the time it is created.  If a profile window is opened while no other profiles are open, it is assigned an ID of "0".   If another profile is created while "0" is open, the new profile is assigned an ID of "1".  If "0" is closed, and another profile is opened (while "1" is still open), the new window is given an ID of "0", since it is the lowest, unused ID available.


IpProfSetAttr

Syntax	IpProfSetAttr(AttrType, AttrValue)
Description	This function selects, sets or deselects options relating to the Line Profile window.
Parameters	AttrType	Integer	An enumerated integer, which identifies the option to be set.  Must be one of the following: CHANNEL1 CHANNEL2 CHANNEL3
			COLORMODEL FREEZE GRID ICAL LINEGEOMETRY LINETYPE ORIGIN REFERENCE SCAL STATISTICS See definitions under Comments, below.
	AttrValue	Integer	An integer specifying how the option specified by AttrType is to be set.  See definitions under Comments, below, for the values allowed by each option.
Example	ret = IpProfSetAttr(REFERENCE, 1) This statement will set the current defining line as a "reference" line.
Comments	AttrType options are as follows:
AttrType	DESCRIPTION	ALLOWED VALUES
CHANNEL1	Enables or disables the	0  -  Disables Channel.
	profile of the Red, Hue	1  - Enables Channel.
	or Y channel, depending upon the color model selected.
CHANNEL2	Enables or disables the	0  -  Disables Channel.
	profile of the Green,	1  - Enables Channel.
	Saturation or In-Phase channel, depending upon the color model selected.
CHANNEL3	Enables or disables the	0  -  Disables Channel.
	profile of the Blue,	1  - Enables Channel.
	Intensity, Value or Quadrature channel, depending upon the color model selected.
COLORMODEL	Selects the color model	CM_RGB
	in which the line profile	CM_HSI
	will be displayed.	CM_HSV
	Equivalent to selecting	CM_YIQ
	the color model in the
	Line Profile window's
	Color menu.
FREEZE	Sets or releases a frozen	0  -  Releases frozen line.
	profile line.	1  -  Freezes current line.
	Equivalent to setting the
	Freeze option in the
	Line Profile window's
	Report menu.
GRID	Determines whether the	0  -  Selects Graph form.
	profile is displayed in	1  -  Selects Table form.
	table or graph form.
	Equivalent to setting the
	Table option in the
	Line Profile window's
	Report menu.
ICAL	Specifies whether the intensity calibration is to be	0  - Suppresses calibration of profile.
	applied to the profile.  Equivalent to setting the	1  - Applies calibration to profile.
	Intensity Cal option in
	the Line Profile window
	Report menu.
LINEGEOMETRY	Sets the type of line used in	PROFTYPE_LINE
	the line profile and (line,	PROFTYPE_CIRCLE
	circle, or freeform).	PROFTYPE_FREEFORM
	Equivalent to setting the
	Profile Type
	in the line profile window.
	The points array should be
	initialized with the freeform
	line's points using IpListPts
	prior to calling IpProfSetAttr
LINETYPE	Determines whether a	THICKHORZ
	line or a rectangle is to be	THICKVERT
	profiled.  Also selects the	THICKNORMAL
	type of statistic that is	THICKAVG
	to be measured when a	THICKSTDDEV
	rectangle is profiled.
	Equivalent to setting the
	Normal, Thick Vert,
	Thick Horz or Thick
	Options options in the
	Line Profile window
	Report menu.
ORIGIN	Specifies whether the	0  -  Scales from range min.
	Y-axis will originate at	1  -  Scales from 0.
	0, or will be scaled to the
	range min and max values.
	Equivalent to setting the
	Full Scale option in
	the Line Profile window
	Report menu.
REFERENCE	Sets or releases a reference	0 - Releases reference line.
	line.  Equivalent to setting the Reference box in the	1 - Sets current line as a reference line.
	Line Profile window.
SCAL	Specifies whether the spatial calibration is to be	0  - Suppresses calibration of the profile.
	applied to the profile.  Equivalent to setting the	1  - Applies calibration to the profile.
	Spatial Cal option in
	the Line Profile window
	Report menu.
STATISTICS	Specifies whether statistics or range information is to be displayed in the profile	0  -  Suppresses display of statistics and range information.
	window.  Equivalent to	1  -  Displays Statistics.
	setting the Statistics	2  -  Displays Range Info.
	or Range/Area option
	in the Line Profile
	window's Report menu.
	Note that this function operates upon the "active" profile window (i.e., the one most recently opened or selected).  If the currently active profile is not the one you want to use, you must use IpProfSelect to explicitly select (make active) the appropriate window before calling IpProfSetAttr.


IpProfSize

Syntax	IpProfSize(cx, cy)
Description	This function changes the size of the active line profile window to the specified width and height.
Parameters	cx	Integer	An integer specifying the width, in pixels, at which the Line Profile window is to be displayed.
	cy	Integer	An integer specifying the height, in pixels, at which the Line Profile window is to be displayed.
Example	ret = IpProfSize(400, 175) This statement will resize the Line Profile window to dimensions of 400 pixels wide by 175 pixels tall.
Comments	Note that this function operates upon the "active" profile window (i.e., the one most recently opened or selected).  If the currently active profile is not the one you want to use, you must use IpProfSelect to explicitly select (make active) the appropriate window before calling IpProfSize.
See Also	IpProfSelect


IpProfUpdate

Syntax	IpProfUpdate( )
Description	This function updates the data within the Line Profile window.  Equivalent to selecting the Updatecommand within the Line Profile window.
Comments	Note that this function operates upon the "active" profile window (i.e., the one most recently opened or selected).  If the currently active profile is not the one you want to use, you must use IpProfSelect to explicitly select (make active) the appropriate window before calling IpProfUpdate.
See Also	IpProfSelect


IpPrtHalftone

Syntax	IpPrtHalftone(bUsePrtHalftone, bUsePrtScaling, HalftoneType, HaltoneOption)
Description	This function sets the halftone and scaling options to be applied when the image is printed.  Equivalent to setting the options within the Halftone group box in the Print dialog box.
Parameters	bUsePrtHalftone	Integer	An integer value of 0 or 1 specifying whether the printer's halftone capability is to be utilized.  Where: 0  - The application  halftones the image before it is sent to the printer using the method specified by the HalftoneType and HalftoneOption parameters. 1  - the printer halftones the image at print time. When this parameter is set to 1, the HalftoneType and HalftoneOption parameters are ignored.
	bUsePrtScaling	Integer	An integer value of 0 or 1 specifying whether the printer's scaling capability is to be utilized.  Where: 0  - The application scales the image before it is sent to the printer. 1  - the printer scales the image at print time.
	HalftoneType	Integer	An integer from 0 to 6 (inclusive) specifying the halftone screen/method to be used.  Where: 0  - Angle Dot Screen 1  - Flat Dot Screen 2  - Angle Line Screen 3  - Horz Line Screen 4  - Vert Line Screen 5  - Error Diffusion 6  - Threshold This parameter is ignored when bUsePrtHalftone is set to 1.  When this is the case, just set HalftoneType to 0.
	HaltoneOption	Integer	An integer from 0 to 4 (inclusive) specifying the screen resolution or halftone option to be used.  Where: for HalftoneType values of 0 - 4: 0  - largest LPI value 1  - second-largest LPI value 2  - second-smallest LPI value Screen 3  - smallest LPI value
			for HalftoneType values of 5: 0  - 4 Weights 1  - 12 Weights 2  - Fuzzy 3  - Random This parameter is ignored when bUsePrtHalftone is set to 1, or when HalftoneType is set to 6.  When this is the case, just set HalftoneOption to 0.
Example	ret = IpPrtHalftone(0, 0, 5, 3) This statement will set the halftone type to Error Diffusion using the Random pattern.
See Also	IpPrtSize,  IpPrtPage


IpPrtPage

Syntax	IpPrtPage(PageNo, bPrintOverlay, Copies)
Description	This function prints the active image.  Equivalent to clicking the Print button in the Print dialog box.
Parameters	PageNo	Integer	An integer specifying the tile number to be printed, or 0 if the entire image is to be printed on a single page.  See Comments, below.
	bPrintOverlay	Integer	An integer value of 0 or 1 specifying whether to print the image with an overlay. Equivalent to enabling the Print Overlay checkbox in the Print dialog box. Where: 0  - Print the image only. 1  - Print with image with overlay.
	Copies	Integer	An integer specifying the number of copies to be printed of the specified tile.
Example	ret = IpPrtPage(1, 0, 3)  This statement will print three copies of the second tile of the image.
Comments	When an image is tiled across several pages, each tile is assigned a page number.  This number is the one that you must specify in the PageNo parameter.  Page numbers are assigned, beginning with "0", from left to right, beginning with the top row and working down.
See Also	IpPrtSize


IpPrtScreen

Syntax	IpPrtScreen(PageNo, bPrintOverlay, Copies)
Description	This function prints the screen capture image.
Parameters	PageNo	Integer	An integer specifying the tile number to be printed, or 0 if the entire image is to be printed on a single page.  See Comments, below.
	bPrintOverlay	Integer	An integer value of 0 or 1 specifying whether to print the image with an overlay. Equivalent to enabling the Print Overlay checkbox in the Print dialog box. Where: 0  - Print the image only. 1  - Print with image with overlay.
	Copies	Integer	An integer specifying the number of copies to be printed of the specified tile.
Example	ret = IpPrtScreen(0, 0, 1)  This statement will print one copy of the entire image.
See Also	IpPrtPage


IpPrtSize

Syntax	IpPrtSize(Mode, bCentered, Top, Left, Width, Height, Smooth)
Description	This function sets the image size and position for printing purposes.  Equivalent to clicking the Position button in the Print dialog box, and setting the size and position fields.
Parameters	Mode	Integer	An enumerated integer specifying whether the image is to be printed at actual size, page size, or the size specified by the Width and Height parameters.  Must contain one of the following: PRT_ACTUAL PRT_FIT PRT_DISTORT See definitions under Comments, below.
	bCentered	Integer	An integer value of 0 or 1 specifying whether the image is to be centered within the print space, or is to be printed according to the margins specified by the Top and Left parameters.  Where: 0  - Prints the image according to the position specified by the Top and Left parameters. 1  - Prints the image in the center of the print space. When this parameter is set to 1, the Top and Left parameters are ignored.
	Top	Float	A number (of IPBASIC type, Single) specifying, in inches, the position of the top edge of the image in the print space. This parameter is ignored when the bCentered parameter is set to 1.  When this is the case, just set Top to 0.
	Left	Float	A number (of IPBASIC type, Single) specifying, in inches, the position of the left edge of the image in the print space. This parameter is ignored when the bCentered parameter is set to 1.  When this is the case, just set Left to 0.
	Width	Float	A number (of IPBASIC type, Single) specifying the width (x-dimension), in inches, to which the printed image is to be scaled. This parameter is used only when the Mode parameter is set to PRT_DISTORT.  Set it to 0, otherwise.
	Height	Float	A number (of IPBASIC type, Single) specifying the height (y-dimension), in inches, to which the printed image is to be scaled. This parameter is used only when the Mode parameter is set to PRT_DISTORT.  Set it to 0, otherwise.
	Smooth	Integer	An integer value of 0 or 1 specifying whether the image is to be smoothed when it is scaled for print.  Where: 0  - Suppresses smoothing. 1  - Applies smoothing.
Example	ret = IpPrtSize(PRT_FIT, 0, 1.0, 0.0, 0.0, 0.0, 1) This statement will print the active image to fit the page.  The top edge will begin 1 inch down from the top of the print space.  Smoothing will be employed. The Width and Height parameters have been set to 0 because they are not used by  PRT_FIT.
Comments	Mode options are as follows:
Mode	DESCRIPTION
PRT_ACTUAL	Sets print size to the actual image dimensions, based upon its current DPI value.
PRT_FIT	Sets print size to the largest possible dimensions given the current print space.
PRT_DISTORT	Sets print size to that specified by Width and Height parameters.
See Also	IpPrtPage


IpRangeGet

Syntax	IpRangeGet (start, end)
Description	This functions gets the range of  the Lookup Table.
Parameters	start	LPLONG	Beginning of the range
	end	LPLONG	End of the range.
See Also	IpRangeSet


IpRangeSet

Syntax	IpRangeSet (start, end)
Description	This functions sets the range for the Lookup Table.
Parameters	start	Long	Beginning of the range
	end	Long	End of the range.
See Also	IpRangeGet


IpRegister

Syntax	IpRegister(FromPoints, ToPoints, NumPoints, AffCode)
Description	This function warps the active image to a set of tiepoint, using a projective affine transformation.  Equivalent to the Registration command.
Parameters	FromPoints	POINTAPI	An array containing a list of tiepoint coordinates in the object image (the image to be warped).
	ToPoints	POINTAPI	An array containing the list of tiepoint coordinates in the reference image.  The order of these points must correspond to the order of the points in the FromPoints array.
	NumPoints	Integer	Number of points in FromPoints or ToPoints.
	AffCode	Integer	An expression involving the addition of one or more enumerated integers, where the operands specify the options to be used during the transformation process.
			The expression may include any of the following as operands: AFF_NOBILINEAR AFF_FLOAT AFF_CLIP See definitions under Comments, below.
Example	The following example registers one image to another using the image-clip and floating-point options.  Note that a single array has been used for both sets of points. Dim Pts(8) as POINTAPI 'the source points ret = IpListPts(Points(0), "142 65 480 0 472 421 133 443 ") 'the target points ret = IpListPts(Points(4), "133 57 472 18 479 413 153 445 ") ret = IpRegister(Points(0), Points(4), 4, AFF_CLIP + AFF_FLOAT)
Comments	AffCode options (flags) are enabled by including them as operands in an additive expression.  For example,
An AffCode of...		would specify...
0		No options.
AFF_CLIP		A single option (in this case, the image-clipping option).
AFF_CLIP+AFF_FLOAT		Two options (in this case, the image-clipping and floating-point options).
	The following table describes the options that can be added in AffCode:
AffCode FLAG		DESCRIPTION
AFF_CLIP		This option determines the position of the tiepoints in the new image.  When AFF_CLIP is enabled, the tiepoints in the result are located in exactly the same spatial positions as the reference image (pixels above and to the left of the new image origin may be clipped to achieve this positioning).  If the purpose of the registration is to align two images for comparative analysis, use AFF_CLIP.  This produces an image that most closely resembles the reference image in terms of perspective and position. If this option is disabled, the new image will encompass the entire transformed result.
AFF_FLOAT		This option enables the floating-point transformation process.  This option produces the most accurate results, but will be slow if your system is not equipped with a math co-processor.
AFF_NOBILINEAR		This option disables the bilinear interpolation process during transformation.  Enabling this option yields faster processing time, but lower quality results.
See Also	IpRegShow


IpRegShow

Syntax	IpRegShow(bShow)
Description	This function displays or hide the Registration dialog box.  Equivalent to selecting the Registration command to open the window, or clicking its Close button to close it.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether the "Registration" window is to be shown.  Where: 0  - Closes the window if it is already open. 1  - Opens the window.
Example	This set of statements will open the "Registration" window, perform a registration, then close the "Registration" window.
Dim Pts(8) as POINTAPI

ret = IpRegShow(1)

ret = IpListPts(Points(0), "40 121 289 26 301 315 30 256 ")

ret = IpListPts(Points(4), "50 55 275 55 275 301 50 301 ")

ret = IpRegister(Points(0), Points(4), 4,0 )

ret = IpRegShow(0)

See Also	IpRegister


IpSCalCreate

Syntax	IpSCalCreate( )
Description	This function creates a new spatial calibration set.  Equivalent to clicking New in the Spatial Calibration dialog box.
See Also	IpSCalSelect,  IpSCalDestroy


IpSCalDestroy

Syntax	IpSCalDestroy( )
Description	This function deletes the current spatial calibration set.  Equivalent to clicking Deletein the Spatial Calibration dialog box.
See Also	IpSCalCreate,  IpSCalSelect


IpSCalMove

Syntax	IpSCalMove(x, y)
Description	This function moves the Spatial Calibration dialog box to the specified screen position.  Equivalent to dragging the dialog box to a new position with the mouse.
Parameters	x	Integer	An integer specifying the x-coordinate of the pixel to which the upper-left corner of the Spatial Calibration dialog box is to be moved.
	y	Integer	An integer specifying the y-coordinate of the pixel to which the upper-left corner of the Spatial Calibration dialog box is to be moved.
Example	ret = IpSCalMove(6, 26) This statement will move the Spatial Calibration window to screen position 6, 26 (near the upper-left corner of the screen).


IpSCalReset

Syntax	IpSCalReset( )
Description	This function resets the current calibration to default values.  Equivalent to clicking Defaults in the Spatial Calibration dialog box.


IpSCalSelect

Syntax	IpSCalSelect(szSCal)
Description	This function activates the selected calibration set.  Equivalent to selecting a set in the Name field in the Spatial Calibration dialog box.
Parameters	szSCal	String	A string specifying the name of the calibration set that is to be made active.
Example	ret = IpSCalSelect("Microns") This statement will activate a spatial calibration set called "Microns"
Comments	The activated calibration set becomes the calibration for the active image (if there is one), and all image windows opened thereafter.


IpSCalSetAngle

Syntax	IpSCalSetAngle(Angle)
Description	This function defines the angle offset value.  Equivalent to setting the Angle Offset value in the Spatial Calibration dialog box.
Parameters	Angle	Float	A number (of IPBASIC type, Single) specifying the offset, in degrees, from the vertical axis.
Example	ret = IpSCalSetAngle(11.15466) This statement will establish the angle offset at 11.15466 degrees from the vertical axis.


IpSCalSetAspect

Syntax	IpSCalSetAspect(AspectRatio)
Description	This function defines the spatial relationship between the horizontal and vertical axes.  Equivalent to setting the Aspect Ratio value in the Spatial Calibration dialog box.
Parameters	AspectRatio	Float	A number (of IPBASIC type, Single) representing the ratio between the X and Y axes (as defined by X/Y).
Example	ret = IpSCalSetAspect(1.50) This statement will set the aspect ratio to 1.5.


IpSCalSetName

Syntax	IpSCalSetName(szSCal)
Description	This function changes the name of the selected calibration set.  Equivalent to retyping the name in the Name field of the Spatial Calibration dialog box.
Parameters	szSCal	String	A string specifying the new name of the selected calibration set.
Example	ret = IpSCalSetName("5000x Magnification") This statement will change the name of the current calibration set to "5000x Magnification".


IpSCalSetOrigin

Syntax	IpSCalSetOrigin(x, y)
Description	This function calibrates the horizontal and vertical origin.  Equivalent to setting the Origin value in the Spatial Calibration dialog box.
Parameters	x	Float	A number (of IPBASIC type, Single) representing the offset to the X-axis.
	y	Float	A number (of IPBASIC type, Single) representing the offset to the Y-axis.
Example	ret = IpSCalSetOrigin(49, 40) This statement will set the origin at position 49,40.


IpSCalSetUnit

Syntax	IpSCalSetUnit(x, y)
Description	This function calibrates the spatial unit in both the horizontal and vertical directions.  Equivalent to setting the Pixels/Unit value in the Spatial Calibration dialog box.
Parameters	x	Float	A number (of IPBASIC type, Single) specifying the number of pixels representing a single unit in the horizontal direction.
	y	Float	A number (of IPBASIC type, Single) specifying the number of pixels representing a single unit in the vertical direction.
Example	ret = IpSCalSetUnit(65.0, 75.0) This statement will set the horizontal calibration to 65 pixels, and the vertical calibration to 75 pixels.


IpSCalSetUnitName

Syntax	IpSCalSetUnitName(UnitName)
Description	This function changes the name of the spatial unit.  Equivalent to typing a name in the Unit Name field within the Spatial Calibration dialog box.
Parameters	UnitName	String	A string specifying the unit name.
Example	ret = IpSCalSetUnitName("Microns") This statement will set the spatial unit name to "Microns".


IpSCalShow

Syntax	IpSCalShow(bShow)
Description	This function displays the Spatial Calibration dialog box.  It is also used to close the dialog box if it is open.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether to open or close the Spatial Calibration dialog box.  Where: 0  -  Closes the Spatial Calibration dialog box if it is open. 1  -  Opens the Spatial Calibration dialog box.
Example	ret = IpSCalShow(1) This statement will display the Spatial Calibration dialog box.
Comments	The dialog box must be opened before assigning and selecting spatial calibration values.


IpScanSelect

Syntax	IpScanSelect( )
Description	This function invokes the TWAIN source-selection dialog box.
See Also	IpScanShow


IpScanShow

Syntax	IpScanShow( )
Description	This function is used to open the Scan dialog box.  Equivalent to selecting the Scan command.
Comments	When this function is executed in a macro, the Scan dialog box is presented, and the system waits for user input.  At this point the user may select scanner settings and acquire images interactively.  Macro execution will resume once an image is acquired or the Cancel button is clicked.
See Also	IpScanSelect


IpSegCreateMask

Syntax	IpSegCreateMask(MaskType, MaskMethod, MaskClass)
Description	This function creates the specified mask from the current color list.  Equivalent to clicking the Make Mask button in the Color Segmentation dialog box.
Parameters	MaskType	Integer	An enumerated integer specifying how the color list is to be applied against the active image.  Must be one of the following: MASK_BILEVELNEW MASK_FOREGROUND MASK_BACKGROUND MASK_BILEVELINPLACE See definitions under Comments, below.
	MaskMethod	Integer	An index to the method used to create the mask.  Must be one of the following: 0 = Use histogram-based method. 1 = Use color cube-based method.
	MaskClass	Integer	An index to the class the mask is based on.  Specify -1 for all classes.
Example	ret = IpSegCreateMask(MASK_FOREGROUND) This statement will retain the selected colors and set all others to black.
Comments	MaskType options are as follows:
VALUE	DESCRIPTION
MASK_BILEVELNEW	Applies the color list such that all pixels possessing a color in the list are set to white (255) and all others are set to black (0).  Writes the result to a new image window.
MASK_FOREGROUND	Applies the color list such that all pixels possessing a color in the list are retained in the image and all others are set to black (0).
MASK_BACKGROUND	Applies the color list such that all pixels possessing a color in the list are set to black (0) and anything else remains in the image.
MASK_BILEVELINPLACE	Applies the color list such that all pixels possessing a color in the list are set to white (255) and all others are set to black (0).
See Also	IpSegSelect,  IpSegPreview


IpSegDelete

Syntax	IpSegDelete(ClassName, nIndex)
Description	This function delete the specific class.
Parameters	ClassName	String	A string specifying the name of the class to be deleted.   This takes precedence of nIndex parameter.
	nIndex	Integer	Index of the class to be deleted.  Ignored if ClassName is not empty string.
Example	ret = IpSegDelete (Green Object, 0), or ret = IpSegDelete (, 1)
Comments	The last class cant be deleted.
See Also	IpSegNew, IpSegRename


IpSegLoad

Syntax	IpSegLoad(ColorRangesFile)
Description	This function loads a color-range file to the active image.  Equivalent to selecting the Load Color Ranges command from the Color Segmentation window's File menu.
Parameters	ColorRangesFile	String	A string specifying the name of the file from which the color-range list will be read.
Example	ret = IpSegLoad("C:\APPNAME\HSIREDS.RGE") This statement will load the color-range list from the file HSIREDS.RGE in the \APPNAME directory on the C: drive.
Comments	The loaded color-range list will replace the current list.  If you want to add the contents of a color-range file to the current list, use the IpSegMerge function.
See Also	IpSegMerge,  IpSegSave


IpSegMerge

Syntax	IpSegMerge(ColorRangesFile)
Description	This function adds the color-range file to the current color-range list.  Equivalent to selecting the Merge Color Ranges command from the Color Segmentation window's File menu.
Parameters	ColorRangesFile	String	A string specifying the name of the file from which the color-range list will be read.
Example	ret = IpSegMerge("C:\APPNAME\HSIREDS.RGE") This statement will combine the contents of the HSIREDS.RGE file with the current color list.
Comments	The loaded color-range list will be added to the current list.  If you want to replace the current list with the contents of a color-range file, use the IpSegLoad function.
See Also	IpSegLoad,  IpSegSave


IpSegNew

Syntax	IpSegNew(ClassName)
Description	This function adds a new class to the current list.  All channel values will be reset to default.
Parameters	ClassName	String	A string specifying the name of the class to be added.   A null string will allow program to set a default name to the new class.
Example
ret = IpSegPreview (0) // no preview while adding new class

ret = IpSegNew("Green Objects")

ret = IpSegSetRange(0, 0, 255)

ret = IpSegSetRange(1, 128, 255)

ret = IpSegSetRange(2, 0, 255)

ret = IpSegPreview (1) // turn on preview

Comments	The new class will become current class.  Use IpSegSetRange to set the range of this class.
See Also	IpSegSetRange, IpSegDelete


IpSegPreview

Syntax	IpSegPreview(bShow)
Description	This function renders a preview of the active image using just the colors in the color-range list, or restores a "previewed" image to its original form.  Equivalent to the Preview and Restore buttons in the Color Segmentation dialog box.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether the image is to be rendered in "preview" mode or its original form.  Where:   0  -  Displays the image in its original form. 1  -  Displays the image in preview mode.
Example	ret = IpSegPreview(1) This statement will display the active image in segmentation-preview mode, thereby de-emphasizing any colors that are not contained in the current color list.


IpSegRename

Syntax	IpSegRename(nIndex, ClassName)
Description	This function rename a class.
Parameters	nIndex	Integer	Index of the class to be renamed.
	ClassName	String	A string specifying the name of the class to be deleted.   This takes precedence of nIndex parameter.
Example	ret = IpSegRename (0, Green Object, 0).
Comments	If index is incorrect, it will return IPCERR_INVARG.
See Also	IpSegNew, IpSegDelete


IpSegReset

Syntax	IpSegReset( )
Description	This function clears the current color list.  Equivalent to clicking Reset in the Color Segmentation dialog box.
See Also	IpSegSelect,  IpSegLoad


IpSegSave

Syntax	IpSegSave(ColorRangesFile, bUnused)
Description	This function saves the current color-range list to a file.  Equivalent to specifying a color model and selecting the Save Color Ranges command in the Color Segmentation window's File menu.
Parameters	ColorRangesFile	String	A string specifying the name of the file to which the color-range list will be written.
	bUnused	Integer	Reserved for backward compatibility
Example	ret = IpSegSave("C:\APPNAME\HSIREDS.RGE",1) This statement will save the current color-range list to a file called HSIREDS.RGE in the \APPNAME directory on the C: drive.
See Also	IpSegLoad,  IpSegMerge


IpSegSelect

Syntax	IpSegSelect(SelectionType, Sensitivity)
Description	This function adds or deletes the colors encompassed by the active AOI to/from the current color range list.  Equivalent to clicking the Select button in the Color Segmentation dialog box.
Parameters	SelectionType	Integer	An enumerated integer specifying how the colors in the active AOI are to be applied to the color list.  Must be one of the following: SEG_SELNEW SEG_SELADD SEG_SELSUBTRACT See definitions under Comments, below.
	Sensitivity	Integer	An integer from 1 to 5 (inclusive) specifying how much deviation from the selected colors is to be allowed.  5 indicates that no deviation from the specified colors will be allowed, and 1 indicates that the maximum amount of deviation will be tolerated.
Example	This set of statements will remove from the color list, just the colors contained within the elliptical AOI.  No deviation from these colors will be permitted.
ipRect.left = 22

ipRect.top = 118

ipRect.right = 43

ipRect.bottom = 162

ret = IpAoiCreateEllipse(ipRect)

ret = IpSegSelect(SEG_SELSUBTRACT, 5)

Comments	SelectionType options are as follows:
VALUE	DESCRIPTION
SEG_SELNEW	Clears the current color list and creates a new list containing the colors in the active AOI.
SEG_SELADD	Adds the colors in the active AOI to the current color list.
SEG_SELSUBTRACT	Removes the colors in the active AOI from the current color list.
	Before calling the IpSegSelect function you must have defined an AOI containing the colors that are to be added/subtracted to/from the color list.
See Also	IpSegPreview,  IpSegCreateMask


IpSegSelectArea

Syntax	IpSegSelectArea(SelectionType, Sensitivity, xPos, yPos, nSize)
Description	This function adds or deletes the colors encompassed by the area to/from the current color range list.  Equivalent to clicking the Eyedropper or Eraser button in the Color Segmentation dialog box.
Parameters	SelectionType	Integer	An enumerated integer specifying how the colors in the active AOI are to be applied to the color list.  Must be one of the following: SEG_SELNEW SEG_SELADD SEG_SEGSUBTRACT See definitions under Comments, below.
	Sensitivity	Integer	An integer from 1 to 5 (inclusive) specifying how much deviation from the selected colors is to be allowed.  5 indicates that no deviation from the specified colors will be allowed, and 1 indicates that the maximum amount of deviation will be tolerated.
	xPos	Integer	Central x coordinate of the area  where colors should be selected from the image.
	yPos	Integer	Central y coordinate of the area where colors should be selected from the image.
	nSize	Integer	Size of rectangle from which colors are selected.  Should be 3, 5 or 7.
	ret = IpSegSelectArea(SEG_SELSUBTRACT, 5, 100, 100, 5) This set of statements will remove from the color list, just the colors contained in the image rectangle (98, 98, 102, 102).  No deviation from these colors will be permitted.
Comments	SelectionType options are as follows:
VALUE	DESCRIPTION
SEG_SELNEW	Clears the current color list and creates a new list containing the colors in the active AOI.
SEG_SELADD	Adds the colors in the active AOI to the current color list.
SEG_SEGSUBTRACT	Removes the colors in the active AOI from the current color list.
	Before calling the IpSegSelect function you must have defined an AOI containing the colors that are to be added/subtracted to/from the color list.
See Also	IpSegPreview,  IpSegCreateMask


IpSetSetAttr
IpSegSetAttr

Syntax	IpSegSetAttr(AttrType, AttrValue)
Description	This function set the channels range values of current class in the histogram-based segmentation.
Parameters	AttrType	Integer	An enumerated integer specifying the option to be set.  Must be one of the following: COLORMODEL ADVANCED CHANNEL SETCURSEL SEGMETHOD See definitions under Comments, below.
	AttrValue	Float	An integer specifying how the AttrType option is to be set. See definitions under Comments, below, for the values allowed by each option.
Example	ret = IpSegSetAttr (COLORMODEL, CM_HSI). This statement changes the color model used in histogram-based segmentation to HSI.
Comments	AttrType options as follows:
AttrType	DESCRIPTION	ALLOWED VALUES
COLORMODEL	Select the color model in which the histogram-based segmentation is based on.	CM_RGB CM_HSI
ADVANCED	Show the dialog in advanced mode.	0 - In regular mode 1 - In advanced mode.
CHANNEL	Select the active channel for display purpose in the histogram-based segmentation.  This only applies to RGB image.	0 - Channel 1 1 - Channel 2 2 - Channel 3
SETCURSEL	Set the current selected class.	0-based index  (0 to NumOfClasses - 1)
SEGMETHOD	Used method to do the segmentation. This only applies to RGB image.	0 - Histogram-based 1 - Color Cube-based
See Also	IpSegPreview,  IpSegCreateMask


IpSegSetRange

Syntax	IpSegSetRange(nChannel, FromVal, ToVal)
Description	This function set the channels range values of current class in the histogram-based segmentation.
Parameters	nChannel	Integer	The channel index.
	FromVal	Float	The starting point of the range.
	ToVal	Float	The ending point of the range.
Example	See IpSegNew for example.
Comments	Turn off and on the preview before and after you set all values to avoid unnecessary overlay redraw.
See Also	IpSegSelectArea


IpSeqMerge

Syntax	IpSeqMerge(FileName, FileFormat, StartFrame, NumFrames)
Description	This function appends one or more images in FileName into the currently active sequence.
Parameters	FileName	String	Indicates the name of the file containing the image sequence to be merged.
	FileFormat	String	Indicates the format of the image sequence,  ( i.e.TIF, BMP).
	StartFrame	Integer	An integer specifying the first frame in the sequence that will be merged i.e. O, 1, 2, etc.
	NumFrames	Integer	An integer specifying the total number of frames that will be merged.
Example	ret = IpSeqMerge ("ASequence", 0,3) This statement merges 3 frames from the sequence file ASequence starting with frame 0, into the current sequence.
Comments	Recording Acquire/SeqFile/Merge Image creates an IpSeqMacro for each file in the list, and addes (…-1, -1) for the last two parameters.
See Also	IpSeqPlay IpSeqOpen IpSeqSave


IpSegShow

Syntax	IpSegShow(bShow)
Description	This function is used to open or close the Color Segmentation command window.  Equivalent to selecting the Color Segmentation command to open the window, and clicking the Close button within it to close it.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether the Color Segmentation command window is to be shown.  Where: 0  - Closes the window if it is already open. 1  - Opens the window.
Example	ret = IpSegShow(1) This statement will make the Color Segmentation command window visible during execution of the macro.
Comments	The Color Segmentation command window does not have to be open during execution of the segmentation functions.  Its disposition, visible or hidden, is entirely your choice.  You will want to display the window if your users will be required to make choices within it, but if your objective is simply to obtain a mask, you may want to run without opening it.


IpSeqOpen

Syntax	IpSeqOpen(FileName, FileFormat, StartFrame, NumFrames)
Description	This function opens an image sequence.
Parameters	FileName	String	Indicates the name of the file holding the image sequence to be opened.
	FileFormat	String	Indicates the format of the image sequence.
	StartFrame	Integer	An integer specifying the first frame in the sequence that will be opened i.e. O, 1, 2, etc.
	NumFrames	Integer	An integer specifying the total number of frames to read in.
Example	ret = IpSeqOpen ("ASequence", "TIF",2,5) This statement opens 5 frames from the sequence file ASequence starting with frame 2
See Also	IpSeqPlay IpSeqMerge IpSeqSave


IpSeqPlay

Syntax	IpSeqPlay (PlayCommand)
Description	This function runs an image sequence.
Parameters	PlayCommand	Integer	An integer specifying how to play the specified sequence. Must be one of the following: SEQ_STOP stop play SEQ_FOR play sequence forward SEQ_REV play sequence in reverse SEQ_FFOR play sequence in fast forward SEQ_FREV play sequence in fast reverse SEQ_FFRA jump to first frame SEQ_LFRA jump to last frame SEQ_PREV move to previous frame SEQ_NEXT move to next frame
Example	ret = IpSeqPlay(SEQ_FOR) This statement starts a sequence playing.
See Also	IpSeqOpen IpSeqMerge IpSeqSave


IpSeqSave

Syntax	IpSeqSave(FileName, FileFormat, StartFrame, NumFrames)
Description	This function saves an image sequence to a file.
Parameters	FileName	String	Indicates the name of the file holding the image sequence to be saved
	FileFormat	String	Indicates the format of the image sequence.  Must be a TIF file.
	StartFrame	Integer	An integer specifying the first frame in the sequence that will be savedi.e. O, 1, 2, etc.
	NumFrames	Integer	An integer specifying the number of frames to save.
Example	ret = IpSeqSave("TestSequence", "TIF", 0,4) This statement saves the current sequence as TestSequence, starting from frame 0 and saving 4 frames.
See Also	IpSeqOpen IpSeqMerge IpSeqPlay


IpStAutoName

Syntax	IpStAutoName(Format, Number, FileName)
Description	This function generates a file name by combining a character string that you provide with the string value of an integer variable.  It is typically used to create file names automatically in a loop that processes and saves multiple images (e.g., IMAGE001, IMAGE002, IMAGE003...).  There is no equivalent to this function; it is one that must be manually edited into your macro.
Parameters	Format	String	A string specifying the literal characters that are to make up the file name, and the position at which the number is to be inserted.  The "#" character is used to represent the insert position for the numeric digits.  See Example and Comments, below.
	Number	Integer	An integer specifying the number that is to be converted into a string and combined with Format to create the file name.
	FileName	String	The name of a fixed-length, string variable into which the final file name will be written.
Comments	The "#" character in the format string is used to denote the position at which the numeric digits are to be inserted.  Multiple "#" characters can be used to specify that the number be expanded, with leading zeros if necessary, to fill all #- marked positions (see examples above). Take care not to generate a file name that is longer than that allowed by DOS.  The IpStAutoName function does not do any error checking for length.  Before calling IpStAutoName, the variable into which the file name is written must be declared as a fixed-length string (be sure to allocate sufficient space for it).  In the example above, this was done with the Dim Iname As String * 255 statement.
Example	The set of statements above will capture, enhance and save 10 images.  The file name will be composed by the IpStAutoName function and stored to a variable called
	Iname.  This variable is then specified in the FileName parameter of the IpWsSaveAs statement.  The ten file names generated will be:  EXP1.TIF to EXP10.TIF. IpStAutoName("C:\APPNAME\IMAGES\EXP###B.tif",  X, Iname) If the statement above were used in the first example, the numeric digits would occupy three places in the file name, and the ten file names would be: EXP001B.TIF to EXP010B.TIF. IpStAutoName("C:\APPNAME\IMAGES\###EXP.tif",  X, Iname) If the statement above were used in the first example, the numeric digits would occupy the first three places in the file name, and the ten file names would be: 001EXP.TIF to 010EXP.TIF.
Dim X As Integer

Dim Iname As String * 255

For X = 1 To 10

ret = IpAcqSnap(ACQ_CURRENT)

ret = IpHstEqualize(EQ_BESTFIT)

ret = IpStAutoName("C:\APPNAME\IMAGES\EXP#.TIF",  X, Iname)

ret = IpWsSaveAs(Iname, "TIF")

ret = IpDocClose()

Next


IpStGetFloat

Syntax	IpStGetFloat(Prompt, FloatRet, InitVal, MinVal, MaxVal, IncVal)
Description	This function issues a dialog box that prompts the user for a floating-point value.  There is no equivalent to this function; it is one that must be manually edited into your macro.
Parameters	Prompt	String	A string specifying the message to be displayed in the dialog box.
	FloatRet	Float (Basic) LPFLOAT (C)	The address (name) of the floating-point variable that will receive the value entered by the user.
	InitVal	Float (Basic) LPFLOAT (C)	The initial (default) floating-point value.
	MinVal	Float (Basic) LPFLOAT (C)	The smallest value that can be entered by the user.
	MaxVal	Float (Basic) LPFLOAT (C)	The largest value that can be entered by the user.
	IncVal	Float (Basic) LPFLOAT (C)	The increment by which the value will be increased or decreased by one click of the · or · button, respectively, in the dialog box.
Return Value	This function will return a 1 if user clicks OK; a 0 if the user clicks "Cancel."
Example	The following example prompts the user for a gamma value.
Dim GValue as single

ret=IpStGetFloat("Enter gamma value",GValue,1.0,0.2, 2.5, 0.1)

if ret=1 Then	' user pressed OK

   ret = IpLutSetAttr(LUT_GAMMA, GValue * 100)

End If

See Also	IpStGetString,  IpStGetInt,  IpMacroStop


IpStGetInt

Syntax	IpStGetInt(Prompt, IntRet, InitVal, MinVal, MaxVal)
Description	This function issues a dialog box that prompts the user for an integer value.  There is no equivalent to this function; it is one that must be manually edited into your macro.
Parameters	Prompt	String (Basic) LPSTR (C)	A string specifying the message to be displayed in the dialog box.
	IntRet	Integer	The address (name) of the integer variable that will receive the value entered by the user.
	InitVal	Integer	The initial (default) integer value.
	MinVal	Integer	The smallest value that can be entered by the user.
	MaxVal	Integer	The largest value that can be entered by the user.
Return Value	This function will return a 1 if user clicks OK; a 0 if the user clicks Cancel.
Example	The following example prompts the user for a filter strength.
Dim FtrStrength as integer

ret=IpStGetInt("Enter filter strength",FtrStrength,5,1,10)

if ret=1 then	'user pressed OK

   	ret=IpFltLoPass(3,FtrStrength,1)

End If

See Also	IpStGetString,  IpStGetFloat,  IpMacroStop


IpStGetString

Syntax	IpStGetString(Prompt, RetString, MaxLen)
Description	This function issues a dialog box that prompts the user for a string.  There is no equivalent to this function; it is one that must be manually edited into your macro.
Parameters	Prompt	String	A string specifying the message to be displayed in the dialog box.
	RetString	String	The address (name) of  a fixed-length, string variable that will receive the string entered by the user.
	MaxLen	Integer	The maximum number of characters that can be stored in RetString.
Return Value	This function will return a 1 if user clicks OK; a 0 if the user clicks Cancel.
Example	The following example prompts the user for a file name.
Dim filename as string * 20

ret = IpStGetString("Please enter file name", filename, 20)

if ret = 1 then	' user pressed OK

.

.

.

End If

Comments	In BASIC, RetString should be pre-dimensioned to at least the length specified in  MaxLen.
See Also	IpStGetInt,  IpStGetFloat,  IpMacroStop


IpStGetName

Syntax	IpStGetName(Title, Default, Filter, Filename)
Description	This function displays a standard "Open File" dialog box to prompt the user for a file name.  There is no equivalent to this function; it is one that must be manually edited into your macro. Note - this function will return a 0 if the user cancels the dialog box.
Parameters	Title	String	A string that will appear as the Title of the "Open File" dialog box.
	Default	String	A string specifying the directory for which the "Open File" dialog box will be opened.
	Filter	String	A pattern string specifying the types of file names to be listed in the dialog box.  The standard DOS wildcard characters can be used to define this pattern string (e.g.," *.*",  "*.TIF", "IMG*.TIF").  A zero-length string (e.g., "") defaults to a pattern of "*.*".
	Filename	String	The name of a fixed-length, string variable into which the file name, selected by the user, will be written.
Example	This set of statements will open, enhance and save each image selected by the user, until the user clicks the Cancel button in the "Select Slide" dialog box.
Dim Iname As String * 255

Dim More As Integer = IpStGetName("Select Slide","C:\RESULTS","*.TGA", Iname)

Do While More <> 0

ret = IpWsLoad(Iname, "TGA")

ret = IpHstEqualize(BEST_FIT)

ret = IpWsSave()

ret = IpDocClose()

More = IpStGetName("Select Slide","C:\RESULTS",*.TGA",Iname)

Loop

Comments	The return code for this function denotes whether the user has selected a file or clicked Cancel.  You can use this return code to determine when to end a loop that is being applied to all images selected by a user (see example above).  Be sure to assign the return code to a variable other than the one used by the other functions in your macro (i.e., do not use ret).  If the name is not unique, there is no guarantee that it is IpStGetName's return code that you are testing. Before calling IpStGetName, the variable into which the file name is written must be declared as a fixed-length string (be sure to allocate sufficient space for it).  In the example above, this was done with the Dim Iname As String * 255 statement.


IpStSearchDir

Syntax	IpStSearchDir(Directory, Filter, Number, Filename)
Description	This function obtains a file's name from its position in a directory list.  It can be used to process the entire contents of a directory.  There is no equivalent to this function; it is one that must be manually edited into your macro.
Parameters	Directory	String	A string specifying the directory from which file names are to be obtained.
	Filter	String	A pattern string specifying the types of file names that are to be included when the directory is searched.  The standard DOS wildcard characters can be used to define this pattern string (e.g.," *.*",  "*.TIF", "IMG*.TIF").  A zero-length string (e.g., "") defaults to a pattern of "*.*".   The specified pattern is used to produce the list of files referenced by the Number parameter.
	Number	Integer	An integer specifying the entry in the directory list (as produced by Filter) for which the file name is to be obtained.  The first position in the list is considered position 0.
	Filename	String	The name of a fixed-length string variable into which the file name will be written.
Return Value	This function will return special integer values to indicate whether a file name was found at the specified position.  This return code can be tested by your macro to determine whether you want to process the contents of FileName.  The possible return values are:
A Return Value Of...	Means That...
0	There is no entry at the specified position.
1	The specified position contains a file name.  The name of the file will be written to the variable specified in FileName.
2	The specified position contains a subdirectory entry.  The name of the subdirectory will be written to the variable specified in FileName.
3	The specified position contains a Volume Label.  The Volume ID will be written to the variable specified in FileName.
Example	The set of statements below will open, enhance and save all TIF images in the C:\APPNAME\IMAGES directory.
Dim X As Integer

Dim DStat As Integer

Dim Iname As String * 255

X = 0

DStat = IpStSearchDir("C:\APPNAME\IMAGES","*.TIF", X, Iname)

Print Dstat,Iname

Do While DStat = 1

ret = IpWsLoad(Iname, "TIF")

ret = IpHstEqualize(EQ_BESTFIT)

ret = IpWsSave()

ret = IpDocClose()

X = X + 1

DStat = IpStSearchDir("C:\APPNAME\IMAGES", "*.TIF", X, Iname)

Print DStat,Iname

Loop

ret = IpStSearchDir("C:\APPNAME\IMAGES","*.*", 2, Iname)

ret = IpWsLoad(Iname, " ")

The pair of statements above will load the first file in the C:\APPNAME\IMAGES directory.

Comments	Before calling IpStSearchDir, the variable into which the file name is written must be declared as a fixed-length string (be sure to allocate sufficient space for it).  In the first example above, this was done with the Dim Iname As String * 255 statement. The first example also shows how to test the return code to determine when to end a loop that is to be applied to all images in a directory list.  Be sure to assign the return code to a variable other than the one used by the other functions in your macro (i.e., do not use ret).  If the name is not unique, there is no guarantee that it is IpStSearchDir's return code you are testing. If you are using IpStSearchDir to process an entire subdirectory list (i.e., Filter specifies "*.*") consider starting your search at entry position 2, as positions 0 and 1
	generally contain directory entries — 0 contains the subdirectory's entry (i.e., ".") and 1 contains the parent directory's entry (i.e., "..").  If you choose to begin your search at position 0, be sure to include instructions that test IpStSearchDir's return code and take appropriate action if a subdirectory or volume ID is encountered.


IpTagAttr

Syntax	IpTagAttr (bAttr, Value)
Description	This function turns the Manual Tagging options on or off.
Parameters	bAttr	Integer	Identifies the measurement option. See definitions under comments, below
	Value	Integer	Specifies how the option for Attrbute should be set. See definitions under comments, below
Comments	Command	Value	Description
	TAG_VIEW_COUNTS TAG_VIEW_POINTS TAG_VIEW_CLASSSTATS	1 or 0	1 = turn option on 0 = no effect
	TAG_VIEW_AREA TAG_VIEW_MARKER TAG_VIEW_LABEL TAG_MEAS_XPOS TAG_MEAS_YPS TAG_MEAS_INTENSITY TAG_MEAS_CLASS TAG_MEAS_RED TAG_MEAS_GREEN TAG_MEAS_BLUE TAG_MEAS_AREA	1 or 0	1 = turn option on 0 = turn option off
	TAG_MEAS_RADIUS	integre 1-15	Set area radius to value. Valid values are integers 1-15
Example
Sub mtagAttrXpos()

ret = IpTagAttr(TAG_MEAS_XPOS, 0)

ret = IpTagAttr(TAG_MEAS_XPOS, 1)

ret = IpTagAttr(TAG_MEAS_YPOS, 0)

End Sub

Sub mtagAttrRadius()

ret = IpTagAttr(TAG_MEAS_AREA, 1)

ret = IpTagAttr(TAG_MEAS_AREA, 0)

ret = IpTagAttr(TAG_MEAS_AREA, 1)

ret = IpTagAttr(TAG_MEAS_RADIUS, 7)

ret = IpTagAttr(TAG_MEAS_RADIUS, 8)

End Sub

Sub mtagAttrView()

ret = IpTagAttr(TAG_VIEW_LABEL, 0)

ret = IpTagAttr(TAG_VIEW_AREA, 1)

ret = IpTagAttr(TAG_VIEW_MARKER, 0)

ret = IpTagAttr(TAG_VIEW_MARKER, 1)

End Sub

Sub mtagAttrShow()

ret = IpTagAttr(TAG_VIEW_MARKER, 1)

End Sub

Sub mtagAttrHide()

ret = IpTagAttr(TAG_VIEW_MARKER, 0)

End Sub

Sub mtagViewCounts()

ret = IpTagAttr(TAG_VIEW_COUNTS, 1)

End Sub

Sub mtagViewPoints()

ret = IpTagAttr(TAG_VIEW_POINTS, 1)

End Sub

Sub mtagViewStats()

ret = IpTagAttr(TAG_VIEW_CLASSSTATS, 1)

End Sub


IpTagDelete

Syntax	IpTagDelete( index)
Description	This function deletes the marker number index, or all markers if index = -1.
Parameters	index	Integer	Index of the tag to be deleted.
Example
Sub mtagDelete()

ret = IpTagDelete(9)

ret = IpTagDelete(5)

End Sub

Sub mtagDeleteAll()

ret = IpTagDelete(-1)

End Sub


IpTagGet

Syntax	IpTagGet(Cmd, wParam, lpParam)
Description	This function  gets the specified markers.
Parameters	Cmd	Integer	see comments below
	wParam	Integer	see comments below
	lpParam	Any	see comments below
Comments	Cmd	wParam	lpParam
	GETNUMPTS	class index	pointer to floating-type variable
		-1	returns totol number of markers
		other	returns totol number of markers in class wParam
	GETNUMCLASS	not used	return class number in lpParam
	GETPOINTS	point index starting from 0	return x ,y, class, intensity, red, green, blue values in lpParam (0) through lpParam (6) Note: lpParam must point to an array of 7 real numbers.
	GETSTATS	not used	lpParam[0] = min lpParam [1] = max lpParam[2] = average number of  markers lpParam[3] = standard deviation lpParam[4] = total number of markers Note: lpParam must point to an array of 5 real numbers.
Return Value	IPCERR_NOTFOUND: information not available. IPCERR_INVARG: invalid argument IPCERR_NONE: no error


IpTagLoadEnv

Syntax	IpTagLoadEnv(PointsFile)
Description	This function loads environment setting information from the points file.
Parameters	PointsFile	String	Name of the file where the environment setting information is stored.
Example	Sub mtagLoadEnv() ret = IpTagLoadEnv("C:\IPWSRC\TEST.TAG") End Sub


IpTagLoadPoints

Syntax	IpTagLoadPoints(PointsFile)
Description	This function loads marker information from the points file and displays the markers.
Parameters	PointsFile	String	Name of the file where the point information is stored.
Example
Sub mtagLoadPoints()

ret = IpTagLoadPoints("C:\IPWSRC\JUNK.TAG")

End Sub

See Also	IpTagSavePoints


IpTagPt

Syntax	IpTagPt(XPos, YPos, PointClass)
Description	This function attaches marker information  to the image. Identical to the Tag Points command in the Manual Point Count dialog.
Parameters	XPos	Integer	Location of the point on the (virtual) x-axis of the image.
	YPos	Integer	Location of the point on the (virtual) y-axis of the image.
	PointClass	Integer	Indicates the class of the point to be marked.
See Also	IpTagLoadPoints


IpTagSaveData

Syntax	IpTagSaveData(DataFile,saveMode)
Description	Save measurement results( x,y, intensity ,RGB values,statistics, etc.) into the data file.
Parameters	DataFile	String	When saving data to a file, indicates the path and name of the file.
	saveMode	Integer	Must be one of the following: S_HEADER = save with header S_X_AXIS = save with the left column S_CLIPBOARD = copy table to clipboard S_DDE = send table contents to external program via  DDE (Excel is the default) S_APPEND = append to the existing file
Comments	saveMode values can be "Or'd" together (see example below)
Example
IpTagSaveData ("C:\APPNAME\data.cnt", S_APPEND+S_HEADER+S_X_AXIS)

Sub mtagSaveData()

ret = IpTagSaveData("C:\IPWSRC\TEST.CNT",  S_APPEND+S_HEADER+S_X_AXIS)

End Sub

Sub mtagClipbrd()

ret = IpTagSaveData("", S_CLIPBOARD+S_HEADER+S_X_AXIS)

End Sub


IpTagSaveEnv

Syntax	IpTagSaveEnvs(Filename)
Description	This function saves the current environment setting (i.e. class information)  into the named file.
Parameters	Filename	String	Name of the file where the environment  information is stored.
Example
Sub mtagSaveEnv()

ret = IpTagSaveEnv("C:\IPWSRC\JUNK.TAG")

End Sub

Comments	IpTagLoadEnv


IpTagSavePoints

Syntax	IpTagSavePoints(PointsFile)
Description	Save marker information in a file.
Parameters	PointsFile	String	Name of the file to store marker information.
Example
Sub mtagSavePoints()

ret = IpTagSavePoints("C:\IPWSRC\JUNK.TAG")

End Sub

See Also	IpTagLoadPoints


IpTagShow

Syntax	IpTagShow(bShow)
Description	Opens or closes the Manual Tagging window.
Parameters	bShow	Integer	If bShow =1, opens the window If bShow = 0, closes the window
Example
Sub mtagShow()

ret = IpTagShow(1)

End Sub

Sub mtagHide()

ret = IpTagShow(0)

End Sub


IpTagUpdate

Syntax	IpTagUpdate( )
Description	This function updates the manual tagging window display.
Example
Sub mtagUpdate()

ret = IpTagUpdate()

End Sub


IpTemplateMode

Syntax	IpTemplateMode(OnOff)
Description	This function turns template mode on or off.  When template mode is on, the user may pass parameter values to the macro via a standard dialog box.  If parameter values are included in the Auto-Pro function statement, they will be used as default values to the dialog box, which the user may accept or change.  Macro execution will not proceed until the user has completed and closed the dialog box, or clicked "Continue" in the template-mode message box. When template mode is off, Auto-Pro functions are performed using the parameter data supplied in the macro.
Parameters	OnOff	Integer	An integer value of 0 or 1 specifying whether subsequent Auto-Pro functions are to be performed in template mode.  Where: 0 - Disables template mode. 1 - Enables template mode.
Example	In this example, template mode is first enabled to allow the user to select the file upon which the rest of the macro will operate.  Once the user selects an image, template mode is turned off to allow the remainder of the macro to run automatically.
ret = IpTemplateMode(1)

ret = IpWsLoad("C:\APPNAME\IMAGES\IMAGE1.TIF", "TIF")

ret = IpTemplateMode(0)

ret = IpWsScale(200, 300, 1)

ret = IpHstEqualize(EQ_BESTFIT)

ret = IpFltSharpen(3, 3, 2)

See Also	IpMacroStop


IpTextBurn

Syntax	IpTextBurn(Text, Pos)
Description	Burns the text into the image using the selected font name, size, text attributes, and currently selected foreground and background colors.
Parameters	Text	String	Contains the text to burn into the image.
	Pos	POINTAPI	Coordinate of the top left corner of the string in image coordinate.
Example
Sub Annotate()

ret = IpTextFont("Wide Latin", 30)

ret = IpTextAttr(TXT_BOLD, 1)

ret = IpTextAttr(TXT_UNDERLINE, 1)

ret = IpTextAttr(TXT_ITALIC, 0)

ret = IpTextAttr(TXT_STRIKEOUT, 0)

ret = IpTextAttr(TXT_ENCLOSED, 0)

ret = IpTextAttr(TXT_DROPSHADOW, 0)

ret = IpTextAttr(TXT_SPACING, 0)

Pts(0).x = 51

Pts(0).y = 41

ret = IpTextBurn("Test Image", Pts)

End Sub

Comments	IpText macro does not require the Text window to be visible in order to run. IpTextBurn runs the following functions: IpTextFont, IpTextSetAttr, IpTextShow, IpTrackBar.
See Also	IpTextFont, IpTextSetAttr, IpTextShow


IpTextFont

Syntax	IpTextFont (FontName,FontSize)
Description	Sets the font name and size for the text.
Parameters	FontName	String	Name of the font (i.e.Times New Roman)
	FontSize	Integer	Point size of the font (i.e.12 points)
Example	ret = IpTextFont("Wide Latin", 30)
Comments	When printed, the size of the text will be the same as specified in FontSize.  However, the size of the text on the screen is affected by the resolution of the image.  The text will appear bigger on a 300 DPI image than on 100 DPI image.
See Also	IpTextBurn, IpTextSetAttr, IpTextShow


IpTextSetAttr

Syntax	IpTextSet Attr(AttrType, AttrValue)
Description	This function selects text attribute value.
Parameters	AttrType	Integer	Attribute type is one of the following: TXT_BOLD  Bold=1, normal=0 TXT_UNDERLINE  Underline=1, normal=0 TXT_ITALIC  Italic=1, normal=0 TXT_STRIKEOUT  Strike Out=1, normal=0 TXT_DROPSHADOW  Drop shadow=1, normal=0 TXT_ENCLOSED  Sets text color to background  color=1,  transparent=0 TXT_SPACING   Inter-character spacing=0 to 100
	AttrValue	Integer	Value for AttrType.
Example	ret = IpTextAttr(TXT_BOLD, 1)
See Also	IpTextBurn, IpTextFont


IpTextShow

Syntax	IpTextShow (Show)
Description	This function is used to open or close the Text window.  Equivalent to selecting the Show Text command to open the window, and double-clicking its control box to close it.
Parameters	Show	Integer	0 Closes the Text window 1 Opens the Text window
Example	Example: ret = IpTextShow(1)
Comments	This statement will open the Text window if it is not already open; if already open, it has no effect.
See Also	IpTextBurn, IpTextFont


IpTrackBar

Syntax	IpTrackBar(Cmd, tValue, sCaption)
Description	This function manages the progress bar at the bottom of the application window.  The progress bar can be used to illustrate the degree of completion of a user-defined process.  It also allows the user to abort your process with the Esc key.  There is no command equivalent to this function; it is one that must be manually written with the macro editor.
Parameters	Cmd	Integer	A command ID, which is used to open, update and close the progress bar.  Must be one of the following: TBOPEN TPUPDATE TBCLOSE See definitions under Comments, below
	tValue	Integer	An integer specifying data with which Cmd will operate.  See definitions under Comments, below, for the values required by each command
	sCaption	String	A string that will be used as the caption for the progress bar.  This parameter is used when Cmd is set to TBOPEN.  It is ignored, otherwise (when this is the case, just set sCaption to an empty string — i.e., "").
Example	The following example uses the progress bar to show the progress of a pixel inversion operation.
Dim BarTitle as String

Dim yLine As Integer, xPix As Integer

Dim iInfo as IPDOCINFO

ret = IpDocGet(GETDOCINFO,DOCSEL_ACTIVE,iInfo)

Redim ImBuf(1 To iInfo.Width,1 To iInfo.Height) As Integer

ret = IpDocGetArea(DOCSEL_ACTIVE,iInfo.Extent,ImBuf(1,1),0)

BarTitle = "Inverting Image"

ret = IpTrackBar(TBOPEN,iInfo.Height,BarTitle)

For yLine = 1 To iInfo.Height

For xPix = 1 To iInfo.Width - 1

ImBuf(xPix,yLine) = 255 - ImBuf(xPix,yLine)

Next xPix

If IpTrackBar(TBUPDATE, yLine - 1, "") <> 0 Then

GoTo userabort

End If

Next yLine

ret = IpDocPutArea(DOCSEL_ACTIVE,iInfo.Extent,ImBuf(1,1),0)

ret = IpAppUpdateDoc(DOCSEL_ACTIVE)

userabort:

ret = IpTrackBar(TBCLOSE,0,"")

Comments	Cmd options are as follows:
Cmd VALUE	DESCRIPTION	tValue VALUE
TBOPEN	Opens the progress bar indicator with the specified caption, and sets the range of possible update values	The range of possible update values.
TPUPDATE	Updates the length of the progress bar based upon the value specified in tValue, relative to the range that was specified in TBOPEN.	A value between 0 and (range - 1) that represents the degree of completion at that point.
TBCLOSE	Closes (removes) the progress bar.	Not used by TBCLOSE.  Must be 0.


IpWsChangeDescription

Syntax	IpWsChangeDescription(DescriptionType, Description)
Description	This function sets or changes the descriptive information associated with the active image.  Equivalent to setting the Title, Artist, Date and Comments fields with the Info command.
Parameters	DescriptionType	Integer	An enumerated integer specifying the descriptive field to which the string in the  Description parameter is to be applied.  Must be one of the following: INF_TITLE INF_ARTIST INF_DATE INF_DESCRIPTION INF_NAME These options correspond to the "Information" dialog box's "Title", "Artist", "Date" ,"Comments", and "Name" fields, respectively.
	Description	String	The string that is to be written to the field specified in DescriptionType.
Example	ret = IpWsChangeDescription(INF_DATE, "1994:01:05") This statement will set the "Date" field to "1994:01:05".
See Also	IpWsChangeInfo


IpWsChangeInfo

Syntax	IpWsChangeInfo(InfoType, Info)
Description	This function assigns a logical DPI value to the active image.  Equivalent to setting the Dots/Inch X and Dots/Inch Y fields with the Info command.
Parameters	InfoType	Integer	An enumerated integer selecting the DPI field that is to be set.  Must be one of the following: INF_DPIX INF_DPIY These options correspond to the Dots/Inch X and Dots/Inch Y fields, respectively.
	Info	Integer	An integer specifying the DPI value that is to be set.
Example	ret = IpWsChangeInfo(INF_DPIX, 300)  This statement will set the Dots/Inch X field to 300.
See Also	IpWsChangeDescription


IpWsConvertFile

Syntax
IpWsConvertFile(DstFile, DstFormat, SrcFile, SrcFormat, Compr, imClass, HalfType, HalfOpt, Dpi)

Description	This function converts the specified file to a new format.  Equivalent to the Batch Conversion command.
Parameters	DstFile	String	A string specifying the name of the file to which the converted image data will be written.
	DstFormat	String	A string specifying the format in which the converted data will be written.  See IpWsSaveAs for valid file format strings.
	SrcFile	String	A string specifying the name of the file that is to be converted.
	SrcFormat	String	A string specifying the format of the source file.  See IpWsSaveAs for valid file format strings.
	Compr	Integer	An enumerated integer specifying the compression method that is to be applied to the converted image.  Must be one of the following: IFFCOMP_NONE IFFCOMP_DEFAULT IFFCOMP_RLE IFFCOMP_CCITT1D IFFCOMP_CCITTG3 IFFCOMP_CCITTG4 IFFCOMP_LZW IFFCOMP_LZWHPRED See definitions under Comments, below. Take care to specify a compression method that is valid for the specified FileFormat.  To determine which methods are valid, select file format and class in the"Batch File Conversion dialog box, and review the options presented in the Compression list box.
	imClass	Integer	An enumerated integer specifying the class to which the image is to be converted.  Must be one of the following: IFFCL_BILEVEL IFFCL_GRAY IFFCL_PALETTE IFFCL_RGB Take care to specify a class that is valid for the specified FileFormat.  To determine which classes are valid, select the file format in the Batch File
			Conversion dialog box, and review the options presented in the Image Class list box.
	HalfType	Integer	An integer from 0 to 6 specifying the halftone screen/method to be used when the imClass parameter is set to 1.  Where: 0  - Angle Dot Screen 1  - Flat Dot Screen 2  - Angle Line Screen 3  - Horz Line Screen 4  - Vert Line Screen
			5  - Error Diffusion 6  - Threshold This parameter is ignored when the imClass parameter is other than IFFCL_BILEVEL.  When this is the case, just set HalfType to 0.
	HalfOpt	Integer	An integer from 0 to 3 specifying the screen resolution or halftone option to be used when the imClass parameter is set to 1.  Where: For HalftoneType values of 0 - 4: 0  - Largest LPI value 1  - Second-largest LPI value 2  - Second-smallest LPI value 3  - Smallest LPI value For HalftoneType values of 5: 0  - 4 Weights 1  - 12 Weights 2  - Fuzzy 3  - Random This parameter is ignored if the imClass parameter is other than IFFCL_BILEVEL, or when HalftoneType is set to 6.  When this is the case, just set HalfOpt to 0.
	Dpi	Integer	An integer specifying the resolution at which the image is to be halftoned. This parameter is ignored if the imClass parameter is other than IFFCL_BILEVEL, or when HalftoneType is set to 6.  When this is the case, just set Dpi to 0.
Example	ret = IpWsConvertFile("abc.bmp","BMP","abc.tif","TIF",IFFCOMP_RLE,IFFCL_GRAY,0,0,0) This statement will convert file ABC.TIF to a Gray Scale, BMP format, using RLE compression.  The values in the last three parameters (i.e., 0,0,0) are ignored  because the image is not being converted to IFFCL_BILEVEL.
Comments	Compr values are as follows:
VALUE	DESCRIPTION
IFFCOMP_NONE	Applies no compression.
IFFCOMP_DEFAULT	Applies default compression for the selected format.
IFFCOMP_RLE	Applies Run Length Encoding.
IFFCOMP_CCITT1D	Applies CCITT modified Huffman  1-Dimension encoding.
IFFCOMP_CCITTG3	Applies CCITT Group 3 Fax encoding.
IFFCOMP_CCITTG4	Applies CCITT Group 4 encoding.
IFFCOMP_LZW	Applies Lempel-Zif & Welch encoding.
IFFCOMP_LZWHPRED	Applies Lempel-Zif & Welch encoding with horizontal differencing.


IpWsConvertToBilevel

Syntax	IpWsConvertToBilevel(HalftoneType, Screen, OutputDpi)
Description	This function converts the image to a 1-BPP, Black and White image, using your choice of halftoning methods.  Equivalent to selecting Bilevel with the Convert To command.
Parameters	HalftoneType	Integer	An integer from 0 - 6 specifying the halftoning method to be used.  Where: 0  -  Angle Dot Screen 1  -  Flat Dot Screen 2  -  Angle Line Screen 3  -  Horz Line Screen 4  -  Vert Line Screen 5  -  Error Diffusion 6  -  Threshold
	Screen	Integer	An integer from 0 to 3 specifying the screen resolution or halftone option to be used.  Where: For HalftoneType values of 0 - 4: 0  - Largest LPI value 1  - Second-largest LPI value 2  - Second-smallest LPI value 3  - Smallest LPI value For HalftoneType values of 5: 0  - 4 Weights 1  - 12 Weights 2  - Fuzzy 3  - Random This parameter is ignored when HalftoneType is 6.  When this is the case, just set Screen to 0.
	OutputDpi	Integer	An integer specifying the resolution at which the image is to be halftoned. This parameter is ignored if the imClass parameter is other than IFFCL_BILEVEL, or when HalftoneType is set to 6.  When this is the case, just set OutputDpi to 0.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A -1 is returned when an error occurs.
Example	ret = IpWsConvertToBilevel(0, 0, 100) This statement will convert the image to Bilevel, using Angle Dot Screen halftoning with the largest screen, and 100 DPI output.


IpWsConvertToFloat

Syntax	IpWsConvertToFloat( )
Description	This function converts the image to a floating-point Gray Scale image, with values ranging from 0.0 to 255.0.  Equivalent to selecting Floating Point with the Convert To command.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.


IpWsConvertToGray

Syntax	IpWsConvertToGray( )
Description	This function converts the image to an 8-BPP Gray Scale image.  Equivalent to selecting Gray Scale with the Convert To command.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.
Comments	If you are converting a 12-bit image to 8-bits and you want to limit the range of values that are converted, use IpWsGray12To8.
See Also	IpWsGray12To8


IpWsConvertToGray12

Syntax	IpWsConvertToGray12( )
Description	This function converts the image to a 12-BPP Gray Scale image.  Equivalent to selecting Gray Scale 12 with the Convert To command.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.


IpWsConvertToGray16

Syntax	IpWsConvertToGray16( )
Description	This function converts the image to a 16-BPP Gray Scale image.  Equivalent to selecting Gray Scale 16 with the Convert To command.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.


IpWsConvertToPaletteMColor

Syntax	IpWsConvertToPaletteMColor( )
Description	This function converts the image to an 8-BPP Palette-class image, using Media Cybernetic's proprietary M/Color method.  Equivalent to selecting Palette with the Convert To command, then choosing MColor.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.
See Also	IpWsConvertToPaletteMedian


IpWsConvertToPaletteMedian

Syntax	IpWsConvertToPaletteMedian(StartIndex, NumColors)
Description	This function converts a pseudo-colored gray scale image to a palette-class iamge, using the pseudo-color palette definition. Equivalent to selecting Palette with the Convert To command, then choosing Median.
Parameters	StartIndex	Integer	An integer from 0 to 13 (inclusive), representing the palette position into which the first color will be placed.
	NumColors	Integer	An integer from 4 to 256 (inclusive), representing the number of colors in the resulting palette.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.
Example	ret = IpWsConvertToPaletteMedian(0, 256) This statement will convert the image to an 8-BPP Palette-class image, using the Median method, with 256 colors in the palette, starting at index 0. ret = IpWsConvertToPaletteMedian(6, 55) This statement will convert the image to a 8-BPP Palette-class image, using the Median method, with 55 colors in the palette, starting at index 6.
See Also	IpWsConvertToPaletteMColor


IpWsConvertToRGB

Syntax	IpWsConvertToRGB( )
Description	This function converts the image to a 24-BPP (chunky) True Color image.  Equivalent to selecting RGB with the Convert To command.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.


IpWsCopy

Syntax	IpWsCopy( )
Description	This function copies the contents of the selected AOI or image to the Clipboard.  Equivalent to using the Copy command (or the CTRL+INS key combination) to copy image data to the Clipboard.
Example	This group of statements will copy the AOI that has just been defined, and place it on the Clipboard.
ipRect.left = 41

ipRect.top = 71

ipRect.right = 106

ipRect.bottom = 110

ret = IpAoiCreateBox(ipRect)

ret = IpWsCopy()

See Also	IpWsPaste


IpWsCreate

Syntax	IpWsCreate(Width, Height, Dpi, Class)
Description	This function creates an empty image window of the specified dimensions and class.  Equivalent to clicking the New button in the New command's Create New Image dialog box.
Parameters	Width	Integer	An integer representing the number of pixels the new image will contain in the horizontal direction.
	Height	Integer	An integer representing the number of pixels the new image will contain in the vertical direction.
	Dpi	Integer	An integer representing the logical resolution, expressed in dots per inch.
	Class	Integer	An enumerated integer specifying the class of the image to be created.  Must be one of the following: IMC_BILEVEL IMC_GRAY IMC_PALETTE IMC_RGB IMC_GRAY12 IMC_GRAY16 IMC_FLOAT See definitions under Comments, below.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpWsCreate(270, 250, 90, IMC_PALETTE) This statement will create an empty Palette-class image, 270 pixels wide by 250 pixels high, logically having 90 dots per inch.
Comments	Class values are as follows:
VALUE	DESCRIPTION
IMC_BILEVEL	The new image is of Bilevel class.
IMC_GRAY	The new image is of Gray Scale class.
IMC_PALETTE	The new image is of Palette class.
IMC_RGB	The new image is of True Color class.
IMC_GRAY12	The new image is of Gray Scale 12 class.
IMC_GRAY16	The new image is of Gray Scale 16 class.
IMC_FLOAT	The new image is of Floating Point class.


IpWsCreateFromClipboard

Syntax	IpWsCreateFromClipboard( )
Description	This function creates an image window from the contents of the Clipboard.  Equivalent to clicking Clipboard in the New command's Create New Image dialog box.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.
Comments	If there is nothing on the Clipboard, nothing will occur.


IpWsCreateFromVri

Syntax	IpWsCreateFromVri(Vri, Name, Mode)
Description	This function creates a new image workspace (document) from a VRI handle.  There is no  command equivalent to this function; it is one that must be manually written with the macro editor.
Parameters	Vri	Integer	The handle (type short in C) to the image bit map.  This handle can be obtained with IpDocGet.
	Name	String	A string specifying the name to appear in the title bar of the new workspace.
	Mode	Integer	An enumerated integer specifying the way in which the new workspace is to be opened.  Must be one of the following:
			0 VRI_NODELETE VRI_COPY See definitions under Comments, below.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A -1 is returned when an error occurs.
Example	The following example duplicates the active document without using the IpWsDuplicate function.
Dim Vri as integer

ret = IpDocGet(GETDOCVRI, DOCSEL_ACTIVE, Vri)

If Vri >= 0 Then

ret = IpWsCreateFromVri(Vri, "", VRI_COPY)

End If

Comments	The Vri options are described in the table below.
VALUE	DESCRIPTION
0	This option assigns the source VRI to the new workspace.  If the new workspace is subsequently closed by the application, the VRI will be destroyed.  Note that this method may cause problems if the VRI is closed while it is being shared by several applications.
VRI_NODELETE	This option assigns the source VRI to the new workspace.  If the workspace is subsequently closed by the application, the VRI will not be destroyed.
VRI_COPY	This option copies the source VRI to the new workspace.  The original VRI can be destroyed by its owner without causing a problem in your application, and the workspace can be closed by the application without affecting owners of the source VRI.
See Also	IpDocGet


IpWsDuplicate

Syntax	IpWsDuplicate( )
Description	This function makes an exact copy of the AOI, if there is one, or the active image otherwise.  Equivalent to the Duplicate command on the Image menu.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.


IpWsFill

Syntax	IpWsFill(FillType, ColorType, Transparency)
Description	This function fills the active image or AOI with the specified color or pattern.  Equivalent to executing the Fill command.
Parameters	FillType	Integer	An integer from 0 to 4 specifying the fill type.  Where: 0  - Selects Color. 1  - Selects Hue. 2  - Selects Tint. 3  - Selects Pattern. 4  - Selects Texture
			When values 3 or 4 are used, the fill operation will be performed using the currently selected pattern file (see IpWsFillPattern).
	ColorType	Integer	An integer from 0 to 4 specifying the color.  Where: 0  - Selects Foreground Color. 1  - Selects Background Color. 2  - Selects White. 3  - Selects Black. This parameter is ignored if the FillType parameter is set to 3 or 4.  When this is the case, set ColorType to 0.
	Transparency	Integer	An integer from 0 to 100 (inclusive), selecting the degree to which the active image will "show through" the applied pattern or color.  The higher the value, the more the active image will "show through".
Example	ret = IpWsFill(0, 1, 0) The statement above will fill the active image or AOI with the current Background color (as set in the palette window) and apply it with a transparency value of 0. ret = IpWsFillPattern("C:\APPNAME\IMAGES\GRID.TIF") ret = IpWsFill(3, 0, 80) The set of statements above will select GRID.TIF as the pattern file, then fill the active image or AOI with it using a transparency value of 80.  The ColorType parameter is ignored, as the image is being filled with a pattern file, not with color.
See Also	IpWsFillPattern,  IpPalShow


IpWsFillPattern

Syntax	IpWsFillPattern(PatternFile)
Description	This function selects the file to be used as the pattern or texture for a fill operation.  Equivalent to the Select button in the Fill command's Pattern/Texture group box.
Parameters	PatternFile	String	A string specifying the name of the file from which the pattern/texture will be read.
Example	ret = IpWsFillPattern("C:\APPNAME\GRID.TIF") This statement will select the GRID.TIF file as the pattern/texture file.
Comments	This function merely selects the pattern file.  It must be followed by the IpWsFill command for the fill to take place.
See Also	IpWsFill


IpWsGray12To8

Syntax	IpWsGray12To8(FromStart, FromEnd, ToStart, ToEnd)
Description	This function converts a Gray Scale 12 image into an 8-bit Gray Scale image with the option of converting a specific intensity range.  Equivalent to setting the range in the Select Range dialog box when converting a 12-bit image with the Convert To command.
Parameters	FromStart	Integer	An integer between 0 and 4095 (inclusive) that identifies the beginning of the range of 12-bit values to be converted.
	FromEnd	Integer	An integer between 0 and 4095 (inclusive) that identifies the end of the range of 12-bit values to be converted.
	ToStart	Integer	An integer between 0 and 255 (inclusive) that identifies the beginning of the 8-bit range to which the 12-bit values will be converted.
	ToEnd	Integer	An integer between 0 and 255 (inclusive) that identifies the end of the 8-bit range to which the 12-bit values will be converted.
Example	The following statement converts the entire 12-bit range to 8 bits. This would produce the same result as calling IpWsConvertToGray. ret = IpWsGray12To8(0, 4095, 0, 255) The following statement converts bits 2 - 9 in the 12-bit image (i.e., values 0 to 1020) to bits 0 -7 (i.e., 0 to 255) in an 8-bit image.  In binary notation this is the same as mapping (000000000000, 001111111100) into (00000000, 11111111). ret = IpWsGray12To8(0, 1020, 0, 255)
Comments	This function maps the range of pixel values of the 12-bit image [FromStart, FromEnd], into the range [ToStart,ToEnd] of the 8-bit image.  Values in the 12-bit image that are greater than FromEnd will be mapped to ToEnd; values that are smaller than FromStart will be mapped to ToStart.
See Also	IpWsConvertToGray


IpWsGray16To8

Syntax	IpWsGray16To8(start16, end16 ,start8, end8)
Description	This function converts a Gray Scale 16 image into an 8-bit Gray Scale image with the option of converting a specific intensity range.  Equivalent to setting the range in the Select Range dialog box when converting a 16-bit image with the Convert To command.
Parameters	Start16	Integer	An integer between 0 and 65535 (inclusive) that identifies the beginning of the range of 16-bit values to be converted.
	End16	Integer	An integer between 0 and 65535 (inclusive) that identifies the end of the range of 16-bit values to be converted.
	Start8	Integer	An integer between 0 and 255 (inclusive) that identifies the beginning of the 8-bit range to which the 16-bit values will be converted.
	End8	Integer	An integer between 0 and 255 (inclusive) that identifies the end of the 8-bit range to which the 16-bit values will be converted.
Example	The following statement converts the entire 16-bit range to 8 bits. This would produce the same result as calling IpWsConvertToGray. ret = IpWsGray16To8(0, 65535, 0, 255) The following statement converts bits 2 -  in the 16-bit image (i.e., values 0 to 1020) to bits 0 -7 (i.e., 0 to 255) in an 8-bit image.  In binary notation this is the same as mapping (0000000000000000, 0000001111111100) into (00000000, 11111111). ret = IpWsGray16To8(0, 1020, 0, 255)
Comments	This function maps the range of pixel values of the 16-bit image Start16, End16], into the range [Start8,End8] of the 8-bit image.  Values in the 16-bit image that are greater than End16 will be mapped to End8; values that are smaller than Start16 will be mapped to Start8.
See Also	IpWsConvertToGray


IpWsLoad

Syntax	IpWsLoad(FileName, FileFormat)
Description	This function opens an image file.  Equivalent to the Open command.
Parameters	FileName	String	A string specifying the name of the file from which the image will be read.
	FileFormat	String	A string specifying the format in which the image file has been written.  See Comments, below, for a list of valid file format strings.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpWsLoad("c:\AppName\images\count.tif","TIF") This statement will open the TIF file called COUNT.TIF, which is located in the \APPNAME\IMAGES directory on the C: drive.
Comments	FileFormat strings are as follows:
FileFormat String	DESCRIPTION
TIF	Tagged Image File Format
CUT	HALO CUT File Format
BMP	Windows Bitmap Format
JPG	Joint Photographic Experts Group (JPEG) Format
PCT	Macintosh PICT Format
PCX	ZSoft PCX Format
TGA	Truevision Targa Format
FLF	User-defined Flat File Format
See Also	IpWsSave,  IpWsSaveAs,  IpWsSaveAsEx


IpWsLoadNumber

Syntax	IpWsLoadNumber(Number)
Description	This function opens a recently closed image file that is listed with an identifying number at the bottom of the File menu.
Parameters	Number	Integer	An integer from 1 to 4 (inclusive) specifying the name of the file to be opened, or -1 to invoke the Open File dialog box so that the user may select the file.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpWsLoadNumber(2) This statement will return the second file listed at the bottom of the File menu. ret = IpWsLoadNumber(-1) This statement will display the Open File dialog box, allowing the user to select a file.  The macro will continue when the user closes the dialog box.
Comments	The number of files listed at the bottom of the File menu may be less than four, and the order in which they are listed changes as you open and close files.  In a macro, use this function with care.
See Also	IpWsLoad


IpWsLoadPreview

Syntax	IpWsLoadPreview(FileName, FileFormat, Left, Top, Right, Bottom)
Description	This function opens the specified portion of an image.  Equivalent to clicking the Preview button in the Open File dialog box, and using the mouse to define a frame around the portion that is to be opened.
Parameters	FileName	String	A string specifying the name of the file from which the image is to be read.
	FileFormat	String	A string specifying the format in which the image file has been written.  See IpWsLoad for a list of valid file format strings.
	Left	Integer	An integer specifying the horizontal position, in pixels, of the left edge of the frame.
	Top	Integer	An integer specifying the vertical position, in pixels, of the top edge of the frame.
	Right	Integer	An integer specifying the horizontal position, in pixels, of the right edge of the frame.
	Bottom	Integer	An integer specifying the vertical position, in pixels,  of the bottom edge of the frame.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.
Example	ret = IpWsLoadPreview("C:\IMAGES\SLIDE1.BMP","BMP",0,0,50,100)  This statement will load the rectangular portion of the SLIDFE1.BMP (a BMP file), where 0,0 defines the x,y coordinates for the upper-left corner of the rectangle, and 50,100 defines the coordinates of the bottom-right corner.


IpWsLoadSetRes

Syntax	IpWsLoadSetRes(Num)
Description	This function selects the resolution of the sub-image to be loaded when a multiple-resolution image file is opened (e.g., a Photo-CD image file).  Equivalent to selecting a resolution when a multiple-resolution file is opened using the Open command.
Parameters	Num	Integer	An integer specifying the image to be loaded (where 0 represents the first image in the file), or one of the following values: LOAD_PROMPT LOAD_SMALLEST Where LOAD_PROMPT will prompt the user for the resolution, and LOAD_SMALLEST will automatically load the image with the smallest spatial resolution.
Example	ret = IpWsLoadSetRes(LOAD_SMALLEST) ret = IpWsLoad("D:\image1.pcd", "PCD") This set of statements above directs the application to open the smallest resolution image contained in the IMAGE1.PCD file. ret = IpWsLoadSetRes(2) ret = IpWsLoad("D:\image1.pcd", "PCD") This set of statements above directs the application to open the third image contained in the IMAGE1.PCD file.
Comments	Note that the IpWsLoadSetRes function does not actually open the image, it merely identifies the sub-image that is to be opened when a multiple-image file is encountered by IpWsLoad.
See Also	IpWsLoad


IpWsMove

Syntax	IpWsMove(x, y)
Description	This function positions the image within the current image window.  Equivalent to positioning the image with the Panning Hand tool.
Parameters	x	Integer	An integer specifying the x-coordinate of the image pixel that is to be moved to the upper-left corner (i.e., window position 0, 0) in the image window.
	y	Integer	An integer specifying the y-coordinate of the image pixel that is to be moved to the upper-left corner (i.e., window position 0, 0) in the image window.
Example	ret = IpWsMove(9,9) This statement will position the image such that pixel 9, 9 is located in the upper-left corner of the image window.  Pixels above and to the left of pixel 9,9 will not be visible.
See Also	IpWsPan


IpWsOrient

Syntax	IpWsOrient(OrientType)
Description	This function reorients or rotates the image in the specified increment.  Equivalent to the "quick-step" rotation options available with the Rotate command.
Parameters	OrientType	Integer	An enumerated integer specifying the type of rotation to be performed.  Must be one of the following: OR_LEFTRIGHT OR_UPDOWN OR_TRANSPOSE OR_ROTATE90 OR_ROTATE270 OR_ROTATE180 See definitions under Comments, below.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpWsOrient(OR_UPDOWN) This statement will flip the image from top to bottom.
Comments	OrientType options are as follows:
VALUE	DESCRIPTION
OR_LEFTRIGHT	Reorients the image from left to right.  Equivalent to the Rotate command's "Flip Left/Right" option.
OR_UPDOWN	Reorients the image from top to bottom.  Equivalent to the Rotate command's "Flip Up/Down" option.
OR_TRANSPOSE	Reorients the image from top-right to bottom-left.  Equivalent to the Rotate command's "Transpose" option.
OR_ROTATE90	Rotates the image 90° counterclockwise.  Equivalent to the Rotate command's "Left 90" option.
OR_ROTATE270	Rotates the image 90° clockwise.  Equivalent to the Rotate command's "Right 90" option.
OR_ROTATE180	Rotates the image 180°.  Equivalent to the Rotate command's "Rotate 180" option.
See Also	IpWsRotate


IpWsOverlay

Syntax	IpWsOverlay (sourceName, Transparency, TransparentMode)
Description	This function creates the transparent overlay in the workspace. Equivalent to selecting the Image Overlay option from the Process menu.
Parameters	sourceName	String	Name of source image to be overlayed.
	Transparency	Integer	Percentage of source image to be blended with destination image. 100 = copy image overlay into destination 99-1 = blend overlay with destination
	TransparentMode	Integer	Enter floating overlay mode, or burn overlay directly into image 0 - immediately paste the overlay image into the destination image. 1 - enter floating overlay mode. Overlay can be moved by mouse.
Example	This example will immediately overlay the current image with the image named spots.tif in the upper lefthand corner  ret = IpWsOverlay("spots.tif", 100, 0) This example will overlay the current image with the image named spots.tif, move the overlay to the coordinates 57, 68 in the destination image, then blend the overlay into the current image with source=60%, destination=40%. ret = IpWsOverlay("spots.tif, 60, 1) ret = IpWsPaste(57, 68)
Comments	Destination image is always the currently active image. If writing a macro by hand,  and you use TransparentMode = 1, then it must be followed by a IpWsPaste command or the overlay will not be copied into the current image.
See Also	IpWsPaste


IpWsPan

Syntax	IpWsPan(x, y)
Description	This function moves the image relative to its current position in the image window.  Equivalent to using the scroll bars to move the image up/down and left/right in the window.
Parameters	x	Integer	An integer specifying the number of pixels the image is to be shifted in the horizontal direction.  A positive value moves the image to the left.  A negative value moves it right.
	y	Integer	An integer specifying the number of pixels the image is to be shifted in the vertical direction.  A positive value moves the image up.  A negative value moves it down.
Example	ret = IpWsPan(-100, 150) This statement will move the image 100 pixels to the right and 150 up.
See Also	IpWsMove


IpWsPaste

Syntax	IpWsPaste(x, y)
Description	This function copies the contents of the Clipboard to the specified position in the active image.  Equivalent to using the Paste command or the SHIFT+INS key combination.
Parameters	x	Integer	An integer specifying the x-coordinate of the upper-left corner of the area to which the Clipboard data is to be copied.
	y	Integer	An integer specifying the y-coordinate of the upper-left corner of the area to which the Clipboard data is to be copied.
Example	ret = IpWsPaste(65, 100) This statement will copy the current Clipboard data into the area that originates at pixel position 65, 100 in the active image.
See Also	IpWsCopy


IpWsRedo

Syntax	IpWsRedo(Number)
Description	This function reverses an Undo operation.  Equivalent to selecting a (Redo of) operation from the Undo  pop-out menu.
Parameters	Number	Integer	An integer from 0 to 2 specifying the operation to be reversed, as identified by its position on the "Undo" pop-out menu.  Where: 0 - Redoes the most recent action (i.e., the first operation listed in the "Undo" pop-out menu). 1 - Redoes the second, most-recent action (i.e., the second operation listed in the "Undo" pop-out menu). 2 - Redoes the third, most-recent action (i.e., the third operation listed in the "Undo" pop-out menu).
Example	ret =  IpWsRedo(0) This statement will redo the first operation on the "Undo" pop-out menu.


IpWsReload

Syntax	IpWsReload( )
Description	This function reloads the active image from its disk file.  Equivalent to the Reload command.


IpWsRotate

Syntax	IpWsRotate(Angle, Anchor)
Description	This function rotates the active image or AOI by the specified amount.  Equivalent to the Rotate command's Any Angle option.
Parameters	Angle	Float	A floating-point value specifying the number of degrees, in the counterclockwise direction, by which the image is to be rotated.
	Anchor	Integer	An enumerated integer specifying the origin of the angle of rotation.  Must be RA_CENTER.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpWsRotate(315, RA_CENTER)  This statement will rotate the image counterclockwise by 315° (which is 45° clockwise).  Image data are always rotated about the center point.


IpWsRulerShow

Syntax	IpWsRulerShow(bShow)
Description	This function enables/disables the display of rulers within the active image.  Equivalent to selecting the Rulers command in the active window's Control menu.
Parameters	bShow	Integer	An integer value of 0 or 1 specifying whether rulers are to be displayed or suppressed.  Where: 0  - Suppresses rulers. 1  - Displays rulers.
Example	ret = IpWsRulerShow(1) This statement will display rulers in the active image window.
See Also	IpWsRulerType


IpWsRulerType

Syntax	IpWsRulerType(RulerType)
Description	This function selects the unit-of-measure in which the rulers will display.  Equivalent to the Ruler Units command in the active window's Control menu.
Parameters	RulerType	Integer	An integer from 0 to 2 specifying the ruler unit to be used.  Where: 0  -  Centimeters 1  -  Inches 2  -  Pixels
Example	ret = IpWsRulerType(2)  ret = IpWsRulerShow(1) This set of statements will set the rulers to measure pixels, then display the ruler in the active image window.
See Also	IpWsRulerShow


IpWsSave

Syntax	IpWsSave( )
Description	This function stores the active image to its disk file.  Equivalent to the Save command.
Comments	If the current image is untitled, you will be prompted to supply a file name via the Save File As dialog box during playback.  Macro execution will continue when OK is clicked.


IpWsSaveAs

Syntax	IpWsSaveAs(FileName, FileFormat)
Description	This function stores the active image to the specified file in the specified file format using the default compression and BPP values.  Equivalent to using the Save As command without setting compression and/or BPP options.
Parameters	FileName	String	A string specifying the name of the file to which the active image will be written.
	FileFormat	String	A string specifying the format in which the image file will be written.  See Comments for valid file format strings.
Example	ret = IpWsSaveAs("C:\APPNAME\IMAGES\APTEST.BMP", "BMP")  This statement will save the active image to the APTEST.BMP file in the \APPNAME\IMAGES directory on the C: drive.  The file will be written in BMP format.
Comments	If the file specified in FileName exists, it will automatically be overwritten. Allowable FileFormat strings are as follows:
FileFormat String	DESCRIPTION
TIF	Tagged Image File Format
CUT	HALO CUT File Format
BMP	Windows Bitmap Format
EPS	Encapsulated Postscript Format
JPG	Joint Photographic Experts Group (JPEG) Format
PCT	Macintosh PICT Format
PCX	ZSoft PCX Format
TGA	Truevision Targa Format
FLF	User-defined Flat File Format
See Also	IpWsSaveEx,  IpWsSave


IpWsSaveEx

Syntax	IpWsSaveEx(FileName, FileFormat, Compression, BitsPerPlane)
Description	This function stores the active image to the specified file in the specified file format, with the specified compression and conversion options.  Equivalent to saving an image with the Save As command using selected compression and BPP options.
Parameters	FileName	String	A string specifying the name of the file to which the active image will be written.
	FileFormat	String	A string specifying the format in which the image file will be written.  See IpWsSaveAs for a list of valid file format strings.
	Compression	Integer	An integer from 0 to 7 specifying the compression method that is to be applied when storing the image.  Where: 0  - No Compression 1  - Default Compression 2  - Run Length Encoding (RLE) 3  - CCITT Modified Huffman 1-D Encoding 4  - CCITT Group 3 Encoding 5  - CCITT Group 4 Encoding 6  - LZW Encoding 7  - LZW and Differencing Encoding Take care to specify a value that is valid for the specified FileFormat.  To determine which methods are valid, select the file format in the "Save File As" dialog box, and review the options listed in the "Compression" list box.
	BitsPerPlane	Integer	An integer specifying the number of bits-per-pixel in a monochrome or palette-class image, or the number of bits-per-sample in an RGB image. Take care to specify a compression method that is valid for the specified FileFormat.  To determine which values are allowed, select the file format in the "Save File As" dialog box, and review the options listed in the "Output BPP" list box.
Example	ret = IpWsSaveEx(C:\APPNAME\IMAGES\GRAY.TIF, "TIF",6,8) This statement will save the GRAY.TIF file in 8-BPP TIF format using LZW compression.
Comments	If the file specified in FileName exists, it will automatically be overwritten.
See Also	IpWsSave,  IpWsSaveAs


IpWsScale

Syntax	IpWsScale(Width, Height, bSmooth)
Description	This function resizes the active image to the specified dimensions.  Equivalent to the Resize command.
Parameters	Width	Integer	An integer specifying the width, in pixels, to which the horizontal dimension is to be scaled.
	Height	Integer	An integer specifying the height, in pixels, to which the vertical dimension is to be scaled.
	bSmooth	Integer	An integer value of 0 or 1 specifying whether the image is to be smoothed when it is scaled.  Where: 0  - Suppresses smoothing. 1  - Applies smoothing.
Return Value	This function returns the Document ID of the new image, which will be an integer greater than 0.  A negative return value indicates an error.
Example	ret = IpWsScale(200, 300, 1)  This statement will resize the image to dimensions of 200 pixels wide by 300 pixels tall.  Smoothing will be applied during the scaling process.
Comments	This function actually changes the spatial resolution of the active image.  If you want to magnify or reduce the size of the image for display purposes, use the IpWsZoom function.
See Also	IpWsZoom


IpWsStretchLut

Syntax	IpWsStretchLut(Mode)
Description	This function sets or unsets the Stretch Lut function in the File/Open dialog box.
Parameters	Mode	Integer	1 = set Stretch option 0 = unset Stretch option
Comments	The Stretch Lut option in the File/Open dialog box allows the user to attach a "best fit" LUT to the image when opening it.  For example, if a user has 12-bit image data written into a 16-bit TIFF file, select the Stretch Lut option will display the image with a LUT modified to fit the actual dynamic range of the image.


IpWsTestStrips

Syntax

IpWsTestStrips(HorzPage, VertPage, Type, MinValue, MaxValue, Reduction, bRed, bGreen, bBlue)

Description	This function generates a test strip for a single intensity characteristic.  Equivalent to the Gamma, Brightness and Contrast options on the Test Strips pop-out menu.
Parameters	HorzPage	Integer	An integer specifying the number of test images to be generated in the horizontal direction.
	VertPage	Integer	An integer specifying the number of test images to be generated in the vertical direction.
	Type	Integer	An enumerated integer specifying the type of test strip that is to be generated.  Must be one of the following: LUT_BRIGHTNESS LUT_CONTRAST LUT_GAMMA
			These options correspond to the Brightness, Contrast and Gamma test strip options, respectively.
	MinValue	Integer	An integer specifying the first value in the range of Type, for which a set of test images are to be generated. When Type is set to LUT_BRIGHTNESS or LUT_CONTRAST, this parameter can contain an integer from 0 to 100 (inclusive), where 50 represents no change to the selected characteristic, values > 50 increase it and values < 50 reduce it. When Type is set to LUT_GAMMA, this parameter can contain an integer from 10 to 970 (inclusive), where 100 represents no change to Gamma, values > 100 increase Gamma and values < 100 reduce Gamma.
	MaxValue	Integer	An integer specifying the last value in the range of Type, for which a set of test images are to be generated. When Type is set to LUT_BRIGHTNESS or LUT_CONTRAST, this parameter can contain an integer from 0 to 100 (inclusive), where 50 represents no change to the selected characteristic, values > 50 increase it and values < 50 reduce it. When Type is set to LUT_GAMMA, this parameter can contain an integer from 10 to 970 (inclusive), where 100 represents no change to Gamma, values > 100 increase Gamma and values < 100 reduce Gamma.
	Reduction	Integer	An integer from 5 to 100 (inclusive) specifying the size, expressed as a percentage of the original image, at which each test image is to be rendered.
	bRed	Integer	An integer value of 0 or 1 specifying whether Type is to be adjusted in the Red channel of a True Color test strip.  Where: 0  -  Ignores the Red channel. 1  - Adjusts the Red channel. If the active image is not True Color, this parameter is ignored.  When this is the case, just set bRed to 0.
	bGreen	Integer	An integer value of 0 or 1 specifying whether Type is to be adjusted in the Green channel of a True Color test strip.  Where: 0  -  Ignores the Green channel. 1  - Adjusts the Green channel.
			If the active image is not True Color, this parameter is ignored.  When this is the case, just set bGreen to 0.
	bBlue	Integer	An integer value of 0 or 1 specifying whether Type is to be adjusted in the Blue channel of a True Color test strip.  Where: 0  -  Ignores the Blue channel. 1  - Adjusts the Blue channel. If the active image is not True Color, this parameter is ignored.  When this is the case, just set bBlue to 0.
Example	ret = IpWsTestStrips(2, 3, LUT_GAMMA, 100, 970, 25, 1, 1, 1) This statement will generate a 6-image, Gamma test strip, arranged in three rows of 2 images, with Gamma values ranging from 1 to 9.7.  The test images will be 25% of the original size, and the Gamma adjustment will be applied to all 3 color channels.
Comments	To create a test strip showing the results of two intensity enhancements combined, use the IpWsTestStrips2 function.
See Also	IpWsTestStrips2


IpWsTestStrips2

Syntax

IpWsTestStrips2(HorzPage, VertPage, Type1, MinValue1, MaxValue1, Type2, MinValue2, MaxValue2, Reduction, bRed, bGreen, bBlue)

Description	This function generates a test strip of two intensity enhancements, combined.  Equivalent to the Gamma*Brightness, Gamma*Contrast and  Brightness*Contrast options on the Test Strips pop-out menu.
Parameters	HorzPage	Integer	An integer specifying the number of test images to be generated in the horizontal direction.
	VertPage	Integer	An integer specifying the number of test images to be generated in the vertical direction.
	Type1	Integer	An enumerated integer specifying the first of two intensity characteristics that are to be adjusted.  Must be one of the following: LUT_BRIGHTNESS LUT_CONTRAST LUT_GAMMA See IpWsTestStrips for definitions.
			To produce a meaningful result, this parameter should contain a value different than that in Type2.
	MinValue1	Integer	An integer specifying the first value in the range of Type1, for which a set of test images are to be generated.  See Comments, below, for valid ranges.
	MaxValue1	Integer	An integer specifying the last value in the range of Type1, for which a set of test images are to be generated.  See Comments, below, for valid ranges.
	Type2	Integer	An enumerated integer specifying the second of two intensity characteristics that are to be adjusted.  Must be one of the following: LUT_BRIGHTNESS LUT_CONTRAST LUT_GAMMA See IpWsTestStrips for definitions. To produce a meaningful result, this parameter should contain a value different than that in Type1.
	MinValue2	Integer	An integer specifying the first value in the range of Type2, for which a set of test images are to be generated.  See Comments, below, for valid ranges.
	MaxValue2	Integer	An integer specifying the last value in the range of Type2, for which a set of test images are to be generated.  See Comments, below, for valid ranges.
	Reduction	Integer	An integer from 5 to 100 (inclusive) specifying the size, expressed as a percentage of the original image, at which each test image is to be rendered.
	bRed	Integer	An integer value of 0 or 1 specifying whether the intensity characteristics specified in Type1 and Type2, are to be applied to the Red channel of a True Color test strip.  Where: 0  -  Ignores the Red channel. 1  - Adjusts the Red channel. If the active image is not True Color, this parameter is ignored.  When this is the case, just set bRed to 0.
	bGreen	Integer	An integer value of 0 or 1 specifying whether the intensity characteristics specified in Type1 and Type2 are to be applied to the Green channel of a True Color test strip.  Where: 0  -  Ignores the Green channel. 1  - Adjusts the Green channel. If the active image is not True Color, this parameter is ignored.  When this is the case, just set bGreen to 0.
	bBlue	Integer	An integer value of 0 or 1 specifying whether the intensity characteristics specified in Type1 and Type2 are to be applied to the Blue channel of a True Color test strip.  Where: 0  -  Ignores the Blue channel. 1  - Adjusts the Blue channel. If the active image is not True Color, this parameter is ignored.  When this is the case, just set bBlue to 0.
Example
ret = IpWsTestStrips2(2,3,LUT_GAMMA,100,970,LUT_CONTRAST,30,70, 25,1, 1, 1)

	This statement will generate a 6-image, Gamma*Contrast test strip, arranged in three rows of 2 images, with Gamma values ranging from 1 to 9.7 and Contrast values from 30 to 70.  The test images will be 25% of the original size, and the Gamma/Contrast adjustments will be applied to all 3 color channels.
Comments	If you want to create a test strip for a single intensity characteristic, use the IpWsTestStrips function. If a type parameter is set to LUT_BRIGHTNESS or LUT_CONTRAST, its associated min and max parameters can contain integers from 0 to 100 (inclusive), where 50 represents no change to the selected characteristic, values > 50 increase it and values < 50 reduce it. If a type parameter is set to LUT_GAMMA, its associated min and max parameters can contain integers from 10 to 970 (inclusive), where 100 represents no change to Gamma, values > 100 increase Gamma and values < 100 reduce Gamma.
See Also	IpWsTestStrips


IpWsTestStripsHalftone

Syntax

IpWsTestStripsHalftone(AllTypes, Color, ipHalfTypes, ipHalfScreens, OutputDpi, Reduction)

Description	This function creates a test strip of the selected halftone options.  Equivalent to the Halftone option on the Test Strips pop-out menu.
Parameters	AllTypes	Integer	An integer value of 0 or 1 specifying whether the test strip is to be of a single halftone type, or of all halftone types.  Where: 0 - Specifies single halftone type. 1 - Specifies all halftone types.
	Color	Integer	An integer value of 0 or 1 specifying whether a Black & White or Color test strip is to be created.  Where: 0 - Creates Black & White strip. 1 - Creates Color strip.
	ipHalfTypes	Integer (Basic) LPSHORT (C)	The name and first element of an array of integers representing the halftone types for which a strip is to be generated.  By default this array is defined as ipHalfTypes(0). When AllTypes is set to 0, the ipHalfTypes array must contain a single integer, which specifies the one halftone type for which a strip is to be generated.  Integers 0 to 5 represent the following types: 0 - Angle Dot Screen 1 - Flat Dot Screen 2 - Angle Line Screen 3 - Horz Line Screen 4 - Vert Line Screen 5 - Error Diffusion
			When the macro is executed, the application  will create a test image of this type, for each resolution specified in the ipHalfScreens array (see ipHalfScreens below). When AllTypes is set to 1, the ipHalfTypes array must contain 6 elements, each element specifying the halftone type for which a test image is to be generated.  By default, the array is filled with values from 0 to 5, representing the 6 halftone types as described above.   When the macro is executed, the application will create a test image for each type specified in array ipHalfTypes, using the screen specified by the corresponding element in the array, ipHalfScreens (see ipHalfScreens below).
	ipHalfScreens	Integer  (Basic) LPSHORT (C)	The name and first element of an array of integers representing the halftone screens to be used when creating the test strip.  By default this array is defined as ipHalfScreens(0). When AllTypes is set to 0, the ipHalfScreens array must contain 4 elements, each element specifying the screen to be used with the type defined in the single-element ipHalfTypes array.  Where: For ipHalftoneTypes values of 0 - 4: 0  - Largest LPI value 1  - Second-largest LPI value 2  - Second-smallest LPI value 3  - Smallest LPI value For ipHalftoneTypes value of 5: 0  - 4 Weights 1  - 12 Weights 2  - Fuzzy 3  - Random
			When AllTypes is set to 1, the ipHalfScreens array must contain 6 elements, each element containing an integer specifying the screen to be used with the corresponding halftone type specified in the ipHalfTypes array (see ipHalfTypes above).
	OutputDpi	Integer	An integer specifying the dots-per-inch value at which the image is to be halftoned.
	Reduction	Integer	An integer from 5 to 100 (inclusive) specifying the size, expressed as a percentage of the original image, at which each test image is to be rendered.
Example	The set of statements below will create a test strip of all halftone types using the screen specified in the corresponding element of array ipHalfScreens — e.g., the smallest resolution (0) for the Angle Dot type, the smallest resolution (0) for the Horz Line type, and Fuzzy screen (2) for the Error Diffusion type.
ipHalfScreens(0) = 0

ipHalfScreens(1) = 1

ipHalfScreens(2) = 1

ipHalfScreens(3) = 0

ipHalfScreens(4) = 1

ipHalfScreens(5) = 2

ipHalfTypes(0) = 0

ipHalfTypes(1) = 1

ipHalfTypes(2) = 2

ipHalfTypes(3) = 3

ipHalfTypes(4) = 4

ipHalfTypes(5) = 5

ret = IpWsTestStripsHalftone

(1, 0, ipHalfTypes(0), ipHalfScreens(0), 150, 10)

The set of statements below will create a test strip of all screen resolutions for the Angle Line halftone type.

ipHalfScreens(0) = 0

ipHalfScreens(1) = 1

ipHalfScreens(2) = 2

ipHalfScreens(3) = 3

ipHalfTypes(0) = 2

ret = IpWsTestStripsHalftone

(0, 0, ipHalfTypes(0), ipHalfScreens(0), 150, 10)

.


IpWsUndo

Syntax	IpWsUndo(Number)
Description	This function reverses the specified operation.  Equivalent to the Undo command.
Parameters	Number	Integer	An integer from 0 to 2 specifying the operation to be reversed, as identified by its position on the "Undo" pop-out menu.  Where: 0 - Reverses the most recent action (i.e., the first operation listed in the pop-out menu).
			1 - Reverses the second-most-recent action (i.e., the second operation listed in the pop-out menu). 2 - Reverses the third-most-recent action (i.e., the third operation listed in the pop-out menu). Remember that not all  operations are reversible.
Example	ret = IpWsUndo(2)  This statement will reverse the oldest action in the "Undo" list.
See Also	IpWsRedo


IpWsZoom

Syntax	IpWsZoom(PercentZoom)
Description	This function magnifies/reduces the active image by the specified amount.  Equivalent to using the Magnifying Glass tool or the Zoom command on the image window's Control menu.
Parameters	PercentZoom	Integer	An integer specifying the amount by which the image dimensions are to be increased or reduced.  Must be one of the following: 10 - Displays image at 10% of image size 25 - Displays image at 25% of image size 50 - Displays image at 50% of image size 100 - Displays image at actual size 200 - Displays image at twice its actual size 400 - Displays image at 4 times its actual size 800 - Displays image at 8 times its actual size 1600 - Displays image at 16 times its actual size -1 - Displays image at the next smaller zoom factor (equivalent to clicking right mouse button when the "Magnifying Glass" tool is selected). +1 - Displays image at the next larger zoom factor (equivalent to clicking left mouse button when the "Magnifying Glass" tool is selected).
Example	IpWsZoom(100)  IpDocMaximize() This set of statements will return the image to its actual size and maximize the image window to ensure that the image is fully visible within the window.


Call

Syntax 1	Call SubName([Parameter List])
Syntax 2	SubName  [Parameter List]
Description	This statement transfers program control to a subroutine in your script file (i.e., a procedure that is defined between a pair of Sub...End Sub statements).  When the subroutine has finished, control is returned to the statement following the Call.
Parameters	SubName()	The name of an IPBASIC subroutine (with any parameters it may require).
Parameters	Parameter List	A list of parameters, separated by commas, that are to be passed as data to the subroutine.
Example	All of the following are legitimate ways of calling a subroutine: Call MySub(16,16) Call MySub() MySub 16,16 MySub
Comments	The keyword Call is optional.  When you use it, you must include the parentheses that enclose the parameter list (following SubName), even if the list is null.  When you do not use the word Call, the parentheses must not be used around the parameters, and a space must delimit the first parameter from SubName.


Chr$

Syntax	Chr$(CharCode)
Description	This function returns a character of type String, given the ANSI code for that character.
Parameters	CharCode	An integer from 0 to 255, inclusive.
Example	NullChar = Chr$(0) 'Creates NULL char string DublQuote = Chr$(34) 'Creates a double quote mark that  'can be used within a string CNullPos = InStr(CString, Chr$(0)) 'Finds position of null 'char in CString
Comments	The Chr$ function provides a mechanism for obtaining a nonprinting character (e.g., the NULL character or a New Line character), or a character that cannot be used directly (e.g., a double quote embedded within a string, not used as a string terminator).  See Appendix C - ANSI Characters for a list of ANSI characters and their codes.
See Also	Str$,  InStr


Const

Syntax	[Global] Const ConstantName = Expression
Description	This statement assigns a symbolic name to a constant value.
Parameters	ConstantName	Name of the constant being declared.  It must follow the naming rules set forth under Variable Names in Section 1.
	Expression	Expression assigned to the constant.  See Comments for constraints on the expression.
Example	Const TRUE = -1 'A constant named TRUE is set to -1 Const FALSE = 0 'A constant named FALSE is set to 0 Const PI = 3.14159265 'A constant saves typing Const NUMBER_OF_EMPLOYEES = 10 'An infrequently changed variable
Comments	The Const statement allows you to declare a variable whose value is assigned before its first use and is not allowed to change thereafter.  This is useful for readability of your program (e.g., "TRUE" is more meaningful than -1); for saving typing of a long or oft-repeated constant number (e.g., "PI" versus 3.14159265); or for ease in changing a value that may appear multiple times in your program, but whose value you want to change from time to time (e.g., MAXIMUM_VALUE versus 10). The data type of the named constant is determined by the data type of Expression. Expression may be a numeric or a string literal (e.g., 1.0 or "etc."); it may include another constant; it may include any of the arithmetic or logical operations except exponentiation (^).     It may not contain a variable, nor use a function, whether built-in or user-defined to assign the value.   You may not use string concatenation. A named constant declared in a subroutine or function is local to that procedure.  A constant declared outside of a subroutine or function is defined throughout the script file, in which case the word Global may precede the word Const. You may use a constant anywhere you would use an expression. It is common practice to use ALL_UPPERCASE_LETTERS for the constant's name, to distinguish it from other variables.
See Also	Dim,  Global


Declare Function

Syntax

Declare Function funcname Lib "DLLname" ( [[ByVal] variable [As vartype]] [, ...] ) As type

Description	This function defines an external procedure found in a dynamic-link library (DLL).
Parameters	funcname	Name of the function as defined in the DLL DLLname.
	DLLname	Name of the DLL that contains funcname.
	variable	Variables expected by the function (optional).
	vartype	The type of the variable.  Must be one of the following: Integer Long Single String or a user-defined type.
	type	Type of variable returned by the function.  Must be one of the following: Integer Long Single String or a user-defined type.
Example	The following example declares function HiPassImageAoi.
Declare Function HiPassImageAoi Lib "example2.dll" (ByVal FilterSize As Integer) As Integer

Comments	The Declare Function statement is used to call external functions that are not part of the Auto-Pro library.  These external functions can be part of Windows API, HIL (Halo Image Library), HAIL (Halo Advanced Image Library) and so forth. The Declare Function statement can be added to the file IPMACRO.BAS, which contains global variable and structure definitions, or it can be included in the script file from which the function is called.  The difference is that IPMACRO.BAS is always loaded and, therefore, the function is always declared.  A script file, on the other hand, can be changed at any time.
See Also	Sub...End Sub,  Function...End Function


Dim

Syntax 1	Dim VariableName[(Subscripts)]  As VariableType
Syntax 2	Dim VariableName[(Subscripts)] As String [* NumberBytes]
Description	This statement allocates storage for, and establishes the data type of, variables or array variables. Note - use Syntax 1 for numeric declarations; use Syntax 2 for string declarations.
Parameters	VariableName	The name of the variable or array being declared.  It must follow the naming rules set forth under Variable Names in Section 1.
	Subscripts [,Multiple Subscripts]	For an array variable only, the size of each dimension of the array (when only the upper bound for the dimension is given) or the range of the array (when both lower and upper bounds for the dimension are given).  For further information, see Comments, below.
	VariableType	The type of the variable or array being declared.  Must be one of the following: Integer Long Single String or a User-defined type
	NumberBytes	For a String variable, the maximum number of bytes in a fixed-length string.
Example	Dim A As Integer 'Declares the variable A as integer Dim B(100) As Single 'Declares single-precision array B 'with 101 elements (from 0 to 100) Dim C(-30 to 60) As Long 'Declares a long array C 'from -30 to 60 Dim D(9,9) As Single 'Declares a two-dimensional single- 'precision array D, with 100 elements  '[(0 to 9) * (0 to 9)] Dim S As String    'Declares a variable-length string S Dim SArray As String * 30   'Declares a fixed-length string array SArray
Comments	Subscripts has the following syntax: [lower TO] upper[,[lower TO] upper] . . . For example: Dim SArray(9) As Integer  defines a one-dimensional array containing 10 elements, 0 to 9.  The statement: Dim SArray(9,9) As Integer   defines a two-dimensional array of 100 elements  (the above examples assume Option Base is 0).   The reserved word TO permits you to declare the bounds of the array in terms that correspond with your data.  For example, the statement:  Dim SArray(1 To 10) As Integer     defines a one-dimensional array of 10 elements.  The statement: Dim SArray(1 To 10, 1 To 10) As Integer
	defines a two-dimensional array of 100 elements. If only the upper bounds of the array are given, the lower bound is assumed by default to be 0, unless an Option Base statement declares otherwise. Subscripts may range from -32,768 to +32, 767, inclusive; they must be integers.   If you use a subscript that is greater than the upper bound or smaller than the lower bound, an error will occur. Note - IPBASIC does not support the declaration of dynamic arrays via the Dim statement (i.e., empty subscript parentheses are not allowed).  An array defined with Dim must be assigned a size, at which it will be fixed for the duration of the program.  To allocate an array whose size may change during the program, use the Redim statement. The maximum number of array dimensions is limited only by available storage space. IPBASIC initializes numeric variables to 0.   Declare string variables according to Syntax 2.  To declare a fixed-length string, use the "* NumberBytes" option (e.g., Dim S As String * 255). A fixed-length string should be set to the maximum size of the string it is to contain.  If a string is assigned to a fixed-length string that is too short to hold it, the longer string will be truncated. To declare a variable-length string, omit "* NumberBytes." IPBASIC will initialize a fixed-length string with zeroes.  A variable-length string is initialized as a zero-length string; additional space will be allocated on demand. A Dim statement must precede the first use of VariableName.  It is good practice, in order to find the names of variables in use, to put Dim and other declaration statements in a block at the beginning of your code.
See Also	Global,  Static,  Const,  Type...End Type,  Option Base,  Redim


Do...Loop

Syntax 1	Do [{While | Until}Condition] [StatementBlock] [Exit Do] [StatementBlock] Loop
Syntax 2	Do [StatementBlock] [Exit Do] [StatementBlock] Loop [{While | Until}Condition]
Description	The Do and Loop statements bracket a block of statements to be repeated while a given condition is true or until a condition becomes true.
Parameters	Condition	An expression that evaluates to true (nonzero) or false (0).
	StatementBlock	Statements to be repeated until, or while, Condition is true.
Example	A = 1 Do    Call IpWsLoadNumber (A)    A = A + 1 Loop While A < 4	A = 1 Do    Call IpWsLoadNumber (A)    A = A + 1 Loop Until A = 4
	The two loops shown side-by-side above are equivalent.
	A = 1 Do While A < 4    Call IpWsLoadNumber (A)    A = A + 1 Loop	A = 1 Do Until A = 4    Call IpWsLoadNumber (A)    A = A + 1 Loop
	The two loops shown side-by-side above are equivalent.
Comments	The Do...Loop block provides a flexible structure for repeating a block of statements until a condition is met or while a condition holds.  When IPBASIC enters a Do...Loop, it looks for a While or Until keyword.  If either is present, it tests for Condition to be true or false.   With the While keyword, if Condition is false, or with the Until keyword, if Condition is true, IPBASIC transfers program control to the statement after Loop (the body of the loop is not executed).  If, however, Condition is true (with While) or false (with Until), IPBASIC executes the body of the loop, then returns to the top of the loop and retests Condition. If after entering the Do...Loop, IPBASIC does not find a While or Until keyword, it executes the body of the loop once.  Upon encountering Loop, it looks for a While or Until keyword.  If it finds one, it tests Condition as explained above and repeats the body of the loop while the condition holds. Use the While keyword when you want to repeat the loop when the condition is true.  Use the Until keyword when you want to repeat the loop when the condition is false. Use the While or Until keyword following the Loop statement if you want the body of the loop to be executed at least once.  Use the While or Until keyword following the Do statement if you do not want the body of the loop executed even once, when the condition does not hold. The Do...Loop statements also let you create an infinite loop.  You do this by using only the Do and Loop statements themselves and omitting both the While and Until.  You must then test a condition within the body of the loop that will allow you to break out of it.
See Also	Exit Do,  For...Next,  While...Wend


End

Syntax	End
Description	This statement terminates a subroutine or function before the End Sub or End Function statement is reached.  Often used to end a program within a sub-procedure.


Example	On Color GoTo ExtRed, ExtGreen, ExtBlue

ExtRed:

ret = IpCmChannelExtract(CM_RGB,CM_RGB,0)

.

.

.

End	'exit program

ExtGreen:

ret = IpCmChannelExtract(CM_RGB,CM_RGB,0)

.

.

.

End	'exit program

ExtBlue:

ret = IpCmChannelExtract(CM_RGB,CM_RGB,0)

.

.

.

End	'exit program

End Sub

See Also	End Function,  End If,  End Sub,  End Type,  Stop


End Function

Syntax	End Function
Description	This statement informs IPBASIC that the end of the function has been reached.
Example	Function BCG() ret = IpLutSetAttr(LUT_BRIGHTNESS, 75) ret = IpLutSetAttr(LUT_CONTRAST, 70) ret = IpLutSetAttr(LUT_GAMMA, 243) End Function
Comments	End Function is required to signal the termination of a function.
See Also	Function...End Function,  Exit Function,  End,  End If,  End Sub,  End Type


End If

Syntax	End If
Description	This statement informs IPBASIC that the end of the multiple-line If...Then...Else or If...Then...ElseIf block has been reached.
Error Messages	IPBASIC issues a "Block If without End If" message at compile time if the End If statement is omitted.
Example	C = B If A > B Then    C = A End If 'Use End If
	If A > B Then C = A Else C = B 'End If not used
Comments	End If is required to signal the termination of a multiple-line If...Then...Else or If...Then...ElseIf statement.  It is not used with a single-line If...Then[...Else].
See Also	If...Then...Else,  If...Then...ElseIf...End If,  End,  End Function,  End Sub,  End Type


End Sub

Syntax	End Sub
Description	This statement informs IPBASIC that the end of the subroutine has been reached.
Example	Sub Capture10() '<c>F5 ' Acquire 10 Images For X = 1 to 10    ret = IpAcqSnap(0)    ret = IpBlbCount()    ret = IpBlbSaveData("C:\DATA\RESULTS.CNT", 1)    ret = IpWsSaveAs("C:\IMAGES\IMG" & LTrim$(Str$(X))) Next End Sub
Comments	End Sub is required to signal the termination of a sub-routine.
See Also	Sub...End Sub,  Exit Sub,  End,  End Function,  End If,  End Type


End Type

Syntax	End Function
Description	This statement informs IPBASIC that the end of the Type block has been reached.
Error Messages	IPBASIC issues a "Statement invalid in Type block" error when End Type is omitted after a Type statement and its declarations.
Example	Type RECT left As Integer top As Integer right As Integer bottom As Integer End Type
Comments	End Type is required to signal the termination of a Type definition.
See Also	Type,  End Function,  End If,  End Sub,  End


Exit Do

Syntax	Exit Do
Description	This statement provides an alternate exit for Do...Loop statement blocks.
Comments	Exit Do can only appear within a Do...Loop  block. Exit Do transfers program control to the statement following the Loop statement.  If used within nested  statements, control is passed to the loop immediately outside the current loop.
See Also	Do...Loop,  Stop


Exit For

Syntax	Exit For
Description	This statement provides an alternate exit for For...Next blocks.
Comments	Exit For can only appear within a For...Next block. Exit For transfers program control to the statement following the Next statement.  If used within nested For...Next statements, control is passed to the loop immediately outside the current loop.
See Also	For...Next,  End,  Stop


Exit Function

Syntax	Exit Function
Description	This statement provides an alternate exit for a function.
Comments	Exit Function causes IPBASIC to exit the function immediately and return control to the statement immediately following the statement that called the function. Do not confuse Exit Function with End Function.  End Function is the last statement of a Function procedure and is required.  Exit Function causes a (usually) premature return to the calling program.
See Also	End Function,  Function...End Function,  End,  Stop


Exit Sub

Syntax	Exit Sub
Description	This statement provides an alternate exit for a sub-routine.
Comments	Exit Sub causes IPBASIC to exit the subroutine immediately and return control to the statement immediately following the statement that called the subroutine. Do not confuse Exit Sub with End Sub.  End Sub is the last statement of a Sub procedure and is required.  Exit Sub causes a (usually) premature return to the calling program.
See Also	End Sub,  Sub...End Sub,  End,  Stop


For...Next

Syntax	For Counter = StartValue To StopValue [Step Increment] [StatementBlock] [Exit For] [StatementBlock] Next [Counter] [, Counter]...
Description	The For...Next statements bracket a block of statements that are to be repeated for a specified number of times.
Parameters	Counter	Numeric variable used to determine the number of times the For block is executed.  This variable cannot be an array element or a User-defined type element.
	StartValue	The value of Counter for the first iteration of the block.
	StopValue	The value of Counter for the last iteration of the block.
	StatementBlock	One or more program lines to be executed repeatedly.
	Increment	The amount to be added to Counter for each pass.  If not specified, one is added.
Error Messages	IPBASIC issues a "For without Next" error when there is a missing or misplaced Next.  A "Next without For" error occurs when a Next is encountered that cannot be matched to its initiating For.  This occurs when a Next occurs before a For or when a Next Counter statement does not match the For Counter statement (especially critical in nested For...Next statements).
Example	A = 0

For X = 1 to 10

   A = A + X

Next

For X = 1 to Width

   For Y = Height to 1 Step -1

   .

   .

   .

Next Y, X

Comments	When IPBASIC enters a For...Next loop, it first assigns the value StartValue to Counter.  Then it compares that value to StopValue, using the following rules:
IF STEP IS:	THE LOOP EXECUTES IF:
Positive or 0	Counter <= StopValue
Negative	Counter >= StopValue
	Thus, the loop will not execute at all if the values of StartValue and StopValue so dictate. If not given, Step defaults to +1. When the statements of the loop have been executed (when Next is encountered), IPBASIC adds the Step increment to Counter and tests it again; these steps are repeated until either (1) the loop termination condition is met or (2) the Exit For condition, if present, is met.  In either case, program control transfers to the statement following the For statement's matching Next statement. The Next command may include the variable name for Counter.  While optional, this is a useful way of matching For and Next statements.  When For...Next statements are nested, the innermost Next statement should match the innermost For statement.  A single Next statement may be used to terminate nested For statements, by proper use of Next Counter[, Counter]... (see Example).
See Also	Do...Loop,  While...Wend,  Exit For


Function...End Function

Syntax	[Static] [Private] Function FunctionName [(ArgumentList)]  As Type [StatementBlock] [FunctionName = expression] [Exit Function] [StatementBlock] [FunctionName = expression] End Function
Description	The Function and End Function statements declare and define a procedure that can receive arguments and return one value of a specified data type.
Parameters	FunctionName	The name of the procedure.  This name must follow the same rules as names of other variables.  Furthermore, the name must be unique among all variable names in the script file.
	ArgumentList	A list of variable names, separated by commas, that the calling program passes to the procedure as arguments.  For a discussion of the ArgumentList syntax, see Comments, below.
	Type	The type of the variable or array that the function returns.  Must be one of the following: Integer Long Single String
	StatementBlock	A statement or sequence of statements to be executed when the function is invoked.
	expression	An expression that produces the function's return value.  If a value is to be returned by the function, it must be assigned to FunctionName somewhere within the procedure.  If the procedure
		does not assign a value to FunctionName, a default value of 0 (if anumeric data type) or null (if a string) will be returneddoes not assign a value to FunctionName, a default value of 0 (if a numeric data type) or null (if a string) will be returned
Example	Function BCG() ret = IpLutSetAttr(LUT_BRIGHTNESS, 75) ret = IpLutSetAttr(LUT_CONTRAST, 70) ret = IpLutSetAttr(LUT_GAMMA, 243) End Function
Comments	In your script file, all executable statements must be defined within a function or sub-routine.  You cannot define a function inside another function or sub-routine. The differences between a procedure defined as a function and one defined as a sub-routine are that: A function returns a value to the calling procedure; and  A function may be called within an expression. If Static is declared, the function's local variable values (i.e., ones that are explicitly declared within the body of the function) are preserved between calls.  Variables declared outside the function, whether used within the procedure or not, are unaffected by the Static attribute. Private specifies that the function is available only to other subroutines or functions in the script file.  Since IPBASIC functions are not available outside a script file anyway, this keyword is not required.  You may want to use it, however, if you intend to export your code to Visual Basic to specify the function as private to the module. ArgumentList has the following syntax: [ByVal] VariableName[( )] [As type] [, [ByVal] VariableName[( )] [As type] ] ByVal stipulates that the argument's value (a copy of the original argument), rather than its address, is passed to the procedure.  An argument passed by value cannot be changed within the function procedure.   If ByVal is not used, the argument is passed by reference (its address is given to the Function procedure), allowing the function to modify the contents of that location. VariableName is the name the subroutine uses for the argument.   As type declares the data type of the argument, where type is one of the following: Integer Long Single String or a User-defined type. Exit Function can be used anywhere within the procedure to leave the function
	prematurely.  Program control will be returned to the statement following the calling statementEnd Function must be placed at the end of the procedure.
See Also	Sub...End Sub,  Dim,  Global,  Static,  Exit Function,  End Function


Global

Syntax 1	Global VariableName[(Subscripts)]  As VariableType
Syntax 2	Global VariableName [(Subscripts)] As String [* NumberBytes]
Description	This statement is used to declare and allocate storage for simple variables and arrays that will be accessible to all subroutines and functions in your script file. Use Syntax 1 for numeric declarations; use Syntax 2 for string declarations. Note - any variable declared outside of a subroutine or function in your script file is automatically "global", therefore, use of the Global statement is not required by IPBASIC.  You may want to use it, however, if you intend to export your code to Visual Basic.
Parameters	VariableName	The name of the variable or array being declared.
	Subscripts [,Multiple Subscripts]	For an array variable only, the size of each dimension of the array (when only the upper bound for the dimension is given) or the range of the array (when both lower and upper bounds for the dimension are given).  See Comments, below.
	VariableType	The type of the variable or array being declared.  Must be one of the following: Integer Long Single String or a User-defined type
Example	Global A As Integer 'Declares the variable A as integer. Global B(100) As Single 'Declares single-precision array   'B, with 101 elements (from 0 to 100) Global C(-100 to 32) As Long  'Declares a long array C, 'from -100 to 32 Global D(9,9) As String 'Declares a two-dimensional 'string array D, with 100 elements
Comments	Subscripts has the following syntax: [lower TO] upper[,[lower TO] upper] . . . For example, Global SArray(9) As Integer  defines a Global, one-dimensional array containing 10 elements, 0 to 9.  The statement: Global SArray(9,9) As Integer
	defines a Global, two-dimensional array of 100 elements (the above examples assume Option Base is 0). The reserved word TO permits you to declare the bounds of the array in terms that correspond with your data.  For example, the statement:  Global SArray(1 To 10) As Integer     defines a Global, one-dimensional array of 10 elements.  The statement: Global SArray(1 To 10, 1 To 10) As Integer defines a Global, two-dimensional array of 100 elements. If only the upper bounds of the array are given, the lower bound is assumed by default to be 0, unless an Option Base statement declares otherwise. Subscripts may range from -32,768 to +32, 767, inclusive; they must be integers. If you use a subscript that is greater than the upper bound or smaller than the lower bound, an error occurs. Note - IPBASIC does not support the declaration of dynamic arrays via the Global statement (i.e., empty subscript parentheses are not allowed).  An array defined with Global must be assigned a size, at which it will be fixed for the duration of the program.  To allocate an array whose size may change during the program, use the Redim statement. The maximum number of array dimensions is limited only by available storage space. IPBASIC initializes numeric variables to 0. Declare string variables according to Syntax 2.  To declare a fixed-length string, use the  "* NumberBytes" option (e.g., Global S As String * 255). A fixed-length string should be set to the maximum size of the string it is to contain.  If a string is assigned to a fixed-length string that is too short to hold it, the longer string will be truncated. To declare a variable-length string, omit "* NumberBytes." IPBASIC will initialize a fixed-length string with zeroes.  A variable-length string is initialized as a zero-length string; additional space will be allocated on demand. The Global statement must precede the first use of the VariableName.  It is good practice, in order to find the names of variables in use, to put Global and other declaration statements in a block at the beginning of your script file.
See Also	Const,  Dim,  Static,  Type...End Type,  Option Base


GoSub...Return

Syntax	GoSub {LineLabel | LineNumber } ... LineLabel:  | LineNumber ... Return
Description	These statements effect a transfer of program control to a specific label in the subroutine or function.  Program control will return to the command following the GoSub statement when the Return statement is encountered.
	Important - you cannot transfer control to a line label or number that is outside of the calling subroutine or function.
Parameters	LineLabel	A label that marks the line to which control will be transferred.  It must follow the naming rules set forth under Variable Names in Section 1, and must be unique within the subroutine or function.
	LineNumber	A numeric label that marks the line to which control will be transferred.  Numeric labels must contain only the decimal digits (0-9) and must be unique within the subroutine or function.
Example	If A > B Then GoSub SaveImage

.

.

.

End

SaveImage:

ret = IpWsSave()

Return

CloseImage:

ret = IpDocClose()

End Sub

Comments	If LineLabel is used to mark a line, it must be followed by a colon. If LineNumber is used to mark a line, it must not be followed by a colon. Within your subroutine or function, LineLabel and LineNumber may begin in any column, so long as each is the first nonblank character on the line.
See Also	GoTo,  On...GoSub,  On...GoTo


GoTo

Syntax	GoTo {LineLabel | LineNumber }
Description	This statement transfers program control to a specific label in the subroutine or function. Important - you cannot transfer control to a line label or number that is outside of the calling subroutine or function.
Parameters	LineLabel	A label that marks the line to which control will be transferred.  It must follow the naming rules set forth under Variable Names in Section 1, and must be unique within the subroutine or function.
	LineNumber	A numeric label that marks the line to which control will be transferred.  Numeric labels must contain only the decimal digits (0-9) and must be unique within the subroutine or function.
Example	If A > B Then GoTo SaveImage

.

.

.

End

SaveImage:

ret = IpWsSave()

End Sub

Comments	If LineLabel is used to mark a line, it must be followed by a colon. If LineNumber is used to mark a line, it must not be followed by a colon. Within your subroutine or function, LineLabel and LineNumber may begin in any column, so long as each is the first nonblank character on the line.
See Also	GoSub,  On...GoTo,  On...GoSub


If...Then...Else

Syntax	If Condition Then Action1 [Else Action2]
Description	These statements provide a one-line structure for conditional execution.
Parameters	Condition	A numeric or string expression that evaluates to true (nonzero) or false (0 or null).
	Action1	Statement(s) performed when Condition is true.
	Action2	Statement(s) performed when Condition is false.
Example	If A > B Then C = A Else C = B If X = Y Then GoTo Z
Comments	The complete statement must be contained on one line.  If the statement does not fit on one line, you may use the following structure: If A > B Then    C = A Else    C = B End If The Else keyword (with Action2) is optional.  When not given, program control passes immediately to the next statement if Condition is false. In executing the simple If statement, IPBASIC first tests Condition.  If it is true (nonzero), IPBASIC executes Action1 and proceeds to the next statement; if Condition is false, it executes Action2 if there is an Else keyword or the next statement otherwise. You may have multiple statements in Action1 and Action2; they must be on the same line and separated by colons, as in the following example: If A > 10 Then C = A : B = B + 1 Else C = B
See Also	If...Then...ElseIf...End If


If...Then...ElseIf...End If

Syntax	If Condition1 Then [Action1] [ElseIf Condition2 Then  [Action2]] [ElseIf Condition-n Then  [Action-n]] [Else [Action-Else]] End If
Description	These statements provide a multiple-line structure for conditional execution.
Parameters	Condition1 - n	A numeric or string expression that evaluates true (nonzero) or false (0 or null).
	Action1 - n	Statement(s) or branch(es) performed when corresponding Condition1 - n is true.
	Action-Else	Statement(s) or branch(es) performed when Condition1-n are all false.
Error Messages	IPBASIC issues a "Block If without End If" error when there is a missing End If.  An "End If without Block If" error occurs when an End If is encountered that cannot be matched to its initiating If.
Example	If A > 1000 Then    XC = A ElseIf A > 500 Then    MC = A ElseIf A > 100 Then    SC = A Else A > 100 Then    GoTo InError End If
Comments	The Else and ElseIf clauses are optional.  You may have as many ElseIf clauses as you need, but all ElseIf clauses must precede an Else clause if it exists. Any Action block may contain nested block If statements. In executing the block If statement, IPBASIC first tests Condition1 .  If it is true (nonzero), IPBASIC executes Action1 and proceeds to the statement following the End If statement; if Condition1 is false, it tests Condition2, with corresponding actions.  If Condition1 through Condition-n are all false, the Action-Else block is executed, if present.
See Also	If...Then...Else,  On...GoSub,  On...GoTo


InStr

Syntax1	InStr([StartPos], String1, String2)
Syntax2	InStr(StartPos, String1, String2[, CompMethod])
Description	This function searches a string testing for the first occurrence of a second string.  It returns the position within the searched string of the first occurrence or 0 if not found.
Parameters	StartPos	A numeric expression that stipulates the starting position for the search.
	String1	The string to be searched.
	String2	The string being compared.
	CompMethod	A value of 0 or 1 specifying whether the string comparison is to be case-sensitive, where: 0  - Case-sensitive (e.g., M ≠ m) 1  - Case-insensitive (e.g., M = m)
Example	NullChar = Str$(0) 'Look for Null Character CNullPos = InStr(CString, NullChar) 'in CString CPos = InStr(FNAME,  "ABC", 0) 'Look for "ABC"  or "abc" in FNAME
Comments	StartPos is optional.  If omitted, the search starts in position 1.  StartPos must evaluate to a number between 1 and approximately 65,535.  If StartPos is greater than the length of String1, InStr returns 0. IPBASIC searches String1, looking for String2, beginning at StartPos.  If it succeeds, it returns the position at which the first letter of String2 appears in String1.  Otherwise, InStr returns 0. If String2 is zero-length, InStr returns StartPos. If String1 is zero-length, InStr returns 0. If either String1 or String2 is null, InStr returns null.  If StartPos or CompMethod is null, an error occurs.
See Also	Str$,  Chr$,  Len,  Left$


Left$

Syntax	Left$(StrExp, Length)
Description	This function returns the left-most n characters of a string.
Parameters	StrExp	The string expression whose leftmost characters are to be returned.
	Length	The number of characters to be returned.
Error Messages	IPBASIC issues an "Illegal function call" error if Length has a value less than 0 or greater than 65,535.
Example	BasicString = Left$(CString, CNullPos-1)  'Strip Null from CString
Comments	StrExp may be a fixed- or variable-length string, a string constant, a literal string, or the result of any string function. If Length is greater than or equal to the full length of StrExp, Left$ returns an exact copy of StrExp. If Length is 0, Left$ returns a zero-length (null) string.
See Also	Len


Len

Syntax1	Len(StrExp )
Description	This function returns the number of characters in a string expression.
Parameters	StringExp	The string expression whose length is to be returned.
Example	StringLength = Len(FileName)   'How long is FileName?
Comments	If StringExp is null, Len returns a null.
See Also	InStr


LTrim$

Syntax	LTrim$(StringExp)
Description	This function returns a copy of a string, with its leading (leftmost) spaces, if any, removed.
Parameters	StringExp	The string expression to be trimmed from the left.
Example	NumStr = LTrim$(Str$(50)) 'Str$ returns " 50" 'LTrim$ returns "50"
Comments	StringExp may be a fixed- or variable-length string, a string constant, a literal string, the result of any function that returns a string, or any other string expression.
See Also	Str$


On...GoSub

Syntax	On Expression GoSub DestinationList
Description	These statements transfer program control to a specific line from a list of line numbers or labels, based on the value of a numeric expression.
Parameters	Expression	A numeric expression that evaluates to a value between 0 and 255, inclusive, and less than or equal to the number of items in DestinationList.
When Expression is...	The following occurs...
0	Control is transferred to the next statement.
1...255	Control is transferred to the corresponding item in the list, if it exists.
Greater than the number of items in DestinationList	Control is transferred to the next statement.
< 0 or > 255	Error occurs.
	DestinationList	A list of line numbers or labels, separated by commas.  The number of items in this list, which may not exceed 255, determines the maximum valid value of Expression.
Example	On Color GoSub ExtRed, ExtGreen, ExtBlue

.

.

.

End

ExtRed:

ret = IpCmChannelExtract(CM_RGB,CM_RGB,0)

.

.

.

Return

ExtGreen:

ret = IpCmChannelExtract(CM_RGB,CM_RGB,0)

.

.

.

Return

ExtBlue:

ret = IpCmChannelExtract(CM_RGB,CM_RGB,0)

.

.

.

Return

End Sub

See Also	GoSub...Return,  GoTo,  On...GoTo,  If...Then...ElseIf...End If


On...GoTo

Syntax	On Expression GoTo DestinationList
Description	These statements transfer execution to a line number or line label, based on the value of a numeric expression.
Parameters	Expression	A numeric expression that evaluates to a value between 0 and 255, inclusive, and less than or equal to the number of items in DestinationList.
When Expression is...	The following occurs...
0	Control is transferred to the next statement.
1...255	Control is transferred to the corresponding item in the list, if it exists.
Greater than the number of items in DestinationList	Control is transferred to the next statement.
< 0 or > 255	Error occurs.
	DestinationList	A list of line numbers or line labels, separated by commas.  The number of items in this list, which may not exceed 255, determines the maximum valid value of Expression.
Example	On Color GoTo ExtRed, ExtGreen, ExtBlue

End

ExtRed:

ret = IpCmChannelExtract(CM_RGB,CM_RGB,0)

.

.

.

Return

ExtGreen:

ret = IpCmChannelExtract(CM_RGB,CM_RGB,0)

.

.

.

Return

ExtBlue:

ret = IpCmChannelExtract(CM_RGB,CM_RGB,0)

.

.

.

Return

End Sub

See Also	GoTo,  GoSub...Return,  On...GoSub,  If...Then...ElseIf...End If


Option Base

Syntax	Option Base Number
Description	These statements sets the default lower boundary for array subscripts to 0 or 1.
Parameters	Number	A value of 0 or 1 specifying the value to be used as the default. Note - 0 is the default if Option Base is not used.
Example	Option Base 0 Global SArray(9) As Integer '10 elements, 0 - 9 Option Base 1 Global SArray(10) As Integer '10 elements, 1 - 10
Comments	An Option Base statement is not required; if one does not appear in a script file, a base-default of 0 is used.   There may be only one Option Base statement in a script file.  It must appear at the top of the file, before the declaration of any arrays. The Option Base statement will not affect any array whose lower bound has been explicitly set using the TO clause in its declaration statement.  Note - The Option Base statement does not affect arrays in user-defined data types.  Such arrays are always zero-based.
See Also	Dim,  Global,  Static,  Type...End Type


Print

Syntax	Print [expressionlist] [; | ,]
Description	This function prints to the Macro Output window.
Parameters	expressionlist	The numeric or string expressions to be printed.  The expressionlist can be omitted to print a blank line.   The expressionlist can contain more than one expression.  Multiple expressions can be separated by a comma or a semicolon.  A comma will place the cursor at the next print zone.  A semicolon will place the cursor immediately after the last printed expression.
Example	Dim numobj as integer ' Print the number of objects counted . . . ret = IpBlbGet(GETNUMOBJ, 0, 1, numobj) Print "Counted: ";numobj;" objects"
Comments	Unless the statement is terminated with a comma or semicolon, the cursor will automatically advance to the beginning of the next line after printing the expressionlist.   Placing a comma at the end of the statement moves the cursor to the next print zone on the same line, allowing the next Print command to begin printing at that point. Placing a semicolon at the end of the statement leaves the cursor immediately after the last printed expression, allowing the next Print command to begin at that point. This statement is similar to the Auto-Pro IpOutput except that Print can be used to print non-string expressions, directly.  Also, Print automatically appends the new-line sequence to the end of the expression unless directed otherwise. If you are programming with IPBASIC and Auto-Pro, you may prefer to use the Print statement to display data in the Macro Output window.  If you are calling Auto-Pro from Visual-Basic, your Print statement will direct its output to the Visual Basic print object.  You will need to use IpOutput to display output to the Macro Output window.  Auto-Pro's Print command will print to the macro output buffer even if the Macro Output window is not open.  It is, in fact, faster to print when the window is closed.
See Also	IpOutput


Redim

Syntax	Redim varname(subscripts) [As Type]
Description	This statement is used inside a procedure to declare a dynamic-array variable and allocate (or reallocate) storage space for it.
Parameters	varname	The name of the array being declared.  It must follow the naming rules set forth under Variable Names in Section 1.
	Subscripts [,Multiple Subscripts]	The size of each dimension of the array (when only the upper bound for the dimension is given) or the range of the array (when both lower and upper bounds for the dimension are given).  For further information, see Comments, below.
	Type	The type of the variable or array being declared.  Must be one of the following: Integer Long Single String or a user-defined type
Example	Dim numpoints as integer ' Get the points defining the outline of a free-form AOI . . . ret = IpAoiGet(GETNUMPTS, 0, numpoints) Redim aoipts(numpoints) As pointapi ret = IpAoiGet(GETPOINTS, numpoints, aoipts(0))
Comments	Subscripts has the following syntax: [lower TO] upper[,[lower TO] upper] . . . For example: Redim SArray(9) As Integer  defines a one-dimensional array containing 10 elements, 0 to 9.  The statement: Redim SArray(100) As Integer   redefines the array to 100 elements  (the above examples assume Option Base is 0).   The reserved word TO permits you to declare the bounds of the array in terms that correspond with your data.  For example, the statement:  Redim SArray(1 To 10) As Integer     defines a one-dimensional array of 10 elements. If only the upper bounds of the array are given, the lower bound is assumed by default to be 0, unless an Option Base statement declares otherwise.
	Subscripts may range from -32,768 to +32, 767, inclusive; they must be integers.   If you use a subscript that is greater than the upper bound or smaller than the lower bound, an error will occur. The maximum number of array dimensions is limited only by available storage space.
	Once a dynamic array has been initially declared with Redim, you can repeatedly changed the number of elements in its dimensions, but you cannot change the number of its dimensions.  For example, XArray(10, 5) can be changed to XArray(20,10), but can't be changed to XArray(10, 10, 5). You also cannot use the Redim statement to change the data type from that with which it was initially declared. Also, BASIC arrays are different from the C arrays used in the program in that they include a header containing information about the array itself.  To emulate a C array when calling an Auto-Pro function, a BASIC program should pass the address of the first element of the array (i.e. pass the first element "by reference").  Given the first element, and the fact that the rest of the array is sequentially arranged, Auto-Pro is able to use a BASIC array as it would as a C array.
See Also	Dim


Rem

Syntax 1	Rem Remark
Syntax 2	' Remark
Description	This statement allows you to insert comments into your program.
Parameters	Remark	Any text.
Example	Rem It is good practice to explain what your program Rem    is doing. 'Comments remind you and inform others about your code. Dim X, Y ' An apostrophe may be placed on the same line ' as code. X = 1 : Y = 1  : Rem -- A Rem statement needs a colon Rem  separating it from prior statements on the same line. Rem X = 1 : Y = 1  ' A Rem statement is useful for disabling ' instructions temporarily.
Comments	When a valid Rem (or ') is encountered, program control transfers to the next executable statement.  See Example above for usage.


Return

Syntax	Return
Description	This statement returns program control to the instruction following the last [On...]GoSub statement executed.
Example	GoSub MySub End              'This is where program control is returned MySub:IpWsSave ()'The Call statement gives control to MySub . . . Return   'When this statement is reached, control returns to the ' statement following the GoSub
See Also	GoSub,  On...GoSub


Static

Syntax 1	Static VariableName[(Subscripts)] As VariableType
Syntax 2	Static VariableName [(Subscripts)] As String [* NumberBytes]
Description	This statement allocates storage for IPBASIC variables and arrays, in such a way that the value of the variable(s) is preserved from one iteration of the procedure to the next. Use Syntax 1 for numeric declarations; use Syntax 2 for string declarations.
Parameters	VariableName	The name of the variable array being declared.
	Subscripts [,Multiple Subscripts]	For an array variable only, the size of each dimension of the array (when only the upper-bound is given) or the range of the array (when both lower and upper bounds for the dimension are given).  See Comments, below.
	VariableType	The type of the variable or array being declared.  Must be one of the following: Integer Long Single String
Example	Static A As Integer 'Declares the variable A as integer Static B(100) As Single 'Declares single-precision array B 'with 101 elements (from 0 to 100) Static C(-30 to 60) As Long 'Declares a long array C 'from -30 to 60 Static D(9,9) As Single 'Declares a two-dimensional single- 'precision array D, with 100 elements  '[(0 to 9) * (0 to 9)] Static S As String    'Declares a variable-length string array S Static SArray As String * 30 'Declares a fixed-length string array SArray
Comments	Subscripts has the following syntax: [lower TO] upper[,[lower TO] upper] . . . For example: Static SArray(9) As Integer  defines a Static, one-dimensional array containing 10 elements, 0 to 9.  The statement:
	Static SArray(9,9) As Integer   defines a Static, two-dimensional array of 100 elements (the examples assume Option Base is 0). The reserved word TO permits you to declare the bounds of the array in terms that correspond with your data.  For example, the statement:  Static SArray(1 To 10) As Integer     defines a Static, one-dimensional array of 10 elements.  The statement: Static SArray(1 To 10, 1 To 10) As Integer defines a Static, two-dimensional array of 100 elements. If only the upper bounds of the array are given, the lower bound is assumed by default to be 0, unless an Option Base statement declares otherwise. Subscripts may range from -32,768 to +32, 767, inclusive; they must be integers.  If you use a subscript that is greater than the upper bound or smaller than the lower bound, an error occurs. The maximum number of array dimensions is limited only by available storage space. IPBASIC initializes numeric variables to 0. Declare string variables according to Syntax 2.  To declare a fixed-length string, use the "* NumberBytes" option (e.g., Static S As String * 255). A fixed-length string should be set to the maximum size of the string it is to contain.  If a string is assigned to a fixed-length string that is too short to hold it, the longer string will be truncated. To declare a variable-length string, omit "* NumberBytes." The Static statement must precede the first use of the VariableName in the subroutine or procedure.  It is good practice to put Static and other declaration statements in a block at the beginning of the procedure.
See Also	Dim,  Global,  Const,  Type...End Type,  Option Base


Stop

Syntax	Stop
Description	This statement halts the execution of the macro.  In IPBASIC Stop is equivalent to the End statement. ). To enter trace mode, insert a Stop command in the macro.
See Also	End


Str$

Syntax	Str$(NumericExp)
Description	This function returns a string representation of a numeric expression.
Parameters	NumericExp	The numeric expression to be converted to a string.
Example	String50 = Str$(50)      'Creates " 50" StringNeg = Str$(-100)   'Creates "-100"
Comments	Str$ returns a string representing the number and its sign.  If the value of the numeric expression is positive, a leading blank substitutes for the "+"; if the value is negative, a negation sign is expressed.
See Also	Chr$,  InStr,  Ltrim$,  Len


Sub...End Sub

Syntax	[Static] [Private] Sub SubName[(ArgumentList)] [StatementBlock] [Exit Sub] [StatementBlock] End Sub
Description	These statements bracket a block of statements that declare and define an IPBASIC Sub procedure.
Parameters	SubName	The name of the subroutine.  This name must follow the same rules as names of other variables.  Furthermore, the name must be unique among all variable names in the script file.
	ArgumentList	A list of variable names, separated by commas, that the calling statement passes to the subroutine as arguments.  Separate multiple variable names with commas.  For more about ArgumentList syntax, see Comments, below.
	StatementBlock	A statement or sequence of statements to be executed when the subroutine is invoked.
Example	Sub Capture10() ' <c><s>F2 ' Acquire 10 Images For X = 1 to 10    ret = IpAcqSnap(ACQ_CURRENT)    ret = IpBlbCount()    ret = IpBlbSaveData("C:\DATA\RESULTS.CNT", 1)    ret = IpWsSaveAs("C:\IMAGES\IMG" & LTrim$(Str$(X))) Next End Sub
Comments	In an Auto-Pro script file, all executable code must be in a Function or Sub procedure.  You cannot define a Sub procedure inside another Sub or Function procedure. .
	The Private keyword specifies that the subroutine is available only to other subroutines or functions in the script file.  Since IPBASIC subroutines are not available outside a script file anyway, this keyword is not required.  You may want to use it, however, if you intend to export your code to Visual Basic, to specify that the subroutine is private to the module. ArgumentList has the following syntax: [ByVal] VariableName[( )] [As type] [, [ByVal] VariableName[( )] [As type] ] ByVal stipulates that the argument's value (a copy of the original argument), rather than its address, is passed to the procedure.  An argument passed by value cannot be changed within the subroutine.   If ByVal is not used, the argument is passed by reference (its address is given to the Sub procedure), allowing the subfunction to modify the contents of that location. As type declares the data type of the argument, where type is one of the following: Integer Long Single String or a User-defined type. Exit Sub can be used anywhere within the procedure to leave the subroutine prematurely.  Program control will be returned to the statement following the calling statement. End Sub must be placed at the end of the procedure.
See Also	Call,  End,  Exit Sub,  End Sub,  Function...End Function


Type...End Type

Syntax	Type UserType    ElementName[(Subscripts)] As TypeName    [ElementName[(Subscripts)] As TypeName] End Type
Description	These statements bracket the definition of a custom data type, containing one or more elements. Note - You may not use line numbers or line labels in Type...End Type blocks.
Parameters	UserType	The name you want to call the data type you are defining.  It must follow the naming rules set forth under Variable Names in Section 1.
	ElementName	The name of an element of the user-defined data type.  It must follow the naming rules set forth under Variable Names in Section 1.
	Subscripts	For an array variable only, the size of each dimension of the array (when only the upper bound for the dimension is given) or the range of the array (when both lower and upper bounds for the dimension are given).  For further information, see Comments, below.
	TypeName	The data type of ElementName.  Must be one of the following: Integer Long Single String
Example	Type RECT

left As Integer

top As Integer

right As Integer

bottom As Integer

End Type

.

.

.

Dim ipRect As RECT

.

.

.

ipRect.left = 53

ipRect.top = 111

ipRect.right = 102

ipRect.bottom = 162

Comments	Subscripts has the following syntax: [lower TO] upper[,[lower TO] upper] . . . For example: Org(9) As Integer  defines a one-dimensional array containing 10 elements, 0 to 9.  The statement: Org(9,9) As Integer   defines a two-dimensional array of 100 elements.   The reserved word TO permits you to declare the bounds of the array in terms that correspond with your data.  For example, the statement:  Org(1 To 10) As Integer     defines a Static, one-dimensional array of 10 elements.  The statement: Org(1 To 10, 1 To 10) As Integer defines a Static, two-dimensional array of 100 elements.
	If only the upper bounds of the array are given, the lower bound is assumed by default to be 0.  This is so even if an Option Base statement declares otherwise. Subscripts may range from -32,768 to +32, 767, inclusive; they must be integers.  If you use a subscript that is greater than the upper bound or smaller than the lower bound, an error will occur. The maximum number of array dimensions is limited only by available storage space. You may define a fixed-length string, using the "* NumberBytes" option (e.g.,  Name As String * 255). You must define a Type...End Type statement before a variable attempts to use that data type.  It is good practice to put Type...End Type definitions in a block at the beginning of your code.  Once defined, you may declare (using Dim, Global, or Static) a variable of that type anywhere in your application. When you want to reference one of the elements from your program, use TypeName followed by a period (.) followed by ElementName (e.g., IpRect.left).  See Example above.
See Also	Dim,  Global,  Static,  Option Base


Val

Syntax	Val(string)
Description	This function returns the numeric value of a string.
Parameters	String	A sequence of characters that can be interpreted as a numeric value.
Example	' assigns variable num with value 1.234 Dim num as single num = Val ("1.234") ...
See Also	Str$


While...Wend

Syntax	While Condition    [StatementBlock] Wend
Description	These statements bracket a block of statements to be repeated while a given condition is true.
Parameters	Condition	An expression that evaluates to true (nonzero) or false (0 or null).
	StatementBlock	Program lines to be repeated while Condition is true.
Error Messages	IPBASIC issues a "While without Wend" error when there is a missing or misplaced Wend.  A "Wend without While" error occurs when a Wend is encountered that cannot be matched to its initiating While.
Example	A = 1 While A < 5    Call IpWsLoadNumber(A)    A = A + 1 Wend
Comments	When IPBASIC enters a While...Wend loop, it first evaluates Condition.  If Condition is true, IPBASIC executes StatementBlock, then returns program control to the While statement, where Condition is again checked.
	If Condition is false, IPBASIC returns program control to the next statement after Wend.  Thus, While...Wend will not execute at all if Condition  is false upon entering the While statement. You may nest While...Wend loops to any level.  The innermost Wend matches the innermost While.  There must be a matching Wend for each While, and vice-versa; otherwise, IPBASIC issues an error message.
	There is no mechanism for a premature exit from While...Wend. If StatementBlock is omitted and Condition is true, an endless loop results.
See Also	Do...Loop,  For...Next


Auto-Pro Keyword List

The following is a list of the reserved words for Auto-Pro.  This list includes function names, IPBASIC commands, operators, predefined variables and other key words that belong to Auto-Pro.

A

ACCUMULATE

ACQ_AVG

ACQ_CURRENT

ACQ_LIVE

ACQ_MULTI

ACQ_NEW

ACQ_SNAP

ACQ_TIMED

AFF_AOI

AFF_CLIP

AFF_FLOAT

AFF_NOBILINEAR

And

AOI_BOX

AOI_ELLIPSE

AOI_POLYGON

AOIADD

AOIDELETE

AOIHIDEDLG

AOILOAD

AOISAVE

AOISET

AOISHOWDLG

As

AUTOUPDATE

B

Base

BIN

BIT_CALIB

BIT_SAMPLE

BIT_SAVEALL

BLBM_AREA

BLBM_ASPECT

BLBM_BLUE

BLBM_BOX_AREA

BLBM_BOX_XY

BLBM_CENTRX

BLBM_CENTRY

BLBM_CLASS

BLBM_CLUSTER

BLBM_DENSITY

BLBM_DIRECTION

BLBM_GREEN

BLBM_HOLEAREA

BLBM_HOLEAREARATIO

BLBM_MAJORAX

BLBM_MAXFERRET

BLBM_MAXRADIUS

BLBM_MEANFERRET

BLBM_MINFERRET

BLBM_MINORAX

BLBM_MINRADIUS

BLBM_NUMHOLES

BLBM_PERAREA

BLBM_PERIMETER

BLBM_RADIUSRATIO

BLBM_RED

BLBM_ROUNDNESS

BLOB_ADDCOUNT

BLOB_AUTORANGE

BLOB_BRIGHTOBJ

BLOB_CLEANBORDER

BLOB_CONVEX

BLOB_FILLHOLES

BLOB_FILTEROBJECTS

BLOB_LABELCOLOR

BLOB_LABELMODE

BLOB_MEASUREOBJECTS

BLOB_MINAREA

BLOB_OUTLINECOLOR

BLOB_OUTLINEMODE

BLOB_SMOOTHING

BRIGHTNESS

C

Call

CHANNEL

CHANNEL1

CHANNEL2

CHANNEL3

CLRBACK

CLRBLACK

CLRFORE

CLRWHITE

CM

CM_HSI

CM_HSV

CM_RGB

CM_YIQ

COLORMODEL

CONTRAST

CPROG

Currency

CURVE

D

Declare

Dim

Do

DOCS_CASCADE

DOCS_OVERLAP

DOCS_TILE

DOCSEL_ACTIVE

DOCSEL_ALL

DOCSEL_NEXTID

DOCSEL_NONE

DOCSEL_PREVID

Double

E

Else

ElseIf

End

EQ_BELL

EQ_BESTFIT

EQ_EXPONENTIAL

EQ_LINEAR

EQ_LOGARITHMIC

Eqv

Exit

F

FFT_HANNING

FFT_NEWIMAGE

FFT_NOTCH

FFT_PHASE

FFT_SOURCE

FFT_SPECTRUM

FILLCOLOR

FILLHUE

FILLPATTERN

FILLTEXTURE

FILLTINT

For

FRAME_ELLIPSE

FRAME_INVIEW

FRAME_IRREGULAR

FRAME_NONE

FRAME_RECTANGLE

FREEZE

Function

G

GAMMA

GETACTDOC

GETAPPWND

GETBOUNDS

GETDOCINFO

GETDOCLST

GETDOCVRI

GETDOCWND

GETFLOAT

GETHBLOB

GETHIT

GETINDEX

GETINSTINFO

GETINT

GETLABEL

GETNUMDOC

GETNUMOBJ

GETNUMPTS

GETPOINTS

GETRANGE

GETSTATS

GETSTATUS

GETSTRING

GETTHRESH

GETTYPE

GETVALUES

GETX

GETY

GETZ

GoSub

GoTo

GRID

I

ICAL

If

IFFCL_BILEVEL

IFFCL_GRAY

IFFCL_PALETTE

IFFCL_RGB

IFFCOMP_CCITT1D

IFFCOMP_CCITTG3

IFFCOMP_CCITTG4

IFFCOMP_DEFAULT

IFFCOMP_JPEG

IFFCOMP_LZW

IFFCOMP_LZWHPRED

IFFCOMP_NONE

IFFCOMP_RLE

IMA_RD

IMA_RDWR

IMC_BILEVEL

IMC_FLOAT

IMC_GRAY

IMC_GRAY12

IMC_PALETTE

IMC_RGB

Imp

INCHES

INF_ARTIST

INF_DATE

INF_DESCRIPTION

INF_DPIX

INF_DPIY

INF_TITLE

Integer

IpAcqAverage

IpAcqControl

IpAcqMultiSnap

IpAcqSelectDriver

IpAcqShow

IpAcqSnap

IpAcqTimed

IpAnotAttr

IpAnotBox

IpAnotEllipse

IpAnotLine

IpAoiChangeName

IpAoiCreateBox

IpAoiCreateEllipse

IpAoiCreateIrregular

IpAoiGet

IpAoiManager

IpAoiMove

IpAoiShow

IpAoiValidate

IpAppArrange

IpAppCloseAll

IpAppCtl

IpAppCtlText

IpAppExit

IpAppGet

IpAppHide

IpAppMaximize

IpAppMenuSelect

IpAppMinimize

IpAppMove

IpAppRestore

IpAppRun

IpAppSelectDoc

IpAppSize

IpAppUpdateDoc

IpAppWindow

IpAppWndPos

IpAppWndState

IpBitAttr

IpBitSaveData

IpBitShow

IpBlbCount

IpBlbCreateMask

IpBlbData

IpBlbDelete

IpBlbEnableMeas

IpBlbFilter

IpBlbGet

IpBlbLoadOutline

IpBlbLoadSetting

IpBlbMeasure

IpBlbRemoveHoles

IpBlbSaveClasses

IpBlbSaveData

IpBlbSaveOutline

IpBlbSavePopDensities

IpBlbSaveSetting

IpBlbSetAttr

IpBlbSetFilterRange

IpBlbSetRange

IpBlbShow

IpBlbShowAutoClass

IpBlbShowCluster

IpBlbShowData

IpBlbShowHistogram

IpBlbShowObjectWindow

IpBlbShowPopDens

IpBlbShowScattergram

IpBlbShowSingleClass

IpBlbShowStatistics

IpBlbSmoothObjects

IpBlbSplitObjects

IpBlbUpdate

IpCalLoad

IpCalSave

IpCalSaveAll

IpCapArea

IpCapFile

IpCapHotKey

IpCapWindow

IpCmChannelExtract

IpCmChannelMerge

IpCmChannelMerge3

IpCmTransform

IpDde

IpDocClick

IpDocClose

IpDocCloseEx

IpDocCloseVri

IpDocFind

IpDocGet

IpDocGetArea

IpDocGetLine

IPDOCINFO

IpDocMaximize

IpDocMinimize

IpDocMove

IpDocOpenAoi

IpDocOpenVri

IpDocPutArea

IpDocPutLine

IpDocRestore

IpDocSize

IpDraw

IpDrawClear

IpDrawClearDoc

IpDrawGet

IpDrawSet

IpDrawText

IpFftForward

IpFftHiPass

IpFftInverse

IpFftLoad

IpFftLoPass

IpFftSave

IpFftShow

IpFftSpikeBoost

IpFftSpikeCut

IpFltClose

IpFltConvolveKernel

IpFltDilate

IpFltDistance

IpFltErode

IpFltExtractBkgnd

IpFltFlatten

IpFltHiPass

IpFltLaplacian

IpFltLocalHistEq

IpFltLoPass

IpFltMedian

IpFltOpen

IpFltPhase

IpFltPrune

IpFltReduce

IpFltRoberts

IpFltSharpen

IpFltShow

IpFltSobel

IpFltThin

IpFltUserDilate

IpFltUserErode

IpFltVariance

IpFltWatershed

IpFTPOpen

IpFTPSave

IpGetLine

IpHstCreate

IpHstDestroy

IpHstEqualize

IpHstGet

IpHstMaximize

IpHstMinimize

IpHstMove

IpHstRestore

IpHstSave

IpHstScale

IpHstSelect

IpHstSetAttr

IpHstSize

IpHstUpdate

IpICalCreate

IpICalDestroy

IpICalLinearize

IpICalMove

IpICalReset

IpICalSelect

IpICalSetName

IpICalSetOptDens

IpICalSetPoints

IpICalSetSamples

IpICalSetUnitName

IpICalShow

IpICalShowFormat

IpIniFile

IpListPts

IpLutApply

IpLutBinarize

IpLutLoad

IpLutReset

IpLutSave

IpLutSetAttr

IpLutSetControl

IpLutShow

IpMacroLoad

IpMacroRun

IpMacroStop

IpMacroWait

IpMail

IpMeasAttr

IpMeasDelete

IpMeasGet

IpMeasLoadOutline

IpMeasMaximize

IpMeasMinimize

IpMeasMove

IpMeasRestore

IpMeasSaveData

IpMeasSaveOutline

IpMeasShow

IpMeasSize

IpMeasTag

IpMeasTool

IpMorePts

IpOpBkgndCorrect

IpOpBkgndSubtract

IpOpImageArithmetics

IpOpImageLogic

IpOpNumberArithmetics

IpOpNumberLogic

IpOpNumberRgb

IpOpShow

IpOutput

IpOutputClear

IpOutputSave

IpOutputShow

IpPalSetGrayBrush

IpPalSetPaletteBrush

IpPalSetPaletteColor

IpPalSetRGBBrush

IpPalShow

IpPcLoad

IpPcSave

IpPcSetColor

IpPcSetDivisions

IpPcSetRange

IpPcShow

IpPlotCreate

IpPlotData

IpPlotDestroy

IpPlotRange

IpPlotSet

IpPlotShow

IpPlotUpdate

IpProfCreate

IpProfDestroy

IpProfGet

IpProfLineMove

IpProfMaximize

IpProfMinimize

IpProfMove

IpProfRestore

IpProfSave

IpProfSelect

IpProfSetAttr

IpProfSize

IpProfUpdate

IpPrtHalftone

IpPrtPage

IpPrtScreen

IpPrtSize

IpRangeGet

IpRangeSet

IpRegister

IpRegShow

IpSCalCreate

IpSCalDestroy

IpSCalMove

IpSCalReset

IpSCalSelect

IpSCalSetAngle

IpSCalSetAspect

IpSCalSetName

IpSCalSetOrigin

IpSCalSetUnit

IpSCalSetUnitName

IpSCalShow

IpScanSelect

IpScanShow

IpSegCreateMask

IpSegDelete

IpSegLoad

IpSegMerge

IpSegNew

IpSegPreview

IpSegRename

IpSegReset

IpSegSave

IpSegSelect

IpSegSelectArea

IpSegSetAttr

IpSegSetRange

IpSegShow

IpSeqMerge

IpSeqOpen

IpSeqPlay

IpSeqSave

IpSortAttr

IpSortObjects

IpSortShow

IpStageControl

IpStageShow

IpStageStepXY

IpStageStepZ

IpStageXY

IpStageZ

IpStAutoName

IpStGetFloat

IpStGetInt

IpStGetName

IpStGetString

IpStSearchDir

IpTagAttr

IpTagDelete

IpTagGet

IpTagLoadEnv

IpTagLoadPoints

IpTagPt

IpTagSaveData

IpTagSaveEnv

IpTagSavePoints

IpTagShow

IpTagUpdate

IpTextBurn

IpTextFont

IpTextSetAttr

IpTextShow

IpTemplateMode

IpTrackBar

IpWsChangeDescription

IpWsChangeInfo

IpWsConvertFile

IpWsConvertToBilevel

IpWsConvertToFloat

IpWsConvertToGray

IpWsConvertToGray12

IpWsConvertToGray16

IpWsConvertToPaletteMColor

IpWsConvertToPaletteMedian

IpWsConvertToRGB

IpWsCopy

IpWsCreate

IpWsCreateFromClipboard

IpWsCreateFromVri

IpWsDuplicate

IpWsFill

IpWsFillPattern

IpWsGetId

IpWsGetName

IpWsGray12To8

IpWsGray16To8

IpWsLoad

IpWsLoadNumber

IpWsLoadPreview

IpWsLoadSetRes

IpWsMove

IpWsOrient

IpWsPan

IpWsPaste

IpWsRedo

IpWsReload

IpWsRotate

IpWsRulerShow

IpWsRulerType

IpWsSave

IpWsSaveAs

IpWsSaveEx

IpWsScale

IpWsStretchLut

IpWsTestStrips

IpWsTestStrips2

IpWsTestStripsHalftone

IpWsUndo

IpWsZoom

Is

L

Let

Like

LINETYPE

LOAD_PROMPT

LOAD_SMALLEST

Long

Loop

Lut

LUT_4TONES

LUT_8TONES

LUT_ALL

LUT_BRIGHTNESS

LUT_CONTRAST

LUT_FREEFORM

LUT_GAMMA

LUT_HISHAD

M

MASK_BACKGROUND

MASK_BILEVELINPLACE

MASK_BILEVELNEW

MASK_FOREGROUND

MEAS_ALL

MEAS_ANGLE

MEAS_ANGLE180

MEAS_AREA

MEAS_CLICK

MEAS_DISPCOLOR

MEAS_LABELCOLOR

MEAS_LENGTH

MEAS_REPEAT

MEAS_STATS

MEAS_TAG

MEAS_THICK

MEAS_THICKMODE

MEAS_TRACE

MENU_COORD

MENU_DLL

MENU_ID

MENU_NAME

MORPHO_11x11OCTAGON

MORPHO_1x3COLUMN

MORPHO_2x2SQUARE

MORPHO_3x1ROW

MORPHO_3x3CROSS

MORPHO_5x5OCTAGON

MORPHO_7x7OCTAGON

MORPHO_CUSTOM

MS_DEF2

MS_DEF3

MS_EXCLAM

MS_MODAL

MS_OKCAN

MS_QUEST

MS_STOP

MS_YESNO

MS_YESNOCAN

N

New

Next

Not

Null

O

On

OPA_ADD

OPA_AVG

OPA_DIFF

OPA_DIV

OPA_MAX

OPA_MIN

OPA_MULT

OPA_SUB

OPL_AND

OPL_COPY

OPL_NAND

OPL_NOR

OPL_NOT

OPL_OR

OPL_XOR

Option

Or

OR_LEFTRIGHT

OR_ROTATE180

OR_ROTATE270

OR_ROTATE90

OR_TRANSPOSE

OR_UPDOWN

ORIGIN

P

PIXELS

Print

Private

PRT_ACTUAL

PRT_DISTORT

PRT_FIT

Pts

R

RA_CENTER

Redim

REFERENCE

Rem

ret

Return

RUN_AUTOCLOSE

RUN_MAXIMIZED

RUN_MINIMIZED

RUN_MODAL

RUN_NORMAL

S

S_APPEND

S_CLIPBOARD

S_DATA

S_HEADER

S_LEGEND

S_RANGE

S_STATS

S_X_AXIS

SCAL

SEG_SELADD

SEG_SELNEW

SEG_SELSUBTRACT

SETFLOAT

SETINT

SETORIGIN

SETSTEPX

SETSTEPY

SETSTEPZ

SETSTRING

Single

SORT_AUTO

SORT_COLOR

SORT_INDEX

SORT_LABELS

SORT_MEAS

SORT_ROTATE

Static

STATISTICS

Step

STG_CENTER

STG_CURRENT

STG_DOWN

STG_LEFT

STG_RIGHT

STG_UP

STG_UPLEFT

Stop

String

Sub

T

TBCLOSE

TBOPEN

TBUPDATE

Then

THICKAVG

THICKHORZ

THICKNORMAL

THICKSTDDEV

THICKVERT

To

Type

U

UNIT

Until

USEAOI

V

Variant

VRI_COPY

VRI_NODELETE

VRI_SHARE

W

Wend

While

X

Xor


ANSI Characters

#	char	 #	char	 #	char	 #	char	 #	char	 #	char

0	    	37	%	74	J	111	o	148	   	185	¹

1	  	38	&	75	K	112	p	149	   	186	º

2	  	39	'	76	L	113	q	150	   	187	»

3	  	40	(	77	M	114	r	151	   	188	¼

4	  	41	)	78	N	115	s	152	   	189	½

5	  	42	*	79	O	116	t	153	   	190	¾

6	  	43	+	80	P	117	u	154	   	191	¿

7	  	44	81	Q	118	v	155	   	192	À

8	bksp	45	-	82	R	119	w	156	   	193	Á

9	tab	46	.	83	S	120	x	157	   	194	Â

10	LF	47	/	84	T	121	y	158	   	195	Ã

11	   	48	0	85	U	122	z	159	   	196	Ä

12	   	49	1	86	V	123	{	160	 	197	Å

13	CR	50	2	87	W	124	161	¡	198	Æ

14	   	51	3	88	X	125	}	162	¢	199	Ç

15	   	52	4	89	Y	126	~	163	£	200	È

16	   	53	5	90	Z	127	   	164	†	201	É

17	   	54	6	91	[	128	   	165	¥	202	Ê

18	   	55	7	92	\	129	   	166	¦	203	Ë

19	   	56	8	93	]	130	   	167	§	204	Ì

20	   	57	9	94	^	131	   	168	¨	205	Í

21	   	58	:	95	_	132	   	169	©	206	Î

22	   	59	;	96	`	133	   	170	ª	207	Ï

23	   	60	<	97	a	134	   	171	«	208	Ð

24	   	61	=	98	b	135	   	172	¬	209	Ñ

25	   	62	>	99	c	136	   	173	­	210	Ò

26	   	63	?	100	d	137	   	174	®	211	Ó

27	   	64	@	101	e	138	   	175	¯	212	Ô

28	   	65	A	102	f	139	   	176	°	213	Õ

29	   	66	B	103	g	140	   	177	±	214	Ö

30	   	67	C	104	h	141	   	178	²	215	×

31	   	68	D	105	i	142	   	179	³	216	Ø

32	   	69	E	106	j	143	   	180	´	217	Ù

33	!	70	F	107	k	144	   	181	µ	218	Ú

34	"	71	G	108	l	145	'	182	¶	219	Û

35	#	72	H	109	m	146	'	183	·	220	Ü

36	$	73	I	110	n	147	   	184	¸	221	Ý

222	Þ	228	ä	234	ê	240	ð	246	ö	252	ü

223	ß	229	å	235	ë	241	ñ	247	÷	253	ý

224	à	230	æ	236	ì	242	ò	248	ø	254	þ

225	á	231	ç	237	í	243	ó	249	ù	255	ÿ

226	â	232	è	238	î	244	ô	250	ú

227	ã	233	é	239	ï	245	õ	251	û


Variable Naming Guidelines
Variable Naming Conventions

Variable names used in IPBASIC programs must adhere to the following conventions.

♦  A name can be from 1 to 40 characters in length.

♦  The first character of the name must be a letter (A through Z or a through z).

♦  Subsequent characters can be any combination of letters (A through Z or a through z), numbers (0 through 9) or the underscore ( _ ) character.

♦  The name must not be an Auto-Pro or IPBASIC reserved word.  Reserved words include Auto-Pro function names and IPBASIC keywords.  See Auto-Pro Keywords for a list of the reserved words.

♦  Names cannot be made unique by case -- the name "VName" describes the same variable as "vname" and "VNAME".


Auto-Pro Data Types
Data Types

IPBASIC

IPBASIC provides the following four simple data types.  To learn more about one of these data types, click its name, below.  If you need to learn about their C equivalents, click here.

♦  String

♦  Integer

♦  Long

♦  Single

You can also create a user-defined data type using the Type...End Type commands.  The user-defined data type allows you to create and operate upon data that is comprised of more than one variable of different types.  Record-like information is usually declared and treated as a user-defined type.

Auto-Pro

The following three special data types have been defined by Auto-Pro, and are used by many of its functions.

♦	RECT  -  The RECT data type is used  to hold two, x,y-coordinate pairs.  This data type is usually used for variables that define a rectangular area within an image.

♦	POINTAPI  -  The POINTAPI data type is used to hold a pair of x,y coordinates.

♦	IPDOCINFO  -  The IPDOCINFO data type is used to hold image information obtained by the IpDocGet function.

To view the definition for one of these data types, click its name, above.


String

The String data type is used to hold character data (e.g., letters, digits and punctuation).  Strings may be variable or fixed length, and are defined as such during declaration.

Internally, a string's storage requirements are the length of the string plus four bytes.  The four bytes are used to store the string's length.  They occupy the first four bytes of the string in memory (C programmers, note that this differs from the way in which strings are stored by C).

Strings may contain up to 65,000 characters.  IPBASIC string data is interpreted according to the ANSI character set (see the ANSI Character Table).


Integer

The integer data type is used to hold nonfractional numeric values (integers), ranging from -32,768 to +32,767.  An Integer is stored as a 16-bit number, occupying 2 bytes of storage.


Long

The Long data type is used to hold large, nonfractional numeric values (integers), ranging from -2,147,483,648 to +2,147,483,647.  A Long value is stored as a 32-bit signed number, occupying 4 bytes of storage.


Single

The Single data type used to hold numeric values that include fractional values, ranging from -3.402823E+38 to -1.401298E-45 (for negative numbers) and +1.401298E-45 to +3.402823E+38 (for positive numbers).  Single data types represent single-precision, floating-point values.  A Single value is stored in three parts: the sign, the exponent and the mantissa.  It requires 4 bytes of storage. Single is also called Float.


RECT

The RECT data type is used  to hold two, x,y-coordinate pairs.  This data type is usually used for variables that define a rectangular area within an image.  It is defined in IPBASIC, as follows:

Type RECT

left As Integer

top As Integer

right As Integer

bottom As Integer

End Type


POINTAPI

The POINTAPI data type is used to hold a pair of x,y coordinates.  It is defined in IPBASIC, as follows:

Type POINTAPI

x As Integer

y As Integer

End Type


IPDOCINFO

The IPDOCINFO data type is used to hold image information obtained by the IpDocGet function.  It is defined in IPBASIC, as follows:

Type IPDOCINFO

Width As Integer

Height As Integer

Class As Integer

Bpp As Integer

Extent As RECT

End Type


C Data Types
C Data Type Equivalents

The Auto-Pro On-line Reference describes its function parameters according to  IPBASIC data types.  The table below describes their C equivalents.

IPBASIC	C

TYPE	TYPE	NOTES

Integer	short	Throughout this reference, parameters that take a "pointer" to an Integer variable are also listed as type, Integer.  You will need to refer to the parameter's description to determine whether the required C data type is short or LPSHORT.

Long	long	Throughout this reference, parameters that take a "pointer" to a Long variable are also listed as type, Long.  You will need to refer to the parameter's description to determine whether the required C data type is long or LPLONG.

Single	float	Throughout this reference, parameters that take a "pointer" to a Single variable are also listed as type, Single.  You will need to refer to the parameter's description to determine whether the required C data type is float or LPFLOAT.

String	LPSTR

char far *	In IPBASIC, a string's storage requirements are the length of the string plus four bytes.  The four bytes are used to store the string's length.  They occupy the first four bytes of the string in memory.

POINTAPI	POINT	See structure definition in ipc.h on the Getting Started with Auto-Pro disk.

RECT	RECT	See structure definition in ipc.h on the  Getting Started with Auto-Pro disk.

IPDOCINFO	IPDOCINFO	See structure definition in ipc.h on the Getting Started with Auto-Pro disk.


Shortcut Key Assignments

The following table shows the names of the shortcut key combinations supported by Auto-Pro.  Shortcut key names must be typed exactly as shown below; case is significant.

n/s = not a supported key assignment.

KEY	ALONE	+CTRL	+SHIFT	+CTRL+SHIFT

F1	n/s	n/s	n/s	n/s

F2	F2	<c>F2	<s>F2	<c><s>F2

F3	F3	<c>F3	<s>F3	<c><s>F3

F4	F4	<c>F4	<s>F4	<c><s>F4

F5	F5	<c>F5	<s>F5	<c><s>F5

F6	F6	<c>F6	<s>F6	<c><s>F6

F7	F7	<c>F7	<s>F7	<c><s>F7

F8	F8	<c>F8	<s>F8	<c><s>F8

F9	F9	<c>F9	<s>F9	<c><s>F9

F10	n/s	n/s	n/s	n/s

F11	F11	<c>F11	<s>F11	<c><s>F11

F12	F12	<c>F12	<s>F12	<c><s>F12

A	n/s	<c>A	n/s	<c><s>A

B	n/s	<c>B	n/s	<c><s>B

C	n/s	<c>C	n/s	<c><s>C

D	n/s	<c>D	n/s	<c><s>D

E	n/s	<c>E	n/s	<c><s>E

F	n/s	<c>F	n/s	<c><s>F

G	n/s	<c>G	n/s	<c><s>G

H	n/s	<c>H	n/s	<c><s>H

I	n/s	<c>I	n/s	<c><s>I

J	n/s	<c>J	n/s	<c><s>J

K	n/s	<c>K	n/s	<c><s>K

L	n/s	<c>L	n/s	<c><s>L

M	n/s	<c>M	n/s	<c><s>M

N	n/s	<c>N	n/s	<c><s>N

O	n/s	<c>O	n/s	<c><s>O

P	n/s	<c>P	n/s	<c><s>P

Q	n/s	<c>Q	n/s	<c><s>Q

R	n/s	<c>R	n/s	<c><s>R

S	n/s	<c>S	n/s	<c><s>S

T	n/s	<c>T	n/s	<c><s>T

U	n/s	<c>U	n/s	<c><s>U

V	n/s	<c>V	n/s	<c><s>V

W	n/s	<c>W	n/s	<c><s>W

X	n/s	<c>X	n/s	<c><s>X

Y	n/s	<c>Y	n/s	<c><s>Y

Z	n/s	<c>Z	n/s	<c><s>Z

0	n/s	<c>0	n/s	<c><s>0

1	n/s	<c>1	n/s	<c><s>1

2	n/s	<c>2	n/s	<c><s>2

3	n/s	<c>3	n/s	<c><s>3

4	n/s	<c>4	n/s	<c><s>4

5	n/s	<c>5	n/s	<c><s>5

6	n/s	<c>6	n/s	<c><s>6

7	n/s	<c>7	n/s	<c><s>7

8	n/s	<c>8	n/s	<c><s>8

9	n/s	<c>9	n/s	<c><s>9