这是VC的代码,是指纹识别的, GetFinger 就是其提供的DLL的函数,
  各位谁有这方面的代码或者帮忙解释一下,给翻译成Delphi的Code,  谢谢。GetFingerSyntax: 
             int   GetFinger( INT DeviceNumber, BYTE* pRawImg, BYTE* pFeature )Return Value:
             FPAPIERR_OK , if successful
             Error code ( < 0 ), otherwiseParameters:
             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.Re:
             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;   
   }
}

解决方案 »

  1.   

    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;
      

  2.   

    GetFingerSyntax: 
                 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 : 特征模板指针Re:
                 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;
      

  3.   

    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;