Layer::GetImageData

 

Description

Get the data (gray scale levels) of a bitmap graphic object.

Syntax

BOOL GetImageData( LPCSTR lpcszImageName, matrixbase & mat, int nGrayScaleBits = 8 )

Parameters

lpcszImageName
[input] constant pointer to a string contianing the name of the bitmap graphic object
mat
[output] the matrix to receive the data
nGrayScaleBits
[input] the number of gray scale levels to convert a non-gray scale image to before getting the data

Return

TRUE if the data was obtained else FALSE.

Examples

EX1

//assume a image object name "BMP" in the layet
void Layer_GetImageData_ex1()
{
    Layer ly = Project.ActiveLayer();
    if( !ly.IsValid() )
        return;
    
    string strName = "BMP";
    matrix<BYTE>    mm;
    if ( ly.GetImageData(strName, mm) )
    {
        printf("GetNumRows() = %d\n", mm.GetNumRows());
        printf("GetNumCols() = %d\n", mm.GetNumCols());
    }
}

Remark

See Also

header to Included

origin.h