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,
),
],
),
);
}