2.2.4.28.4 MatrixObject::CopyToMatrix

Description

Copy a rectangle portion of the matrix object to one matrix.

Syntax

BOOL CopyToMatrix(MatrixObject &mo, RECT* pRect, BOOL bUndo = FALSE)

Parameters

mo
[output] the result matrix object
pRect
[input] the rectangle portion to be copied to
bUndo
[input] if support undo for this copy

Return

return TRUE if the rectangle was copied to matrix else FALSE

Examples

EX1

//Copy a rectangle portion of the matrix object to a new matrix. 
void MatrixObject_CopyToMatrix_EX1()
{
    MatrixPage mp = Project.MatrixPages(0);
    if(!mp)
        return; 
    MatrixObject mo(mp.GetName(), 0);    
    
    int nNumRows = mo.GetNumRows();
    int nNumCols = mo.GetNumCols();
    
    RECT rect;//construct a rectangle object.
    rect.left = 0;
    rect.top = 0;
    rect.right = nNumCols / 2;
    rect.bottom = nNumRows / 2; 
 
    MatrixPage mpResult;
    mpResult.Create("origin");
    MatrixObject moResult(mpResult.GetName(), 0);
 
    if( mo.CopyToMatrix(moResult, &rect) )
        printf("Copied to another matrix object");    
}

Remark

See Also

MatrixObject::CopyToClipboard

Header to Include

origin.h