Eto.Drawing.Bitmap.ToByteArray C# (CSharp) Method

ToByteArray() public method

Saves the bitmap to an image of the specified imageFormat into a byte array
This is merely a helper to save to a byte array instead of a stream.
public ToByteArray ( ImageFormat imageFormat ) : byte[]
imageFormat ImageFormat
return byte[]
		public byte[] ToByteArray(ImageFormat imageFormat)
		{
			using (var memoryStream = new MemoryStream())
			{
				Save(memoryStream, imageFormat);
				return memoryStream.ToArray();
			}
		}