apply palette to Image
int apply_pal_to_image( Image & img, string strPalFile )
SUCCESS or a LeadTools error number less than zero.
Prior to compilation, load matdata_utils.c to the workspace by executing the following LabTalk command:
Run.LoadOC("Originlab\matdata_utils.c", 16);
To retain matdata_utils.c in the workspace for successive sessions, drag and drop the file from the Temporary folder to the System folder.
EX1
#include <..\originlab\matdata_utils.h> #include <image_utils.h> //this example assumes that there is already an image in the active matrixsheet void apply_pal_to_image_ex1() { MatrixObject mobj; if (!mobj.Attach("MBook1")) { out_str("Attachment failed!"); } Image img(mobj); if(!img.IsValid()) return; string strPalFile = GetAppPath(true) + "Samples\Image Processing and Analysis\cell.jpg"; int nRet = apply_pal_to_image(img, strPalFile); if (nRet) { out_str("Apply palette to Image Success"); } else { out_str("Apply palette to Image failed"); } }
apply_pal_to_LT_bmp
matdata_utils.h