3
我有一個位圖數組,我嘗試將其轉換爲字節數組,其中字節數組的每個索引都表示一個位圖。我在確定如何做到這一點時遇到了一些麻煩。如果有人有建議,請告訴我。謝謝!將位圖數組轉換爲字節數組
private void ConvertBitmapToBytes(Bitmap[] BitmapArray)
{
byte[][] BitmapBytes = new byte[BitmapArray.Length][];
ImageConverter convert = new ImageConverter();
for (int i = 0; i < BitmapArray.Length; i++)
{
BitmapBytes[i] = new byte[BitmapArray.Length];
BitmapBytes[i][i] = convert.ConvertTo(BitmapArray[i], typeof(byte[]));
}
}
我相信這正是我要找的。謝謝! –