Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

Additional Options For ImagePicker

Abdullah Alhazmy edited this page Sep 11, 2016 · 1 revision

Below set of option you can use it with ImagePicker class

  • mode to select the mode, you can choose one of these CAMERA,GALLERY or CAMERA_AND_GALLERY
.mode(ImagePicker.Mode.CAMERA)
  • extension You can change the extension of image to PNG or JPG
.extension(ImagePicker.Extension.PNG)
  • compressLevel You can change the quality of image with three different levels HARD,MEDIUM, SOFT or NONE
.compressLevel(ImagePicker.ComperesLevel.MEDIUM)
  • directory You can pass the storage path, or select Directory.DEFAULT_DIR to keep the default path.
.directory(ImagePicker.Directory.DEFAULT)

//OR

.directory(Environment.getExternalStorageDirectory()+"/myFolder")
  • scale You can scale the image to a a minimum width and height. This will only be used if compressLevel is set. To avoid OutOfMemory issues, ensure this is used.
.scale(500, 500)
  • allowMultipleImages Extra used to select and return multiple images from gallery CANNOT select single image from gallery if this feature was enabled
	.allowMultipleImages(true)
  • enableDebuggingMode used to print Image Picker Log
	.enableDebuggingMode(true)