CImage:TableToRow


The TableToRow method pastes (imbeds) a 1-dimensional array into a row of the CImage object. The length of the array determines the column extent of the imbedded row. The table is imbedded at the specified integer-valued (column, row) offsets. This method is similar to the Imbed method, except that it imbeds a 1-dimensional array rather than another CImage. The inverse operation, copying a CImage row to an array, uses the RowToTable method.

Syntax

nResult = CImage:TableToRow( tbl, nColMin, nRowMin )

bullet.gif    tbl is a 1-dimensional array to be imbedded as a row in the CImage.

bullet.gif    nColMin and nRowMin are the integral (column, row) offsets to the corner where tbl is imbedded.

bullet.gif    On success, this method returns nResult = 1.

bullet.gif    On failure, nResult contains the following error codes:

bullet.gif    -1: The array tbl is not valid.

bullet.gif    -2: Not enough parameters were passed.

bullet.gif    -3: Invalid CImage object.

bullet.gif    -4: Internal error.

bullet.gif    -5: The column coordinate is invalid.

bullet.gif    -6: The row coordinate is invalid.

Example

Suppose that a CImage I exists. The following script imbeds a row of values into the CImage. The imbedding corner is set to coordinates (100,250):

nMinC = 100 ; nMinR = 250

-- position the corner of tbl at these offsets in I

tbl = {}

-- create a table (this will be a 1-D table)

tbl[1] = 15.3

-- assign the first value

tbl[2] = 12.592

-- assign the second value

-- complete the row...

 

nRet = I:TableToRow( tbl, nMinC, nMinR )

-- imbed tbl as a row at corner (100,250)

if nRet != 1 then Printf("Err %d\n", nRet) end

-- an error occured

Related Topics

CImage class, Imbed, RectToTable, arraytoimage, RowToTable, TableToRect, TableToCol


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.