I am working on an android project in which I want to take the screen shot of current activity and save that as .jpeg file in my android device.
When I use instance of FileOutputStream to write the stream of bitmap image into a file, it gives me following error
Argument 3 cannot converted from 'Java.IO.FileOutputStream' to 'System.IO.Stream'
My code
private void ShareButton_Click(object sender, EventArgs e)
{
//create a bitmap screen capture
View screen = FindViewById(Resource.Layout.AboutImage);
Bitmap bitmap = Bitmap.CreateBitmap(screen.GetDrawingCache(false));
screen.SetWillNotCacheDrawing(true);
image = new File(directory, "Eco_Friendly " + mc.identifier);
FileOutputStream outputstream = new FileOutputStream(image);
int quality = 100;
bitmap.Compress(Bitmap.CompressFormat.Jpeg, quality, outputstream);//Here is error
}
Q:How to solve this problem?