Code example for Bitmap.CompressFormat

Methods: name

0
  /** 
   * @see Bitmap#compress(CompressFormat, int, OutputStream) 
   */ 
  public void setCompressFormat(final CompressFormat compressFormat) {
    this.compressFormat = compressFormat;
    setContentType("image/" + compressFormat.name().toLowerCase(Locale.US));
  } 
  /** 
   * @see Bitmap#compress(CompressFormat, int, OutputStream) 
   */ 
  public void setCompressQuality(final int compressQuality) {
    this.compressQuality = compressQuality;
  } 
 
  @Override 
  protected void sendData(final OutputStream out) throws IOException {
    if (compressFormat == null) { throw new IllegalStateException("Compress format is not set"); }
    bitmap.compress(compressFormat, compressQuality, out);
  } 
 
  /**