我正在使用 qr_flutter 库生成二维码,但我需要在手机上保存为图像。现在我只有这个:
QrImage(
data: 'This QR code has an embedded image as well',
version: QrVersions.auto,
size: 320,
gapless: false,
embeddedImage: AssetImage('assets/images/logo.png'),
embeddedImageStyle: QrEmbeddedImageStyle(
size: Size(80, 80),
),
Run Code Online (Sandbox Code Playgroud) 我正在做一个项目,我需要用户能够录制屏幕、音频和麦克风。目前我只能让它识别屏幕和音频。
首先,我正在捕获屏幕和其中的音频并将其保存到变量中。然后我捕获该变量以显示视频组件。
invokeGetDisplayMedia(success, error) {
let displaymediastreamconstraints = {
video: {
displaySurface: 'monitor', // monitor, window, application, browser
logicalSurface: true,
cursor: 'always' // never, always, motion
}
};
// above constraints are NOT supported YET
// that's why overridnig them
displaymediastreamconstraints = {
video: true,
audio:true
};
if (navigator.mediaDevices.getDisplayMedia) {
navigator.mediaDevices.getDisplayMedia(displaymediastreamconstraints).then(success).catch(error);
}
else {
navigator.getDisplayMedia(displaymediastreamconstraints).then(success).catch(error);
}
},
captureScreen(callback) {
this.invokeGetDisplayMedia((screen) => {
this.addStreamStopListener(screen, () => {
//
});
callback(screen);
}, function (error) {
console.error(error);
alert('Unable to capture your screen. Please …Run Code Online (Sandbox Code Playgroud)