日期:2014-05-17 浏览次数:20514 次
string content = "tel:汉ooj字";
Hashtable h = new System.Collections.Hashtable();
h.Add("UTF-8", "UTF-8");
ByteMatrix byteMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, 200, 200, h);
Bitmap bitmap = toBitmap(byteMatrix);
MemoryStream ms = new MemoryStream();
bitmap.Save("c:\\1\\a.jpg", ImageFormat.Jpeg);
Image img = Image.FromFile("c:\\1\\a.jpg");
Bitmap bmap;
try
{
bmap = new Bitmap(img);
}
catch (System.IO.IOException ioe)
{
return;
}
if (bmap == null)
{
return;
}
LuminanceSource source = new RGBLuminanceSource(bmap, bmap.Width, bmap.Height);
com.google.zxing.BinaryBitmap bitmapdc = new com.google.zxing.BinaryBitmap(new Hybrid