日期:2014-05-17 浏览次数:20446 次
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 HybridBinarizer(source));
        Result result;
        try
        {
            result = new MultiFormatReader().decode(bitmapdc);
        }
        catch (ReaderException re)
        {
            return;
        }
        Response.Write(result);
------解决方案--------------------
你获取TIF就知道点阵信息.如果你的发送传真位置基本固定.如果位置不固定.你可以考虑使用楼上贴的QR码 这个有定位符..这3个大防快不难找把. 然后按巨型获取出来信息 3个大方块的位置确定了 获取个矩形也不难把.然后给你的DLL识别就好了.