2.2.4.28.13 MatrixObject::GetImageMask

Description

Syntax

BOOL GetImageMask( matrix<byte> & mMask )

Parameters

mMask
[output] 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_GetImageMask_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("Matrix2", 0);
            mObj2.SetImageMask(mMask);
        }
    }
    else
        printf("Matrix not the active window\n");
}

Remark

GetImageMask() will get MatrixObject's image mask. The mask of an Origin image is an one byte DIB image. This method will first set the Origin C matrix data object to have same dimensions as the image mask, then, copy all bytes from the mask image to corresponding locations in Origin C matrix data object. If the return is TRUE, the Origin C matrix data object will have the mask image data.

See Also

MatrixObject::SetImageMask

Header to Include

origin.h