Bitmapとbyte[]の変換
いざ書くといつも忘れてしまうので。
画像ファイル(Bitmap)からbyte[]に変換
Bitmap bmp = new Bitmap(画像のPATH); //using System.Drawing MemoryStream ms = new MemoryStream(); bmp.Save(ms,ImageFormat.Png); //using System.Drawing.Imaging;
byte[]から画像ファイル(Bitmap)に変換
MemoryStream ms = new MemoryStream(byte[]のデータ); Bitmap bmp = new Bitmap(ms); ms.Close(); bmp.Save(画像のPATH);
byte[]って何者かいまだによく知らない。