matobj_copy

 

Description

MatrixObject copy function

Syntax

bool matobj_copy( MatrixObject & moDest, const MatrixObject & moSrc, bool bUseROI = true, vector<point> * pROI = NULL, bool bAllAttr = true )

Parameters

moDest
[modify] the destination MatrixObject
moSrc
[input] the MatrixObject to copy
bUseROI
[input] whether to copy region polygon information
pROI
[input] if not NULL, contains the new region polygon data
bAllAttr
[input] indicates whether to copy all attributes

Return

return true on success, else return false.

Examples

EX1

void    matobj_copy_ex1()
{
    //make sure there is a matrixpage name MBook1 with two layers exists before run this code
    //you may import two different images into each layer.
    MatrixPage mp(Project.FindPage("MBook1", EXIST_MATRIX));
    if ( mp )
    {
        MatrixLayer ml1 = mp.Layers(0);
        MatrixLayer ml2 = mp.Layers(1);
        if ( ml1 && ml2 )
        {
            MatrixObject moSrc(ml1, 0);
            MatrixObject moDest(ml2, 0);
            if ( moSrc && moDest )
            {
                bool bRet = matobj_copy(moDest, moSrc, true, NULL, true);
                if ( bRet )
                    printf("Copy MatrixObject successfully!");
                else
                    printf("Fail to copy MatrixObject!");
            }
        }
    }
}

Remark

See Also

header to Included

origin.h

Reference