Last post Apr 06, 2017 06:52 AM by Zhi Lv - MSFT
Apr 05, 2017 09:14 PM|khawaja Atteeq|LINK
I've got a QR control that is perfectly generating the QR Code and when I scan it with my phone it works perfectly. But I'm not able to convert that to the Image so I can save that to the database. I've looked on their website and I can't find anything,
all they have is with WPF or Web nothing on Winforms.
Here is how I generate QR code
private void btnGenerate_Click(object sender, EventArgs e)
string data = string.Empty;
var fullName = txtFirstName + " " + txtMiddleName + " " + txtLastName;
data = fullName;
data += ", " + Environment.NewLine + txtDistrict.Text;
data += ", " + Environment.NewLine + txtLicenceNumber.Text;
data += ", " + Environment.NewLine + txtRegistrationCode;
ultraQRCodeBarcode1.Data = data;
and This is my save method Where I'm trying to convert that to the Byte code and save
But I'm not successful there is no property as Image in this one.
user.QrCode = ImageToByteArray(ultraQRCodeBarcode1.);
private byte ImageToByteArray(string imagePath)
byte data = null;
var fileInfo = new FileInfo(imagePath);
long numBytes = fileInfo.Length;
var fileStream = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
var binaryReader = new BinaryReader(fileStream);
data = binaryReader.ReadBytes((int)numBytes);
Apr 06, 2017 06:52 AM|Zhi Lv - MSFT|LINK
Hi khawaja Atteeq,
But I'm not able to convert that to the Image so I can save that to the database
I can't find anything, all they have is with WPF or Web nothing on Winforms.
Does your project is a windows form project?
If so, I suggest you to post this question to the forum of infragistics: