2013-03-04 113 views
0

我正在使用zXing.net.monotouch.dll用于在单点触摸中创建QRCode的库。我通过使用下面的代码得到了位图。我不知道如何将其转换为图像。在每个人都使用com.google.zxing.common.BitMatrix,但它在我的程序中不受支持。请找到我的解决方案:如何在单点触摸中从位图创建Qrcode图像

ZXing.QrCode.QRCodeWriter ObjQrCodeWriter= new ZXing.QrCode.QRCodeWriter(); 
ZXing.Common.BitMatrix bitMatrix1=ObjQrCodeWriter.encode("this is a string content",ZXing.BarcodeFormat.QR_CODE,60,60); 

回答

0

使用类ZXing.BarcodeWriter。

var writer = new ZXing.BarcodeWriter 
{ 
    Format = BarcodeFormat.QR_CODE, 
    Options = new EncodingOptions { Height = 60, Width = 60 } 
}; 
var image = writer.Write("this is a string content");