1

I have an external camera that sends raw RGB data in the form of 8bpp. To get started on this project, I wanted to create an Image.memory widget that displays an array of hex values that I have in a list/array. The problem the code I have made, is that no matter what I put inside the list, nothing will appear.

This code is inside a class, and the 0xFF is just a temporary byte so I can hopeful see something on the screen to signify that it is working. Anything else I put in the column appears on screen FYI.

  Uint8List byteList = new Uint8List.fromList([
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  ]);

  @override
  Widget build(BuildContext context) {
    return Material(
      color: Color(0xFF005566),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Image.memory(
            byteList,
            scale: 1.0,
            width: 10.0,
            height: 10.0,
            repeat: ImageRepeat.noRepeat,
          ),
        ],
      ),
    );
  }
Daniel
  • 368
  • 1
  • 4
  • 6
  • 8bpp RGB sounds odd - do you have 4 bits for green and 2 bits each for red and blue, or some other arrangement? Which camera produces this please? – Mark Setchell Jul 09 '18 at 20:20
  • For the entire project actually, I am trying to create a that wirelessly streams its feed to the phone screen. The camera I am using is the OV7670 Arduino camera. 8pp is typically 3R 3G 2B. – Daniel Jul 10 '18 at 03:10
  • See https://stackoverflow.com/questions/51315442/use-ui-decodeimagefromlist-to-display-an-image-created-from-a-list-of-bytes/51316489 – Richard Heap Jul 18 '18 at 01:47

0 Answers0