private Boolean setAutoEvaluationArea()
        {
            int ret = 0;

            //Clear the evaluation areas
            ret = CL.CA2DSDK_ClearEvaluationArea();
            if (ret < 0)
            {
                log("Clear evaluation area", ret);
                return(false);
            }
            log("Clear evaluation area completed", 1);

            //Set the evaluation area layout conditions
            short t = 1;

            if (this.top > 0 && this.left > 0 && this.right > 0 && this.bottom > 0)
            {
                t = 0;
            }
            CL.tagEvaluationCond cond_e = tagEvaluationCond(t);
            ret = CL.CA2DSDK_SetEvaluationAreaCondition(ref cond_e);
            if (ret < 0)
            {
                log("Set evaluation area condition", ret);
                return(false);
            }

            log("Set evaluation area condition completed", 1);
            return(true);
        }
 // Evaluation area condition
 private CL.tagEvaluationCond tagEvaluationCond(short t)
 {
     CL.tagEvaluationCond cond_e = default(CL.tagEvaluationCond);
     cond_e.type           = t;
     cond_e.left           = 5;
     cond_e.top            = 5;
     cond_e.right          = IMAGESIZE - 5;
     cond_e.bottom         = IMAGESIZE - 5;
     cond_e.row            = 1;
     cond_e.col            = 1;
     cond_e.thresholdValue = (double)threshold.Value;
     return(cond_e);
 }