日期:2014-05-17  浏览次数:20736 次

字符串如何转成图片?
C# code
   
 public static byte[] BitmapToByte(Bitmap A_0)
    {
        if (A_0 == null)
        {
            return null;
        }
        BitmapData bitmapdata = A_0.LockBits(new Rectangle(new System.Drawing.Point(), A_0.Size), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
        int length = bitmapdata.Stride * A_0.Height;
        byte[] destination = new byte[length];
        Marshal.Copy(bitmapdata.Scan0, destination, 0, length);
        A_0.UnlockBits(bitmapdata);
        return destination;
    }

    public static string ByteToStr(byte[] A_0)
    {
        if (A_0 == null)
        {
            return "";
        }
        string str = "";
        if (A_0 != null)
        {
            for (int i = 0; i < A_0.Length; i++)
            {
                str = str + A_0[i].ToString("X2");
            }
        }
        return str;
    }


图片转化成字符串,是上面这样,但如何从得到的字符串转化回去呢??

------解决方案--------------------
http://hi.baidu.com/caodeliliang/item/a6cef910ac5b77081994ec8e