fromImage static method

Future<BufferImage> fromImage(
  1. Image image
)

load data from an Image

Implementation

static Future<BufferImage> fromImage(Image image) async {
  return BufferImage._(
    (await image.toByteData(format: ImageByteFormat.rawRgba))!
        .buffer
        .asByteData(),
    image.width,
    image.height,
  );
}