How to convert List<int> got from an image into to image again?

sachin
edited November 2021 in Flutter

I have a List that represents a list of 8-bit bytes that I have got from image and want to buffer it as image again

Tagged:

Answers

  • sachin
    edited November 2021

    If you already have the image data and want to show it,
    you can create a MemoryImage (or use Image.memory if you need an Image widget).

  • sachin
    edited November 2021

    If you have a List that represents a list of 8-bit bytes and want to write it to a file,
    you can simply use File.writeAsBytes. (It's the inverse of File.readAsBytes, which you're already using.)

    await File(desiredDestinationPath).writeAsBytes(bytes);
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!