试图获取纯黄色图像的第一个像素。但是,我为RGB获取的值是错误的。
var image = NetworkImage("https://www.lockwoodmathewsmansion.com/wp-content/uploads/2017/05/yellow-square.jpg");
image.obtainKey(ImageConfiguration()).then((val) {
var load = image.load(val);
load.addListener((listener, err) {
listener.image.toByteData().then((byteData) {
var e = byteData.getUint32(500);
debugPrint(((e >> 16) & 0xFF).toString()); // red
debugPrint(((e >> 8) & 0xFF).toString()); // green
debugPrint(((e) & 0xFF).toString()); // blue
});
});
});