亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

C# 圖片與二進(jìn)制轉(zhuǎn)換的簡(jiǎn)單實(shí)例

 更新時(shí)間:2013年09月30日 14:47:44   作者:  
這篇文章介紹了C# 圖片與二進(jìn)制轉(zhuǎn)換的簡(jiǎn)單實(shí)例,有需要的朋友可以參考一下

復(fù)制代碼 代碼如下:

///圖片轉(zhuǎn)二進(jìn)制
private byte[] convertByte(Image img)
{
    MemoryStream ms = new MemoryStream();
    img.Save(ms, img.RawFormat);
    //byte[] bytes = new byte[ms.Length];
    //ms.Read(bytes, 0, Convert.ToInt32(ms.Length));
    //以上兩句改成下面兩句
    byte[] bytes = ms.ToArray();
    ms.Close();
    return bytes;
}

///二進(jìn)制生成圖片
private Image convertImg(byte[] datas)
{
    MemoryStream ms = new MemoryStream(datas);
    Image img = Image.FromStream(ms, true);
    ms.Close();
    return img;
}

相關(guān)文章

最新評(píng)論