Example #1
0
        internal string toolsPage(string fileName, int page)
        {
            CiTools tools = null;

            try
            {
                CiServer ci = Inlite.ClearImageNet.Server.GetThreadServer();
                tools = ci.CreateTools();
                string s = ""; int cnt = 0;
                tools.Image.Open(fileName, page);
                double dSkew = tools.MeasureSkew(); s = s + string.Format("Skew {0:0.##} deg", dSkew) + Environment.NewLine;
                if (tools.Image.BitsPerPixel == 1)
                {
                    CiObject obj = tools.FirstObject();
                    while (obj != null)
                    {
                        cnt++;
                        if (cnt < 10 && obj.Pixels > 1)
                        {
                            AddObject(ref s, cnt, obj);
                        }
                        obj = tools.NextObject();
                    }
                    s = s + string.Format("Object Count: {0}", cnt) + Environment.NewLine;
                }
                return(s);
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
            finally
            {
                if (tools != null)
                {
                    tools.Image.Close();                 // ClearImage V9 and later.  Immediately free memory
                }
            }
        }
Example #2
0
 public void Code_Regex()
 {
     CiTools.CmdShowRegexWindow();
 }
Example #3
0
 public static void Regex()
 {
     CiTools.CmdShowRegexWindow();
 }
Example #4
0
 public void Code_Keys()
 {
     CiTools.CmdShowKeysWindow();
 }
Example #5
0
 public static void Keys()
 {
     CiTools.CmdShowKeysWindow();
 }