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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 IEVisionImage AccessViolation

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
skafy Posted - Oct 28 2022 : 03:55:57
Hi,

Im evaluating ImageEn And ImageEn version 10.3.5
I'm having an issue with barcode reader

I get AccessViolation everytime I call GetIEVisionImage(). What am I doing wrong?


unit Unit2;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, hyiedefs, hyieutils, iexBitmaps,
  iesettings, iemio, Vcl.StdCtrls, ieview, iemview, ievision;

type
  TForm2 = class(TForm)
    ImageEnMView1: TImageEnMView;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure ImageEnMView1Changed(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
begin
  ImageEnMView1.FillFromDirectory('C:\Users\lala\Downloads\scan\', -1, False, '', False, '', True);
end;

procedure TForm2.ImageEnMView1Changed(Sender: TObject);
begin
  var m_symbols:= IEVisionLib.createBarCodeScanner().scan(ImageEnMView1.IEBitmap.GetIEVisionImage(), IEVisionRect(0, 0, 0, 0));
end;

end.

1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 30 2022 : 19:21:59
Hi

I cannot reproduce that, but if you are using the OnChanged event, there will be situations where ImageEnMView1.IEBitmap is nil.

Try changing your code to:

  if ImageEnMView1.IEBitmap = nil then
    raise Exception.create( 'Image not selected' );
  var m_symbols:= IEVisionLib.createBarCodeScanner().scan(ImageEnMView1.IEBitmap.GetIEVisionImage(), IEVisionRect(0, 0, 0, 0));


Nigel
Xequte Software
www.imageen.com