Lines Matching refs:bitmap

58  * A Drawable that wraps a bitmap and can be tiled, stretched, or aligned. You can create a
61 * <p>It can be defined in an XML file with the <code>&lt;bitmap></code> element. For more
66 * transformation of raw bitmap graphics, and should be used when drawing to a
112 * instead to specify a bitmap to draw with and ensure the correct density is set.
124 * instead to specify a bitmap to draw with.
133 * Create drawable from a bitmap, not dealing with density.
138 public BitmapDrawable(Bitmap bitmap) {
139 init(new BitmapState(bitmap), null);
143 * Create drawable from a bitmap, setting initial target density based on
146 public BitmapDrawable(Resources res, Bitmap bitmap) {
147 init(new BitmapState(bitmap), res);
151 * Create a drawable by opening a given file path and decoding the bitmap.
161 * Create a drawable by opening a given file path and decoding the bitmap.
165 Bitmap bitmap = null;
167 bitmap = ImageDecoder.decodeBitmap(ImageDecoder.createSource(res, stream),
176 init(new BitmapState(bitmap), res);
184 * Create a drawable by decoding a bitmap from the given input stream.
194 * Create a drawable by decoding a bitmap from the given input stream.
198 Bitmap bitmap = null;
200 bitmap = ImageDecoder.decodeBitmap(ImageDecoder.createSource(res, is),
209 init(new BitmapState(bitmap), res);
224 * Returns the bitmap used by this drawable to render. May be null.
231 final Bitmap bitmap = mBitmapState.mBitmap;
232 if (bitmap != null) {
233 mBitmapWidth = bitmap.getScaledWidth(mTargetDensity);
234 mBitmapHeight = bitmap.getScaledHeight(mTargetDensity);
241 public void setBitmap(Bitmap bitmap) {
242 if (mBitmapState.mBitmap != bitmap) {
243 mBitmapState.mBitmap = bitmap;
293 /** Get the gravity used to position/stretch the bitmap within its bounds.
295 * @return the gravity applied to the bitmap
301 /** Set the gravity used to position/stretch the bitmap within its bounds.
314 * Enables or disables the mipmap hint for this drawable's bitmap.
317 * If the bitmap is null calling this method has no effect.
319 * @param mipMap True if the bitmap should use mipmaps, false otherwise.
331 * Indicates whether the mipmap hint is enabled on this drawable's bitmap.
333 * @return True if the mipmap hint is set, false otherwise. If the bitmap
345 * the edges of the bitmap only so it applies only when the drawable is rotated.
347 * @param aa True if the bitmap should be anti-aliased, false otherwise.
387 * @return {@link android.graphics.Shader.TileMode#CLAMP} if the bitmap does not repeat,
398 * @return {@link android.graphics.Shader.TileMode#CLAMP} if the bitmap does not repeat,
408 * does not repeat its bitmap. Using {@link android.graphics.Shader.TileMode#REPEAT} or
409 * {@link android.graphics.Shader.TileMode#MIRROR} the bitmap can be repeated (or tiled)
410 * if the bitmap is smaller than this drawable.
424 * does not repeat its bitmap. Using {@link android.graphics.Shader.TileMode#REPEAT} or
425 * {@link android.graphics.Shader.TileMode#MIRROR} the bitmap can be repeated (or tiled)
426 * if the bitmap is smaller than this drawable.
440 * does not repeat its bitmap. Using {@link android.graphics.Shader.TileMode#REPEAT} or
441 * {@link android.graphics.Shader.TileMode#MIRROR} the bitmap can be repeated (or tiled)
442 * if the bitmap is smaller than this drawable.
487 final Bitmap bitmap = mBitmapState.mBitmap;
489 if (bitmap != null && shader != null) {
490 updateShaderMatrix(bitmap, mBitmapState.mPaint, shader, needMirroring());
496 final Bitmap bitmap = mBitmapState.mBitmap;
497 if (bitmap == null) {
509 paint.setShader(new BitmapShader(bitmap,
540 // Mirror the bitmap
545 canvas.drawBitmap(bitmap, null, mDstRect, paint);
551 updateShaderMatrix(bitmap, paint, shader, needMirroring);
568 * @param bitmap the bitmap to be drawn
569 * @param paint the paint used to draw the bitmap
571 * @param needMirroring whether the bitmap should be mirrored
573 private void updateShaderMatrix(@NonNull Bitmap bitmap, @NonNull Paint paint,
575 final int sourceDensity = bitmap.getDensity();
789 ": <bitmap> requires a valid 'src' attribute");
838 Bitmap bitmap = null;
841 bitmap = ImageDecoder.decodeBitmap(source, (decoder, info, src) -> {
848 if (bitmap == null) {
850 ": <bitmap> requires a valid 'src' attribute");
853 state.mBitmap = bitmap;
962 final Bitmap bitmap = mBitmapState.mBitmap;
963 return (bitmap == null || bitmap.hasAlpha() || mBitmapState.mPaint.getAlpha() < 255) ?
986 // The density to use when looking up the bitmap in Resources. A value of 0 means use
990 // The density at which to render the bitmap.
998 BitmapState(Bitmap bitmap) {
999 mBitmap = bitmap;