Class IOSPicturesService

  • All Implemented Interfaces:
    PicturesService

    public class IOSPicturesService
    extends java.lang.Object
    implements PicturesService
    Note:Since iOS 10 requires NSCameraUsageDescription, NSPhotoLibraryUsageDescription and NSPhotoLibraryAddUsageDescription in pList.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void asyncLoadImageFromGallery()
      Retrieve an image from the device's gallery of images.
      void asyncTakePhoto​(boolean savePhoto)
      Use the device's camera to take a photo, and retrieve an Image.
      java.util.Optional<java.io.File> getImageFile()
      Retrieve the file associated to the original picture generated by takePhoto(true) or the file related to the picture selected with PicturesService.loadImageFromGallery().
      javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.image.Image> imageProperty()
      A read-only property containing the image taken from the camera or gallery or null if it failed, or it was cancelled.
      java.util.Optional<javafx.scene.image.Image> loadImageFromGallery()
      Retrieve an image from the device's gallery of images, in a blocking way.
      static void selectPicture()  
      static void setResult​(java.lang.String v, java.lang.String filePath)  
      java.util.Optional<javafx.scene.image.Image> takePhoto​(boolean savePhoto)
      Use the device's camera to take a photo, in a blocking way, and retrieve an Image.
      static void takePicture​(boolean savePhoto)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IOSPicturesService

        public IOSPicturesService()
    • Method Detail

      • takePhoto

        public java.util.Optional<javafx.scene.image.Image> takePhoto​(boolean savePhoto)
        Description copied from interface: PicturesService
        Use the device's camera to take a photo, in a blocking way, and retrieve an Image. It can be saved as well in the device's public album.
        Specified by:
        takePhoto in interface PicturesService
        Parameters:
        savePhoto - if true, image is saved to public album
        Returns:
        an Optional with the Image or empty if it failed, or it was cancelled
      • asyncTakePhoto

        public void asyncTakePhoto​(boolean savePhoto)
        Description copied from interface: PicturesService
        Use the device's camera to take a photo, and retrieve an Image. It can be saved as well in the device's public album.
        Specified by:
        asyncTakePhoto in interface PicturesService
        Parameters:
        savePhoto - if true, image is saved to public album
      • loadImageFromGallery

        public java.util.Optional<javafx.scene.image.Image> loadImageFromGallery()
        Description copied from interface: PicturesService
        Retrieve an image from the device's gallery of images, in a blocking way.
        Specified by:
        loadImageFromGallery in interface PicturesService
        Returns:
        an Optional with the Image or empty if it failed, or it was cancelled
      • imageProperty

        public javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.image.Image> imageProperty()
        Description copied from interface: PicturesService
        A read-only property containing the image taken from the camera or gallery or null if it failed, or it was cancelled.
        Specified by:
        imageProperty in interface PicturesService
        Returns:
        a read-only object property containing an image that can be null
      • takePicture

        public static void takePicture​(boolean savePhoto)
      • selectPicture

        public static void selectPicture()
      • setResult

        public static void setResult​(java.lang.String v,
                                     java.lang.String filePath)