Solved

We Want to Write a Bitmap Named Bitmap to a FileOutputStream

Question 94

Short Answer

We want to write a Bitmap named bitmap to a FileOutputStream named fos using the compress method of the Bitmap class, which has the following API:
public boolean compress( Bitmap.Compress.Format format, int quality, OutputStream stream )
The quality parameter should be between 0 and 100 (highest quality).
Bitmap.Compress.Format is an enum that includes the constants PNG and JPEG.
Write bitmap as a JPEG of the highest quality to the file represented by fos.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents