Best code examples for Bitmap compress method (android.graphics.Bitmap.compress)

These code examples were ranked by Codota’s semantic indexing as the best open source examples forBitmap compress method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Bitmap compress examples from Open Source projects
This code example shows how to use the following methods: compress
62:	b.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compress
56:	boolean didCompress = data.compress(compressFormat, quality, out); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, createBitmap, getHeight, getWidth
46:	int width = bitmap.getWidth(); 
-
52:	int height = (int)((float)bitmap.getHeight() * ratio); 
53:	bitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height); 
-
57:	bitmap.compress(format, 100, stream); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compress, recycle
251:	if (image.compress(CompressFormat.JPEG, (int)(compressionQuality * 100), bos)) { 
-
265:	image.recycle(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compress
72:	b.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, getHeight, getWidth
125:	final int size = photo.getWidth() * photo.getHeight() * 4; 
-
129:	photo.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compress
34:	image.compress(Bitmap.CompressFormat.PNG, 90, fos); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress
57:	val.compress(CompressFormat.PNG, 0, baos); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, getHeight, getWidth
249:	final boolean compressed = b.compress(Bitmap.CompressFormat.JPEG, quality, baos); 
-
288:	(mDisplayPhoto.getWidth() > mThumbnailPhoto.getWidth() || 
289:	mDisplayPhoto.getHeight() > mThumbnailPhoto.getHeight()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, getHeight, getWidth
146:	info.setHeight(bmp.getHeight()); 
147:	info.setWidth(bmp.getWidth()); 
-
164:	if (bitmap.compress(format, quality, bos)) 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, getHeight, getWidth
128:	int size = bitmap.getWidth() * bitmap.getHeight() * 4; 
-
130:	bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compress
110:	bitmap.compress(CompressFormat.PNG, 100, ostream); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, recycle
188:	bitmap.compress(Bitmap.CompressFormat.JPEG, 75, byteArray); 
189:	bitmap.recycle(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, getHeight, getWidth
107:	final int size = bitmap.getWidth() * bitmap.getHeight() * 4; 
-
110:	bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compress, isRecycled, recycle
55:	if (bitmap != null && !bitmap.isRecycled()) { 
-
59:	bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos); 
-
67:	bitmap.recycle(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compress, createBitmap, getHeight, getWidth
174:	bitmap.compress(CompressFormat.JPEG, 85, new FileOutputStream(thumbNail)); 
-
188:	return Bitmap.createBitmap(image, 0, 0, 
189:	image.getWidth(), image.getHeight(), 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compress
59:	b.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress
71:	bitmap.compress(CompressFormat.JPEG, quality, stream); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress
42:	bitmap.compress(Bitmap.CompressFormat.PNG, 90, fOut); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, getHeight, getWidth
143:	int size = bitmap.getWidth() * bitmap.getHeight() * 4; 
-
146:	bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compress, insertImage
56:	b.compress(Bitmap.CompressFormat.PNG, 80, fos); 
-
59:	MediaStore.Images.Media.insertImage(cr, b, "Screen", "screen"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress
62:	b.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, close, toByteArray
14:	ByteArrayOutputStream stream = new ByteArrayOutputStream(); 
15:	bm.getBitmap().compress(Bitmap.CompressFormat.JPEG, 100, stream); 
16:	byte[] byteArray = stream.toByteArray(); 
17:	stream.close(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress
453:	image.compress(Bitmap.CompressFormat.PNG, 100, outStream); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, getHeight, getWidth, hasAlpha
139:	if (image.hasAlpha()) { 
140:	if (image.compress(CompressFormat.PNG, 100, bos)) { 
-
145:	if (image.compress(CompressFormat.JPEG, 100, bos)) { 
-
152:	blob.width = image.getWidth(); 
153:	blob.height = image.getHeight(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, getHeight, getWidth
121:	int size = bitmap.getWidth() * bitmap.getHeight() * 4; 
-
123:	bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, close
196:	FileOutputStream fileOutputStream = new FileOutputStream(imageFile); 
-
198:	outputSize, false).compress(CompressFormat.JPEG, 100, 
-
200:	fileOutputStream.close(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, getHeight, getWidth
118:	int size = bitmap.getWidth() * bitmap.getHeight() * 4; 
-
121:	bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress
261:	if (!bmp.compress(CompressFormat.PNG, 100, fout)) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, getHeight, getWidth
88:	int size = bitmap.getWidth() * bitmap.getHeight() * 2; 
-
91:	bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, recycle
424:	rotated.compress(getCompressFormat(dest), 100, fileOutputStream); 
-
443:	rotated.recycle(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: compress, toByteArray
31:	ByteArrayOutputStream baops = new ByteArrayOutputStream(); 
32:	bitmap.getBitmap().compress(CompressFormat.PNG, 100, baops); 
-
34:	return baops.toByteArray(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: compress, getHeight, getWidth
182:	int size = bitmap.getWidth() * bitmap.getHeight() * 4; 
-
185:	bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: toString
41:	public static final String         IMAGE_PNG_EXTENSION = IMAGE_PNG_FORMAT.toString().toLowerCase(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: name
43:	setContentType("image/" + compressFormat.name().toLowerCase(Locale.US)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: name
53:	+ compressedImageFormat.name(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: toString
42:	photoType = CompressFormat.JPEG.toString().toLowerCase(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: name
53:	+ compressedImageFormat.name(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: name
196:	+ compressedImageFormat.name(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: name
91:	return Integer.toHexString(imageUrl.hashCode()) + "." + compressedImageFormat.name(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: name
51:	intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.name()); 
Full Snippet Info
4
CodeRank
Related Bitmap compress Questions & Answers:
compress Method Overview
Write a compressed version of the bitmap to the specified outputstream.
See Also
  • copy
    Tries to make a new bitmap based on the dimensions of this bitmap, setting the new bitmap's config to the one specified, and then copying this bitmap's pixels into the new bitmap.
  • copyPixelsFromBuffer
    Copy the pixels from the buffer, beginning at the current position, overwriting the bitmap's pixels.
  • copyPixelsToBuffer
    Copy the bitmap's pixels into the specified buffer (allocated by the caller).
  • createBitmap
    Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array.
  • eraseColor
    Fills the bitmap's pixels with the specified Color.
  • extractAlpha
    Returns a new bitmap that captures the alpha values of the original.
  • getByteCount
    Returns the minimum number of bytes that can be used to store this bitmap's pixels.
  • getConfig
    If the bitmap's internal config is in one of the public formats, return that config, otherwise return null.
  • getPixels
    Returns in pixels[] a copy of the data in the bitmap.
  • getRowBytes
    Return the number of bytes between rows in the bitmap's pixels.
  • hasAlpha
    Returns true if the bitmap's config supports per-pixel alpha, and if the pixels may contain non-opaque alpha values.
  • isMutable
    Returns true if the bitmap is marked as mutable (i.e. can be drawn into)
  • isRecycled
    Returns true if this bitmap has been recycled.
  • recycle
    Free the native object associated with this bitmap, and clear the reference to the pixel data.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值