fromFile static method

ArcGISImage? fromFile(
  1. Uri fileUri
)

Creates a new image object from a file.

Will open PNG and JPEG images.

Parameters:

  • fileUri — The location of the image.

Implementation

static ArcGISImage? fromFile(Uri fileUri) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreFileUri = _CString(fileUri.toFilePath());
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_Image_createFromFile(
        coreFileUri.bytes, errorHandler);
  });
  if (handle == ffi.nullptr) return null;
  return ArcGISImage._withHandle(handle);
}