MatrixObject::SetImageMask

Description

Set MatrixObject's image mask. It creates an one byte DIB from data of the Origin C matrix data object, then, sets that DIB image as image mask for the MatrixObject.

Syntax

BOOL SetImageMask( matrix<byte> & mMask )

Parameters

mMask
[input] An Origin C matrix data object to retrieve image mask. Its type is matrix<byte>.

Return

TRUE/FALSE. TRUE indicates the mask has been retrieved successfully. Otherwise, return FALSE

Examples

EX1

// Matrix should be the active window 
void    MatrixObject_SetImageMask_Ex1()
{
    MatrixObject mObj(Project.MatrixPages(0).GetName(), 0);  
    if( mObj )
    {
        matrix<byte> mMask;
        if( mObj.GetImageMask(mMask) )
        {
            printf("The mask is retrieved\n");
            printf("Numder of rows are: %d, Number of Cols are: %d\n", mMask.GetNumRows(), mMask.GetNumCols()); 
            
            MatrixObject mObj2("MBook2", 0);
            mObj2.SetImageMask(mMask);
        }
    }
    else
        printf("Matrix not active window.\n");
}

Remark

See Also

MatrixObject::GetImageMask

Header to Include

origin.h