【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.1.12.2 apply_pal_to_image
Contents
Description
apply palette to Image
Syntax
int apply_pal_to_image( Image & img, string strPalFile )
Parameters
- img
- [modify] the image need to apply palette.
- strPalFile
- [input] palette file path
Return
SUCCESS or a LeadTools error number less than zero.
Examples
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"); } }
Remark
See Also
Header to Included
matdata_utils.h