close
System.IO.Stream fs1 = new System.IO.FileStream(this.openFileDialog1.FileName,
System.IO.FileMode.Open, System.IO.FileAccess.Read);
//準備緩衝區 Byte陣列
Byte[] buff = new Byte[fs1.Length];
//開始讀取 讀到緩衝區去
fs1.Read(buff, 0, (Int32)fs1.Length);
//建立Gap(記憶體串流)
System.IO.MemoryStream ms = new System.IO.MemoryStream();
ms.Write(buff, 0, (Int32)fs1.Length);
//建構Image物件
System.Drawing.Image img = new System.Drawing.Bitmap(ms);
全站熱搜
留言列表