Asprise OCR 5.01,去除试用对话框,aocr.dll
使用:
private const string OCR_DLL_NAME_32 = "aocr.dll";
[DllImport(OCR_DLL_NAME_32, CharSet = CharSet.Ansi)]
public static extern int com_asprise_ocr_setup(int queryOnly);
[DllImport(OCR_DLL_NAME_32, CharSet = CharSet.Ansi)]
public static extern IntPtr com_asprise_ocr_start(string lang, string speed);
[DllImport(OCR_DLL_NAME_32, EntryPoint = "com_asprise_ocr_recognize")]
public static extern IntPtr com_asprise_ocr_recognize(Int64 handle, string imgFiles, int pageIndex, int startX, int startY, int width, int height, string recognizeType, string outputFormat, string propSpec, string propSeparator, string propKeyValueSpeparator);
[DllImport(OCR_DLL_NAME_32, CharSet = CharSet.Ansi)]
public static extern void com_asprise_ocr_util_delete(Int64 handle, bool isArray);
com_asprise_ocr_setup(0);
IntPtr _handle = com_asprise_ocr_start("eng", "fastest");
IntPtr ptr = com_asprise_ocr_recognize(_handle.ToInt64(), [图片路径], -1, -1, -1, -1, -1, "all", "text", "", "|", "=");
string s = Marshal.PtrToStringAnsi(ptr).Replace("\n", "");
============
官方下载:http://asprise.com/royalty-free-library/ocr-api-for-java-csharp-vb.net.html
1