I am making a website with Blazor Server Side. I have successfully generated a QR code that will display the details of the user in text. I was wondering if it is possible to have the QR code display this text and also an image of the user. The image will have been previously uploaded to the project directory. I have searched online but can't seem to find anything to let me know if this is even possible. If it is possible how would this be added to this code, I am using the QRCoder extension:
string QRCodeStr { get; set; } = "";
public void GenerateQRCode()
{
QRCodeStr = "";
using (MemoryStream ms = new MemoryStream())
{
QRCodeGenerator oQRCodeGenerator = new QRCodeGenerator();
QRCodeData oQRCodeData = oQRCodeGenerator.CreateQrCode("Guest: " + guest.FirstName + " " + guest.LastName
+ "\nDOB: " + guest.DOB.ToShortDateString()
+ "\nArrival: " + guest.ArrivalDate.ToShortDateString()
+ "\nDepart: " + guest.DepartureDate.ToShortDateString()
+ "\nStudent: " + guest.StudentFirstName + " " + guest.StudentLastName
+ "\nRoom: " + guest.BlockName + ", " + guest.Room
+ "\nStatus: " + Status
,QRCodeGenerator.ECCLevel.Q);
QRCode oQRCode = new QRCode(oQRCodeData);
using (Bitmap oBitMap = oQRCode.GetGraphic(20))
{
oBitMap.Save(ms, ImageFormat.Png);
QRCodeStr = "data:image/png;base64," + Convert.ToBase64String(ms.ToArray());
}
}
}