Android.Graphics.YuvImage.CompressToJpeg Method
Compress a rectangle region in the YuvImage to a jpeg.

Syntax

[Android.Runtime.Register("compressToJpeg", "(Landroid/graphics/Rect;ILjava/io/OutputStream;)Z", "GetCompressToJpeg_Landroid_graphics_Rect_ILjava_io_OutputStream_Handler")]
public virtual bool CompressToJpeg (Rect rectangle, int quality, System.IO.Stream stream)

Parameters

rectangle
The rectangle region to be compressed. The medthod checks if rectangle is inside the image. Also, the method modifies rectangle if the chroma pixels in it are not matched with the luma pixels in it.
quality
Hint to the compressor, 0-100. 0 meaning compress for small size, 100 meaning compress for max quality.
stream
OutputStream to write the compressed data.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif rectangle is invalid; quality is not within [0, 100]; or stream is null.

Remarks

Compress a rectangle region in the YuvImage to a jpeg. Only ImageFormat.NV21 and ImageFormat.YUY2 are supported for now.

[Android Documentation]

Requirements

Namespace: Android.Graphics
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 8