ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Reading barcodes ...
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

mauriciopt

Portugal
34 Posts

Posted - Nov 04 2019 :  07:56:55  Show Profile  Reply
Hi,

i have a function for reading barcodes on pages.
Below the code of reading part.
The strange is i need to read the barcode twice (AGSBarcode := ) with 2 different methods in order to avoid an error when exiting my function.
Using only first or second method will raise the error at the end of the function.

Can you explain me?
I'm using imgeen v8.0.1 and associated IEVision version.



var 
  IEVisionImage: TIEVisionImage;
  IEVISION_symbol: TIEVisionBase; // 2019-11-04 ... TIEVisionBarCodeSymbol;
  IEVisionWString: TIEVisionWString;
  IEVISION_selRect: TIEVisionRect;
  IEVISION_m_symbols: TIEVisionVectorObjRef;


          IEVisionImage := tmpIEBmp.GetIEVisionImage; 
          IEVISION_selRect := IEVisionRect(0, 0, tmpIEBmp.Width, tmpIEBmp.Height);
          IEVISION_m_symbols := IEVisionLib.createBarCodeScanner().scan(IEVisionImage, IEVISION_selRect);

          for n := 0 to IEVISION_m_symbols.size - 1 do
          begin
// FIRST METHOD 
            IEVISION_symbol := IEVISION_m_symbols.getObj(n);
            IEVisionWString := TIEVisionBarCodeSymbol(IEVISION_symbol).getData();
            AGSBarcode := IEVisionWString.c_str;

// SECOND METHOD 
            AGSBarcode := TIEVisionBarCodeSymbol( IEVISION_m_symbols.getObj(n) ).getData.c_str;

            if pos(cNumerisation_SeparPrefix, AGSBarcode) = 1 then
            begin
              if AGSBarcode = cNumerisation_SeparPage1
              then QrCodeNewDocDetecte := true       document
              else PageSeparationDetectee := true;   

              Break;
            end
            else
              AGSBarcode := '';
          end;


Regards,
Mauricio

Mauricio
http://sourceforge.net/projects/tcycomponents/

mauriciopt

Portugal
34 Posts

Posted - Nov 04 2019 :  08:04:06  Show Profile  Reply
Note that i have the problem in different images for 2 years ...

Mauricio
http://sourceforge.net/projects/tcycomponents/
Go to Top of Page

xequte

38203 Posts

Posted - Nov 04 2019 :  15:52:38  Show Profile  Reply
Hi Mauricio

Does it only happen with specific images? Can you send us some samples. What version of Delphi are you using?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

mauriciopt

Portugal
34 Posts

Posted - Nov 05 2019 :  12:03:37  Show Profile  Reply
I' m using DELPHI TOKYO and it appens in any tif file with BAR CODE.

Mauricio
http://sourceforge.net/projects/tcycomponents/
Go to Top of Page

xequte

38203 Posts

Posted - Nov 05 2019 :  22:11:29  Show Profile  Reply
Hi

I tested it as follows:

procedure TMainForm.Button1Click(Sender: TObject);
var
  IEVisionImage: TIEVisionImage;
  IEVISION_symbol: TIEVisionBase;
  IEVisionWString: TIEVisionWString;
  IEVISION_selRect: TIEVisionRect;
  IEVISION_m_symbols: TIEVisionVectorObjRef;
  n: integer;
  AGSBarcode: string;
begin
  IEVisionImage := ImageEnView1.IEBitmap.GetIEVisionImage;
  IEVISION_selRect := IEVisionRect(0, 0, ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height);
  IEVISION_m_symbols := IEVisionLib.createBarCodeScanner().scan(IEVisionImage, IEVISION_selRect);

  Caption := '';

  for n := 0 to IEVISION_m_symbols.size - 1 do
  begin
    // FIRST METHOD
    IEVISION_symbol := IEVISION_m_symbols.getObj(n);
    IEVisionWString := TIEVisionBarCodeSymbol(IEVISION_symbol).getData();
    AGSBarcode := IEVisionWString.c_str;

    // SECOND METHOD
    // AGSBarcode := TIEVisionBarCodeSymbol( IEVISION_m_symbols.getObj(n) ).getData.c_str;

    Caption := Caption + AGSBarcode + ', '
  end;
end;


I tried commenting out both the first and/or second methods. I did not get any errors.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

mauriciopt

Portugal
34 Posts

Posted - Nov 07 2019 :  16:47:09  Show Profile  Reply
Maybe because i have a previous dll version i think.


Mauricio
http://sourceforge.net/projects/tcycomponents/
Go to Top of Page

xequte

38203 Posts

Posted - Nov 08 2019 :  20:58:00  Show Profile  Reply
Hi Mauricio

Please email me to clarify your upgrade status.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

mauriciopt

Portugal
34 Posts

Posted - Nov 11 2019 :  14:18:27  Show Profile  Reply
Done (sent request download e-mail).
Thanks

Mauricio
http://sourceforge.net/projects/tcycomponents/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: