This function apply the palette to the matrix object
int ApplyPalette( LPCSTR lpcszPal, DWORD dwCntrl = MOPAL_USE_ORIGINAL, BOOL bUndo = FALSE )
Returns MOPALERROR_NO_ERROR on successful and a non-zero error code on failure, see MATOBJPALERROR
EX1
void mo_copy_palette(const MatrixObject& moSrc, MatrixObject& moDest) { if( !moSrc || !moDest ) return; string strPal; DWORD dwCntrl; if( 0 == moSrc.GetPaletteInfo(strPal, dwCntrl) ) moDest.ApplyPalette(strPal, dwCntrl); }
MatrixObject::GetPaletteInfo
origin.h