procedure TForm1.Button1Click(Sender: TObject);
Var
doc :IDocument;
Img :IImage;
Layout :ILayout;
begin
doc := IDispatch(CreateOleObject('MODI.Document')) as IDocument;
doc.create('C:\1.bmp'); // just put here the filename of an image
doc.OCR(miLANG_ENGLISH,true,true);
Img := IDispatch(doc.Images[0]) as IImage;
Layout := IDispatch(Img.Layout) as ILayout;
Memo1.Clear;
Memo1.Lines.Add(Layout.Text);
MiDocView1.Document := doc;
doc.Close(false);
Img := nil;
Layout := nil;
end;
end.
上面是一个使用MODI(Microsoft Office Document Imaging )进行ocr识别的一个例子,请教各位高手,如何将抓屏得到bmp图片直接进行OCR,而不是保存在硬盘里后再调用OCR进行识别?