procedure ByteArray2Bitmap(const aBMP: TBitmap;const ByteArray: Array of Byte);
var MS: TMemoryStream;
begin
MS := TMemoryStream.Create;
try
MS.WriteBuffer(ByteArray[0], Length(ByteArray));
MS.Seek(0, soFromBeginning);
aBMP.LoadFromStream(MS);
finally
MS.free;
end;
end;
// Utilisation
procedure TForm1.Button2Click(Sender: TObject);
begin
ByteArray2Bitmap(Image2.Picture.Bitmap, aBArray);
end;