1,183
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.Button2Click(Sender: TObject);
var
myhandle: THandle;
FPointer: Pointer;
Myfun_OCRpic: OCRpic;
jz_ok: string;
ms: TStream;
Buffer:Word;
begin
if _DLLMoudle > 32 then
begin
try
FPointer := GetProcAddress(_DLLMoudle, PChar('OCRpic')); //取函数的地址。
if FPointer <> nil then //如果函数存在就调用
begin
Myfun_OCRpic := OCRpic(FPointer);
ms:=TmemoryStream.Create;
image1.Picture.Bitmap.SaveToStream(ms);
ms.Position := 0;
ms.ReadBuffer(Buffer,ms.Size);
jz_ok := Myfun_OCRpic(Buffer,ms.Size); //识别,这里易语言里面函数是需要一个图片字节集,和图片数据大小
Memo1.Lines.Add('识别返回:' + jz_ok);
end;
except
FreeLibrary(myhandle);
end;
end;
end;