MatrixLayer::SetViewImage

Description

set matrix view mode to image or data mode

Syntax

BOOL SetViewImage( BOOL bSetViewImage = TRUE, BOOL bAllObjs = TRUE, int nImgIndex = 0, int nOption = -1 )

Parameters

bSetViewImage
[input] TRUE to set matrix as View Image mode, FALSE to set matrix as View Data mode
bAllObjs
[input] TRUE to set view mode for all objects, FALSE to set view mode for active object
nImgIndex
[input] Index of the image to view. < 0 to keep current internal setting
nOption
[input] The use of this parameter is dependent on the data type.
For complex matrix it is used to display an image based on the Real, Imaginery, Phase, or Amplitude values.
Use the GECE_REAL, GECE_IMAG, GECE_PHASE, or GECE_AMPL macros. Pass -1 to keep current setting.

Return

TRUE for success, FALSE for failure

Examples

EX1

//set matrix view mode to image.
void MatrixLayer_SetViewImage_Ex1()
{
    MatrixLayer ml = Project.ActiveLayer();
    if( !ml )
        return;
    
    //should make sure matrix layer's data type is double
    //otherwise can not use Matrix mat(ml);
    ml.SetInternalDataType(FSI_DOUBLE);
    Matrix mat(ml);
    mat.SetSize(32,32);
    mat = 20;
    if( ml.SetViewImage(TRUE) ) // set view mode to image for all objects
        printf("Success to set matrix view mode!");
    else
        printf("Fail to set matrix view mode!");
}

Remark

See Also

header to Include

origin.h