firebase - 如何使用颤振截取其他应用程序的屏幕截图并上传到云存储
问题描述
请我一直在寻找一种从我的颤振应用程序中截取其他应用程序的方法。例如,如果我需要在不暂停游戏的情况下截取游戏应用程序并将其上传到云存储。颤振有可能吗?我所做的所有研究都显示了如何使用RepaintBoundary但我不想截取小部件的屏幕截图。任何帮助将不胜感激。
FirebaseStorage storageReference = FirebaseStorage.instance;
bool loading = false;
final firestoreInstance = Firestore.instance;
void convertWidgetToImage() async {
RenderRepaintBoundary renderRepaintBoundary =
_containerKey.currentContext.findRenderObject();
ui.Image boxImage = await renderRepaintBoundary.toImage(pixelRatio: 1);
ByteData byteData =
await boxImage.toByteData(format: ui.ImageByteFormat.png);
Uint8List uInt8List = byteData.buffer.asUint8List();
this.setState(() {
loading = true;
});
StorageUploadTask storageUploadTask = storageReference
.ref()
.child("${DateTime.now()}.png")
.putData(uInt8List);
await storageUploadTask;
this.setState(() {
loading = false;
});
}
解决方案
推荐阅读
- primefaces - JSF / primefaces 处理ajax请求中的控制字符(换页十六进制:0x0c)?
- spring - JedisConnectionFactory 的方法已被弃用。在 Spring Batch 中使用哪些 XML 配置?
- javascript - 这被 babel 解析为 UMD 模块中的未定义
- python - 记录注册用户的操作
- python - 为功能性 keras 模型格式化具有多个类别的多个输入并将其提供给模型
- python-3.x - 使用 python 获取“成本”google adward api
- pyspark - 以相同顺序对具有至少两次相同描述符的案例进行分组
- php - 使用 AJAX / JSON 将值传递给文本框
- c# - 存储过程不返回动态查询行,Dapper
- vba - 小计和复制/粘贴可变范围