bdswiss erfahrung

Welcome, Guest
Username: Password: Remember me

TOPIC: How to tell the Onyx Enroll Wizard to save the Preprocessed Fingerprint bitmap to a file

How to tell the Onyx Enroll Wizard to save the Preprocessed Fingerprint bitmap to a file 02 Feb 2015 23:41 #23

  • cwheatley
  • cwheatley's Avatar
  • Offline
  • Administrator
  • Posts: 9
  • Thank you received: 1
  • Karma: 0
It is now possible to create a File and have the Enroll Wizard save the Pre-processed fingerprint bitmap from the enrollment to this file.

First create a member variable to hold the file:
private File mPreprocessedImageFile;

Then, initialize it in your onCreate() or onResume():
mPreprocessedImageFile = new File(getFilesDir(), "preprocessed_image_file.png");

Or if you want to save to an external location:
mPreprocessedImageFile = new File(Environment.getExternalStorageDirectory(), "preprocessed_Image_file.png");

Then in your EnrollWizardBuilder, set the preprocessed file to hold the image:
startActivityForResult(new PreprocessedImageIntentHelper().
	getPreprocessedImageIntentHelper(this, 
		getResources().getString(R.string.onyx_license), 
		mPreprocessedImageFile, CompressFormat.PNG)
	, ENROLL_REQUEST_CODE);

Now, in your onActivityResult(), you can retrieve the preprocessed bitmap from the file:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (REQUEST_CODE == requestCode) {
        Bitmap processedBitmap = null;
    	 try {
	    	FileInputStream fis =  new FileInputStream(mPreprocessedImageFile);
		InputStream buffer = new BufferedInputStream(fis);
		processedBitmap = BitmapFactory.decodeStream(buffer);
		buffer.close();
	} catch (IOException iox) {
		Log.e(TAG, "Cannot perform input of processedBitmap file. " + iox);
	}
    }
}

The processedBitmap will hold the enrolled bitmap image in PNG format.

The following activites will need to be added to your AndroidManifest.xml:
        <activity
            android:name="com.dft.onyx.wizardroid.enrollwizard.SelfEnrollWizardActivity"
            android:screenOrientation="portrait" >
        </activity>
        
        <activity
            android:name="com.dft.onyx.guide.OnyxGuideActivity"
            android:screenOrientation="portrait" >
        </activity>
        
        <activity
            android:name="com.dft.onyx.verify.SelfVerifyActivity"
            android:screenOrientation="portrait"
            android:label="@string/app_name" >
        </activity>

The following permission will also need to be added:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Last Edit: 15 Apr 2015 20:29 by cwheatley. Reason: Removed ObjectOutputStream from processedBitmap.
The administrator has disabled public write access.
Time to create page: 0.099 seconds