这边----->急急急VC转Delphi的问题??

rak 2003-04-17 09:08:47
这是VC的代码,是指纹识别的, GetFinger 就是其提供的DLL的函数,
各位谁有这方面的代码或者帮忙解释一下,给翻译成Delphi的Code, 谢谢。

GetFinger

Syntax:
int GetFinger( INT DeviceNumber, BYTE* pRawImg, BYTE* pFeature )

Return Value:
FPAPIERR_OK , if successful
Error code ( < 0 ), otherwise

Parameters:
DeviceNumber : device number which is connected on your PC.
pRawImg : pointer to the buffer to store raw fingerprint image.
pFeature : pointer to the buffer to store feature template.

Remark:
Get the fingerprint image from the sensor and extract the feature template. At this time, buffers for fingerprint image and for feature template are previously allocated before calling this function. The size of buffer for image is 280X320 bytes and the minimum size of buffer for template is 480 bytes. The result of image quality checking is returned by result of this function, so you can use it to adjustment the application.

Example:


Void CSDKTestView:: OnGetFinger()
{
int cx = 280;
int cy = 320;
int DeviceNumber = 0; // specify the first device
BYTE* pImage = new BYTE[cx*cy], pVect[480];
int result = GetFinger( DeviceNumber, pImage, pVect );
if ( result != FPAPIERR_OK )
{
AfxMessageBox( “Process is failed!” );
return;
}
}
...全文
25 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
westfly 2003-04-17
  • 打赏
  • 举报
回复
procedure CDSKTESTView.OnGetFinger;
const
cx: Integer = 280;
cy: Integer = 320;
DeviceNumber: Integer = 0;
var
pImage, pVect: array of Byte;
begin
SetLength(pImage, cx * cy);
SetLength(pVect, 480);
if GetFinger(DeviceNumber, pImage, pVect) <> FPAPIERR_OK then
showmessage('Process is failed!');
end;
风轻狂 2003-04-17
  • 打赏
  • 举报
回复
问一下,你用的是什么指纹仪???
风轻狂 2003-04-17
  • 打赏
  • 举报
回复
GetFinger

Syntax:
GetFinger( DeviceNumber:Integer; pRawImg, pFeature:PByte): Integer; external 'DLL文件名' name 'GetFinger';

Return Value:
FPAPIERR_OK , if successful
Error code ( < 0 ), otherwise


Parameters:
DeviceNumber : 设备号
pRawImg : 指纹图象指针
pFeature : 特征模板指针

Remark:
Get the fingerprint image from the sensor and extract the feature template. At this time, buffers for

fingerprint image and for feature template are previously allocated before calling this function. The size of buffer for

image is 280X320 bytes and the minimum size of buffer for template is 480 bytes. The result of image quality checking is

returned by result of this function, so you can use it to adjustment the application.

Example:

procedure TForm1.OnGetFinger;
const
FPAPIERR_OK = 1;
cx = 280;
cy = 320;
DeviceNumber = 0;
var
arrImage : Array[0..cx * cy] of byte;
arrVect : Array[0..480] of byte;
pImage,pVect : PByte;
begin
pImage:= @arrImage;
pVect:= @arrVect;
if GetFinger( DeviceNumber, pImage, pVect ) <> FPAPIERR_OK then
begin
ShowMessage( 'Process is failed!' );
end;
end;
爱编程的老五 2003-04-17
  • 打赏
  • 举报
回复
procedure CDSKTESTView.OnGetFinger;
var
cx, cy, DeviceNumber: integer;
pImage, pVect: pbytearray;
iRes: integer;
begin
cx := 280;
cy := 320;
DeviceNumber := 0;
getmem(pImage, cx*cy);
getmem(pVect, 480);
iRes := GetFinger(DeviceNumber, pImage, pVect);
if (iRes <> FPAPIERR_OK) then
showmessage('Process is failed!');
end;

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧