Ir para conteúdo
Fórum Script Brasil

Bryant

Membros
  • Total de itens

    84
  • Registro em

  • Última visita

Posts postados por Bryant

  1. Galera,

    Alguém sabe como mover sheets via delphi?

    Exemplo:

    Workbook.Sheets.Add (EmptyParam, EmptyParam, Count, SheetType, FLCID);
          Workbook.Sheets.Move(2, 3, FLCID);
    Onde workbook:
    property Workbook       : TExcelWorkbook  read GetWorkbook;

    Utilizando ExcelXP.pas que fica na pasta Ocx/Servers do próprio Delphi.

    Ele retorna "ole error 800a03ec"

    Eu crio uma sheet, depois quero mover para a posição indicada, depois da 2 e antes da 3.. mas não consigo.

    Alguém tem alguma idéia?

    Obrigado ;)

  2. Alguém consegue enviar email para yahoo, ou gmail?

    Através do delphi não consigo de jeito nenhum.

    Consegui enviar emails internos da seguinda maneira:

    var
      FSmtpClient: TIdSMTP;
    FSmtpClient.QuickSend(FSMTP, GetEmailSubject(MsgTitle), UserEmail, FUserID, Msg.Text);
    Desta maneira, consigo enviar um email normalmente através do smtp da wnet, mas se tento enviar para outro e-mail, por exemplo teste@yahoo.com.br, tenho como retorno: "Recipient address rejected: Access denied", sendo que não deveria acontecer, visto que envio normalmente pelo outlook por exemplo. Pediram pra setar o UseEhlo para false, mas mesmo assim o problema persiste:
    FSmtpClient.UseEhlo     := False;

    Baixei 2 DLL's que eram necessárias, "ssleay32.dll" e "libeay32.dll", mas ainda nada.

    Alguém tem alguma idéia?

    Vlw!

  3. Galera,

    Estou com uma dúvida enorme, criei um webservice, sem NADA, dai setei o encoding dele para http://schemas.xmlsoap.org/soap/encoding/

    Depois tentei alterar para vários valores: vazio, "aaaa" e por aí vai.. mas ele sempre inclui.

    Código abrindo o WSDL pelo IE

    <?xml version="1.0" encoding="utf-8" ?> 
    - <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="ICoBioWebServiceIntfservice" targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
      <portType name="ICoBioWebServiceIntf" /> 
    - <binding name="ICoBioWebServiceIntfbinding" type="tns:ICoBioWebServiceIntf">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> 
      </binding>
    - <service name="ICoBioWebServiceIntfservice">
    - <port name="ICoBioWebServiceIntfPort" binding="tns:ICoBioWebServiceIntfbinding">
      <soap:address location="http://localhost/testews/FingerprintBioWS.dll/soap/ICoBioWebServiceIntf" /> 
      </port>
      </service>
      </definitions>
    Código abrindo o SOAP pelo IE
    <?xml version="1.0" ?> 
    - <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    - <SOAP-ENV:Body>
    - <SOAP-ENV:Fault>
      <faultactor /> 
      <faultcode>SOAP-ENV:Server</faultcode> 
      <faultstring>O documento XML deve ter um elemento de nível superior. Line: 0</faultstring> 
      </SOAP-ENV:Fault>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

    Esse erro eu obtenho quando utilizo esse encoding, mas se eu removo ele aparece de qualquer forma, meu web.config não tem nada, por isso nem é setado por lá.

    Alguém tem idéia?

  4. Galera,

    Estou pensando em algumas certificações.

    Minha experiência de trabalho tem sido voltada muito para web e delphi.

    Eu gostaria de saber se alguém recomenda uma certificação em específico, se tem idéia do que esstudar, aonde algum curso é dado.

    Eu pensei em algo relacionado a BD... SQL sei lá..

    Alguém tem alguma idéia?

    Vlw!

  5. Link para um .rar com 5 samples:

    http://www.sendspace.com/file/0o9eln

    Obrigado pela ajuda toda ai Jhonas! ;)

    Aproveito e vou jogar minha unit toda aqui pra se você puder testar:

    unit UImgConverter;
    
    interface
    
    uses
      Classes, Types;
    
    type
      TImgConverter = class
      public
        class function WSQ2JpgBmp(WsqBuffer: PByte): Integer;
      end;
    
    function ImgConvWSQToRawBuf(WsqBuffer: PByte; RawBuffer: PByte; var Size: Integer; var Width: Integer; var Height: Integer): Integer; cdecl; external 'NImgConv.dll' name 'NBioAPI_ImgConvWSQToRawBuf';
    function ImgConvRawToBmpBuf(RawBuffer: PByte; Width: Integer; Height: Integer; BmpBuffer: PByte; out Size: Integer): Integer; cdecl; external 'NImgConv.dll' name 'NBioAPI_ImgConvRawToBmpBuf';
    function ImgConvRawToJpgBuf(RawBuffer: PByte; Width: Integer; Height: Integer; Quality: Integer; BmpBuffer: PByte; out Size: Integer): Integer; cdecl; external 'NImgConv.dll' name 'NBioAPI_ImgConvRawToJpgBuf';
    
    implementation
    
    uses
      Windows, Dialogs, SysUtils, ActiveX, Variants, NBioBSPCOMLib_TLB;
    
    {=================================================================
      CONVERTE UMA IMAGEM WSQ E SALVA EM BMP E JPG
    =================================================================}
    class function TImgConverter.WSQ2JpgBmp(WsqBuffer: PByte): Integer;
    var
      OutBufferPtr: PByte;
      BmpBuffer   : PByte;
      JpgBuffer   : PByte;
    
      OutBufferJpg: array of Byte;
      OutBufferBmp: array of Byte;
      RawBuffer   : array of Byte;
    
      ArqJpg      : TFileStream;
      ArqBmp      : TFileStream;
    
      BmpSize     : Integer;
      JpgSize     : Integer;
      Size        : Integer;
      Width       : Integer;
      Height      : Integer; 
    
      NomeArquivo : string;
    
    const
      MAX_ARRAY   = 390000;
      JPG_QUALITY = 75;
      IMG         = 'C:\Users\user\Desktop\convertidas\convertido';
    
    begin
      try
        //RAW
        SetLength(RawBuffer, MAX_ARRAY);
        OutBufferPtr := PByte(@(RawBuffer[0]));
    
        //BMP
        SetLength(OutBufferBmp, MAX_ARRAY);
        BmpBuffer := PByte(@(OutBufferBmp[0]));
    
        //JPG
        SetLength(OutBufferJpg, MAX_ARRAY);
        JpgBuffer := PByte(@(OutBufferJpg[0]));
    
        Result := ImgConvWSQToRawBuf(WsqBuffer, OutBufferPtr, Size, Width, Height);                 //WSQ -> RAW
        Result := ImgConvRawToJpgBuf(OutBufferPtr, Width, Height, JPG_QUALITY, JpgBuffer, JpgSize); //RAW -> JPG
        Result := ImgConvRawToBmpBuf(OutBufferPtr, Width, Height, BmpBuffer, BmpSize);              //RAW -> BMP
    
        try
          //Criando .jpg e .bmp
          NomeArquivo := IMG + FloatToStr( Now );
    
          ArqJpg := TFileStream.Create(NomeArquivo + '.jpg', fmCreate);
          ArqJpg.Write(OutBufferJpg[0], JpgSize);
    
          ArqBmp := TFileStream.Create(NomeArquivo + '.bmp', fmCreate);
          ArqBmp.Write(OutBufferBmp[0], BmpSize);
        finally
          if Assigned(ArqBmp) then
            FreeAndNil ( ArqBmp );
          if Assigned(ArqJpg) then
            FreeAndNil ( ArqJpg );
        end;
    
      except
        on e:Exception do
          begin
            ShowMessage( e.Message );
            Result := -1;
          end;
      end;
    end;
    
    end.

  6. Não tinha reparado realmente, obrigado Jhonas.

    O ruim é que ele não deixa diminuir o tamanho, só se for bem pouco do tipo 380000, senão ele executa a primeira função e logo termina sem fazer nada.

    Porque no exemplo de C++ eles realmente utilizam 390000:

    lpBMPBuf = new unsigned char[600 * 650];
    Po muito estranho isso não é oO ...meio sem idéias :huh: EDIT: o retorno do size está desta maneira:
    RAW_ARRAY = 384400;
    JPG_ARRAY = 323015;
    BMP_ARRAY = 385478;

    Este é o out de cada uma das funções, realmente o valor 390000 está certo aparentemente, mas ele quebra mesmo assim =/

  7. Só para evitar de criar um outro tópico..

    Estas conversões são tão erradas assim?

    Estou utilizando um .wsq perfeito e quando faço a conversão para .bmp ou .jpg eu tenho um retorno do tipo:

    convertido.png

    Utilizando as funções

    function ImgConvWSQToRawBuf(WsqBuffer: PByte; RawBuffer: PByte; var Size: Integer; var Width: Integer; var Height: Integer): Integer; cdecl; external 'NImgConv.dll' name 'NBioAPI_ImgConvWSQToRawBuf';
    function ImgConvRawToBmpBuf(RawBuffer: PByte; Width: Integer; Height: Integer; BmpBuffer: PByte; out Size: Integer): Integer; cdecl; external 'NImgConv.dll' name 'NBioAPI_ImgConvRawToBmpBuf';
    E uma função para fazer isto:
    class function TImgConverter.WSQ2Raw(WsqBuffer: PByte): Integer;
    var
      OutBufferPtr: PByte;
      BmpBuffer   : PByte;
      BmpSize     : Integer;
      OutBuffer   : array of Byte;
      RawBuffer   : array of Byte;
      Size, Width, Height: Integer;
      ArqWsq      : TFileStream;
      tmp         : String;
    
    const
      RAW_ARRAY = 390000;
      BMP_IMG = 'C:\Users\user\Desktop\convertido.jpg';
      
    begin
      try
        //BMP
        SetLength(OutBuffer, RAW_ARRAY+1);
        BmpBuffer    := PByte(@(OutBuffer[0]));
    
        //RAW
        SetLength(RawBuffer, RAW_ARRAY+1);
        OutBufferPtr := PByte(@(RawBuffer[0]));
    
        Result := ImgConvWSQToRawBuf(WsqBuffer, OutBufferPtr, Size, Width, Height);         //WSQ -> RAW
        Result := ImgConvRawToBmpBuf(OutBufferPtr, Width, Height, BmpBuffer, BmpSize);      //RAW -> BMP
    
        try
          ArqWsq := TFileStream.Create(BMP_IMG, fmCreate);
          ArqWsq.Write(OutBuffer[0], Length(OutBuffer));
        finally
          if Assigned(ArqWsq) then
            FreeAndNil ( ArqWsq );
        end;
      except
        Result := -1;
      end;
    end;

    Mas a conversão é feita pessimamente, ele estraga completamente a imagem, fora que depois da execução, um tempinho depois o programa estoura (fiz um executável APENAS com isso).

    Tem alguma idéia do porque de uma conversão tão mal feita?

    Obrigado.

  8. Eu fiz o webservice chamando um executável só para fazer esta conversão.

    Ele consegue fazer, mas sempre estoura a memória no final, tudo muito estranho.

    o ruim é que o raw que ele gera, pela griaule dá sempre um template de má qualidade.

    Vou pesquisar mais sobre, obrigado mais uma vez Jhonas.

  9. Pessoal, possuo um webservice (dll) e dentro dele existe uma unit que utiliza uma outra DLL, uma chamada do tipo:

    function ImgConvWSQToRawBuf(WsqBuffer: PByte; RawBuffer: PByte; var Size: Integer; var Width: Integer; var Height: Integer): Integer; cdecl; external 'NImgConv.dll' name 'NBioAPI_ImgConvWSQToRawBuf';

    Mas o webservice não consegue executá-la, apenas consigo utilizar numa aplicação normal.

    Existe alguma limitação ou configuração que eu precise utilizar no IIS para que ele consiga rodar esta função? A .dll está no system32, adicionei como restrições ISAPI e CGI, mas ainda sim não consigo utilizar.

    Alguém tem idéia?

    Obrigado.

  10. Acho que consegui alguma coisa...

    function WSQ2Raw(WsqBuffer: PByte; out RawBuffer: OleVariant; out Size: Integer; out Width: Integer; out Height: Integer): Integer;
    var
      ImgConv     : THandle;
      WSQToRawBuf : TImgConvWSQToRawBuf;
      OutBuffer   : array[0..420000] of Byte;
      OutBufferPtr: PByte;
      Ix          : Integer;
    
    const
      IMG_DLL   = 'NImgConv.dll';
      RAW_ARRAY = 420000;
      
    begin
      Result  := -1;
      ImgConv := LoadLibrary(IMG_DLL);
    
      try
        if (ImgConv <> 0) then
          begin
            WSQToRawBuf := GetProcAddress(ImgConv, 'NBioAPI_ImgConvWSQToRawBuf');
    
            OutBufferPtr := PByte(@OutBuffer);
            if @WSQToRawBuf <> nil then
              begin
                Result := WSQToRawBuf(WsqBuffer, OutBufferPtr, Size, Width, Height);
    
                RawBuffer := VarArrayCreate([0,RAW_ARRAY], varVariant);
                for Ix := 0 to RAW_ARRAY do
                  RawBuffer[Ix] := OutBuffer[Ix];
              end;
          end;
      finally
        FreeLibrary(ImgConv);
      end;
    end;
    Minha dúvida é aqui:
    RawBuffer := VarArrayCreate([0,RAW_ARRAY], varVariant);
                for Ix := 0 to RAW_ARRAY do
                  RawBuffer[Ix] := OutBuffer[Ix];

    * Assim ele não pega os valores

    Como eu posso passar um array de byte para um olevariant?

    Obrigado Jhonas mais uma vez! ;)

  11. Peguei aqui os manuais mas este por exemplo explica como iniciar, e utilizar o enroll e o verify.

    No meu caso só quero utilizar as funções que utilizam as imagems. Mas minha dúvida é básica, só quero saber como as chamo ^^

    Já instalei tudo mas não sei como posso utilizar estas funções, dou uses na unit mas não possui estas funções das imagens. Esta que é a dúvida.

    Obrigado Jhonas.

  12. Ainda não entendi direito como utilizar as funções de ImgConverter.

    Já instalei tudo e agora quero utilizar a função "NBioAPI_ImgConvWSQToRawBuf", ela fica dentro da .dll? Percebi que já possuo no system32, pensei que fosse algo da própria nitgen *perdido* hahaha

    Como utilizo qualquer uma das funções de imgconverter deles?

    Obrigado mais uma vez Jhonas, ta salvando minha vida!

  13. Isso que está me impossibilitando de comprar na verdade.

    No site deles avisam:

    Web application

    If you have a web application developed using Griaule's SDK libraries, the right

    license for you is the Integrator. You must estimate the maximum number of computer

    will access your application and purchase a license according to this number.

    Mandei também um e-mail e me responderam o seguinte:

    Será necessario você ter um licença em cada computador que irá utilizar nosso sistema pois a licença fica atrelada ao hardware.

    Responderam quando eu perguntei se era necessário uma licença válida para cada usuário também.

    Mas aí acaba ficando inviável de comprar, já que eu iria usar o componente em um webservice.

    Obrigado Jhonas.

×
×
  • Criar Novo...