Bitmap.Compress(Bitmap+CompressFormat, Int32, Stream) Method

Definition

Write a compressed version of the bitmap to the specified outputstream.

[Android.Runtime.Register("compress", "(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z", "")]
public bool Compress (Android.Graphics.Bitmap.CompressFormat format, int quality, System.IO.Stream stream);
member this.Compress : Android.Graphics.Bitmap.CompressFormat * int * System.IO.Stream -> bool

Parameters

format
Bitmap.CompressFormat

The format of the compressed image

quality
Int32

Hint to the compressor, 0-100. 0 meaning compress for small size, 100 meaning compress for max quality. Some formats, like PNG which is lossless, will ignore the quality setting

stream
Stream

The outputstream to write the compressed data.

Returns

Boolean
Attributes

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to