Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we generate QR code through Xamarin

I am developing an Android app in xamarin in which I require to create a QR code from the data input by the user in various fields.

SO my question is can I do it with the help of Xamarin? If yes then please help me with any sample code or tutorial link.

like image 632
Gaurav Arora Avatar asked Dec 20 '22 23:12

Gaurav Arora


1 Answers

ZXing.Net has a QR code generator built in. Take a look at that.

Something like this could do the job (following code not tested):

var writer = new BarcodeWriter
{
    Format = BarcodeFormat.QR_CODE,
    Options = new EncodingOptions
                {
                    Height = 200,
                    Width = 600
                }
};
var bitmap = writer.Write("My content");

This should generate an image with the QR code. There are loads of other options you can mess with.

ZXing is also available as a component for Xamarin.Android, Xamarin.iOS and Windows Phone

like image 73
Cheesebaron Avatar answered Dec 27 '22 11:12

Cheesebaron