微軟OCR控制項 vb 呼叫 modi

2021-04-18 10:16:23 字數 1057 閱讀 3769

利用微軟ocr控制項, 只需要不到10行**就能夠實現自已的ocr文字識別軟體. 1. 新增控制項,需要安裝office2003, 沒有安裝office2003的可以從別人機子上拷貝相關檔案,註冊regsvr32.exe mdivwctl.dll, 控制項一般在這個目錄下:c:/program files/common files/microsoft shared/modi.0, 只需要相關的幾個檔案就可以了, 此資料夾全部檔案大概在21m左右. 2.工程->部件->新增這個控制項:microsoft office document imaging 11.0 type library

option explicit 'ocr的主要功能 private function ocrimagefile(byval strname as string) as boolean     dim modidocument as new modi.document     dim modiimages as new modi.images     dim modiimage as new modi.image     dim modilayout as new modi.layout     dim imagecount as integer         dim i as integer         modidocument.ocr milang_chinese_simplified, false, false     set modiimage = modidocument.images

for i = 0 to imagecount         set modiimage = modiimages.item(i)         set modilayout = modiimage.layout         text1.text = modilayout.text     next i         modidocument.close false: set modidocument = nothing         if imagecount > 0 then         ocrimagefile = true     else         ocrimagefile = false     end if end function

VB動態建立控制項

dim withevents mybtn as commandbutton set mybtn controls.add vb.commandbutton button1 with mybtn caption 我可以響應事件!width 1800 left 100 top 700 visible t...

VB 實現VC TAbControl控制項

vb 實現vc tabcontrol 控制項新建乙個工程檔案 project1 在左側工具欄中點右鍵 此時,在工具欄的右下角會出現剛新增的元件 sstab 拖動改控制項到 form1 中,該控制項索引是從 0開始算的 在屬性視窗的 tabs 中可以設定控制項中選項頁的頁數,tabsperrow 可以...

vb的activeX控制項

vb6做了乙個簡單的activex控制項,還算是簡單,在專案選擇上選activex控制項,就會出現乙個沒有邊框的form,隨便放上乙個label,設定是center 中間對齊 選擇背景黑色,前景紅色,字型24,和vc比起來,vb可以設定字型大小,背景和前景顏色,vc可以設定y方向上的center。v...