PixelSquare.TesseractOCR.TesseractOCRBridge.GetTesseractDataPath C# (CSharp) Method

GetTesseractDataPath() private method

private GetTesseractDataPath ( IntPtr tesseractHandle ) : IntPtr
tesseractHandle IntPtr
return IntPtr
        public static extern IntPtr GetTesseractDataPath(IntPtr tesseractHandle);

Usage Example

示例#1
0
        /// <summary>
        /// Gets the datapath where the tessdata is stored
        /// </summary>
        /// <returns>Tess data directory path</returns>
        public string GetDataPath()
        {
            Debug.Assert(m_Handle != IntPtr.Zero, "Handle must not be nulled!");

            if(m_Handle != IntPtr.Zero)
            {
                IntPtr dataPathPtr = TesseractOCRBridge.GetTesseractDataPath(m_Handle);
                Debug.Assert(dataPathPtr != IntPtr.Zero, "Datapath must not be nulled!");

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

            return "";
        }