I am using Mono for Android, I would like to save a bitmap to a byte array So I can save it to a database.
Searching in here I found the following piece of code:
You need to use MemoryStream in MonoDroid instead. Try this:
MemoryStream stream = new MemoryStream(); bitmap.Compress(Bitmap.CompressFormat.Png, 0, stream); byte[] bitmapData = stream.ToArray();
import this package import java.io.ByteArrayOutputStream;