withBuffer static method

ArcGISImage? withBuffer(
  1. Uint8List data
)

Creates a new image object from a buffer.

Will open PNG and JPEG images.

Parameters:

  • data — The bytes to the image.

Implementation

static ArcGISImage? withBuffer(Uint8List data) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreData = data.toByteArrayWrapper();
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_Image_createWithBuffer(coreData.ref, errorHandler);
  });
  if (handle == ffi.nullptr) return null;
  return ArcGISImage._withHandle(handle);
}