Jump to content
Sign in to follow this  
stacker_liew

ZXing Delphi not function in 10.3.2

Recommended Posts

Hi, 

I tested the demo at

https://github.com/Spelt/ZXing.Delphi/blob/v_3.0/demo/advancedTestApp/main.pas

 

To make it work, I had to apply the following changes

 

// 1) Moved this code from FormCreate to FormActivate
{$IFDEF ANDROID}
	FPermissionCamera := JStringToString(TJManifest_permission.JavaClass.CAMERA);
{$ENDIF}
	PermissionsService.RequestPermissions([FPermissionCamera], AccessCameraPermissionRequestResult, DisplayRationale);

// 2) Commented this code in FormCreate, because it is called before the CAMERA permission has been granted. Moved in AccessCameraPermissionRequestResult().
UpdateCaptureSettings(TCameraKind.BackCamera);

// 3) Changed AutoFocus to ContinuousAutoFocus.
CameraComponent1.FocusMode := TFocusMode.ContinuousAutoFocus;

// 4) Modified the SampleBufferReady event:
procedure TForm1.CameraComponent1SampleBufferReady(Sender: TObject; const ATime: TMediaTime);
begin
  // TThread.Synchronize(TThread.CurrentThread, SyncBitmap);
	// ParseBitmap();

  TThread.Queue(nil,
      procedure ()
      begin
        SyncBitmap();
        ParseBitmap();
      end);
end;

 

Also, changed TBarcodeFormat.Auto to TBarcodeFormat.QR_CODE.

 

Edited by f.m

Share this post


Link to post

Hi


There was een update today of the Advanced Scan App.  Its is now simplified and handles permissions to the onActivate event.

 

There were more problems with this demo app. You can check the changes in the last week.

 

Please read the updated section of Note for: 'Advanced  test demo app'.

 

 

 

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×