public final class CapturedPhoto

  1. Object
  2. CapturedPhoto

Result of a still-photo capture via CameraSession#takePhoto().

Both an in-memory JPEG byte array and a file path are returned; the framework always saves to the app-private storage so that the bytes survive the callback scope.

Constructors

public CapturedPhoto(byte[] jpegBytes, String filePath, int width, int height)Used by platform implementations.

Methods

public byte[] getJpegBytes()JPEG-encoded bytes of the captured photo.
public String getFilePath()FileSystemStorage path the JPEG was saved to.
public int getWidth()Pixel width of the captured photo.
public int getHeight()Pixel height of the captured photo.
public Image toImage() throws IOExceptionConvenience: decode the JPEG bytes into a Codename One Image.

Inherited methods

Constructor details

CapturedPhoto

public CapturedPhoto(byte[] jpegBytes, String filePath, int width, int height)
Used by platform implementations.

Method details

getJpegBytes

public byte[] getJpegBytes()
JPEG-encoded bytes of the captured photo. Hand directly to the com.codename1.ai.* modules without re-reading from disk.

getFilePath

public String getFilePath()
FileSystemStorage path the JPEG was saved to. The file is in the application’s private storage and persists until the app deletes it.

getWidth

public int getWidth()
Pixel width of the captured photo.

getHeight

public int getHeight()
Pixel height of the captured photo.

toImage

public Image toImage() throws IOException
Convenience: decode the JPEG bytes into a Codename One Image.