GetVariable() private méthode

private GetVariable ( IntPtr tesseractHandle, string name ) : IntPtr
tesseractHandle IntPtr
name string
Résultat IntPtr
Exemple #1
0
        /// <summary>
        /// Gets a type boolean configuration variable
        /// </summary>
        /// <param name="name">Parameter Name</param>
        /// <returns>Integer Result</returns>
        private bool GetConfigBoolVariable(string name)
        {
            bool result = false;

            Debug.Assert(m_Handle != IntPtr.Zero, "Handle must not be nulled!");

            if(m_Handle != IntPtr.Zero)
            {
                if(TesseractOCRBridge.GetVariable(m_Handle, name, out result))
                {
                    return result;
                }
            }

            return result;
        }
Exemple #2
0
        /// <summary>
        /// Gets a type double configuration variable
        /// </summary>
        /// <param name="name">Parameter Name</param>
        /// <returns>Double Result</returns>
        private double GetConfigDoubleVariable(string name)
        {
            double result = 0;

            Debug.Assert(m_Handle != IntPtr.Zero, "Handle must not be nulled!");

            if(m_Handle != IntPtr.Zero)
            {
                if(TesseractOCRBridge.GetVariable(m_Handle, name, out result))
                {
                    return result;
                }
            }

            return result;
        }
Exemple #3
0
        /// <summary>
        /// Gets a type string configuration variable
        /// </summary>
        /// <param name="name">Parameter Name</param>
        /// <returns>String Result</returns>
        private string GetConfigStringVariable(string name)
        {
            Debug.Assert(m_Handle != IntPtr.Zero, "Handle must not be nulled!");

            if(m_Handle != IntPtr.Zero)
            {
                IntPtr stringPtr = TesseractOCRBridge.GetVariable(m_Handle, name);
                Debug.Assert(stringPtr != IntPtr.Zero, "Handle must not be nulled!");

                if(stringPtr != IntPtr.Zero)
                {
                    return Marshal.PtrToStringAnsi(stringPtr);
                }
            }

            return "";
        }