要求不管用什么方法识别出图里的文字:http://www.sszsoft.cn/未命名.bmp能做完成的加我QQ:173734592 详谈!
解决方案 »
- 提取数组中数字的问题
- vb中的小数保留
- vb修改XML节点问题
- 请高手指点!数据库中有存放RTF格式的内容,怎样正确展现在ListView或Grid中或其它列表框控件中
- 关于createprocess用法
- 计算磁盘剩余空间时溢出,怎么解决?
- 谁要分!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- Excel導入到SQL中去,執行上面程序時出現錯誤,odbc不能呼叫
- 我用空格作为split函数的分割符,请问:如何处理多个连续的空格?
- 为了感谢vb论坛的兄弟姐妹们---特别是现在还在线的夜猫子。http://www.csdn.net/expert/topic/356/356033.shtm--这个帖子再加分!!
- 求控件
- 关于网页内获取链接再度求解
Begin VB.Form Form1
Caption = "VB实现OCR文字识别"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "识别"
Height = 495
Left = 1800
TabIndex = 0
Top = 1320
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option ExplicitPrivate Sub Command1_Click()
Dim strLayoutInfo As String
Dim miDoc As Object
Dim modiLayout As Object '初始化并加载文档
Set miDoc = CreateObject("MODI.Document") '创建对象
miDoc.Create "z.tif" '加载图片文件 Screen.MousePointer = vbHourglass '设置光标忙
'识别
miDoc.Images(0).OCR miLANG_CHINESE_SIMPLIFIED, True, True '有用的就此一句,识别为中文简体 Set modiLayout = miDoc.Images(0).Layout '读出数据
strLayoutInfo = _
"Language: " & modiLayout.Language & vbCrLf & _
"Number of characters: " & modiLayout.NumChars & vbCrLf & _
"Number of fonts: " & modiLayout.NumFonts & vbCrLf & _
"Number of words: " & modiLayout.NumWords & vbCrLf & _
"Beginning of text: " & Left(modiLayout.Text, 50) & vbCrLf & _
"First word of text: " & modiLayout.Words(0).Text
MsgBox strLayoutInfo, vbInformation + vbOKOnly, "Layout Information"
Set modiLayout = Nothing
Set miDoc = Nothing
Screen.MousePointer = vbDefault
End Sub