MatrixObject::SetSize

Description

Set the number of rows and columns.

Syntax

BOOL SetSize( uint nNumRows, uint nNumCols, DWORD dwCntrl = OCD_RESTORE | OCD_INITDATA )

Parameters

nNumRows
[input] Input number of rows to set, must be > 0
nNumCols
[input] Input number of columns to set, must be > 0
dwCntrl
[input] bits to control what happen after size changes, supported bits are
OCD_RESTORE = first copy original matrix data and after size change paste them back.
OCD_INITDATA = init new cells to missing values, can skip this if you are going to fill the data yourself
default is OCD_RESTORE | OCD_INITDATA.

Return

Returns TRUE on successful exit and FALSE on failure.

Examples

EX1

// Change a 32 x 32 matrix to 640 x 480
// Assume a matrix is the active window
void MatrixObject_SetSize_Ex1()
{
    MatrixLayer    ml = Project.ActiveLayer();
    if(ml)
    {
        BOOL bRet = ml.SetSize(480, 640); // Rows, Columns
        if(bRet)
            printf("Matrix expansion succeeded.\n");
        else
            printf("Matrix expansion failed.\n");
    }
    else
        printf("Matrix window not active.\n");
}

Remark

See Also

MatrixObject::SetNumRows, MatrixObject::SetNumCols, MatrixObject::GetNumRows, MatrixObject::GetNumCols, Datasheet::GetNumRows, Datasheet::GetNumCols, Datasheet::SetNumRows

header to Include

origin.h