This commit is contained in:
Peter Hoppe
2023-01-13 14:28:52 +01:00
parent 920ad6ffdb
commit 29a0bb18b7
2 changed files with 73 additions and 4 deletions

View File

@ -30,6 +30,7 @@ export default function CreateQr({qr_id}:{qr_id: string | undefined})
{
width: 200,
height: 200,
type: 'canvas',
image:
"",
data: 'https://hope-fly.de/dog/'+ qr_id,
@ -39,11 +40,27 @@ export default function CreateQr({qr_id}:{qr_id: string | undefined})
type: "square"
},
imageOptions:
{
crossOrigin: "anonymous",
margin: 0
}
{
crossOrigin: "anonymous",
margin: 0
},
cornersSquareOptions:
{
type: "extra-rounded",
}
});
let canv: any = qrCode._canvas!.getCanvas() as HTMLCanvasElement;
canv.toBlob(({blob}:{blob: Blob | MediaSource}) =>
{
const file = URL.createObjectURL(blob);
console.log(blob);
console.log(file); // this line should be here
},'image/png');
// upload(qrCode._svg as File);
console.log(qrCode);
}