2.1.13.13 image_import_to_matrix


Description

Import an image file into a matrix

Syntax

bool image_import_to_matrix( MatrixObject & moTarget, LPCSTR lpcszFile, TreeNode & trFileInfo = NULL, TreeNode & trFilter = NULL, int * pErr = NULL )

Parameters

moTarget
[modify] the target matrix object
lpcszFile
[input] the image filename
trFileInfo
[input] the tree containning the information of the image file, internal used.
trFilter
[input] the tree containning the information of import filter, internal used.
pErr
[output] pointer to error code

Return

if success, return true, otherwise return false.

Examples

EX1

#include <image_utils.h>
void image_import_to_matrix_ex1()
{
    MatrixLayer ml = Project.ActiveLayer();
    MatrixObject mo = ml.MatrixObjects();

    string fn = GetOriginPath() + "samples\\Image Processing and Analysis\\scale.jpg";
    image_import_to_matrix(mo, fn);
}

Remark

See Also

export_Matrix_to_image, image_import

Header to Included

image_utils.h

Reference