/development/samples/browseable/DisplayingBitmaps/src/com.example.android.displayingbitmaps/util/ |
H A D | RecyclingBitmapDrawable.java | 29 * {@link android.graphics.Bitmap#recycle() recycle()} will be called on this drawable's bitmap. 40 public RecyclingBitmapDrawable(Resources res, Bitmap bitmap) { argument 41 super(res, bitmap); 105 Bitmap bitmap = getBitmap(); 106 return bitmap != null && !bitmap.isRecycled();
|
H A D | ImageWorker.java | 37 * This class wraps up completing some arbitrary long running work when loading a bitmap to an 70 * will be created to asynchronously load the bitmap. 105 * Set placeholder bitmap that shows when the the background thread is running. 107 * @param bitmap 109 public void setLoadingImage(Bitmap bitmap) { argument 110 mLoadingBitmap = bitmap; 114 * Set placeholder bitmap that shows when the the background thread is running. 123 * Adds an {@link ImageCache} to this {@link ImageWorker} to handle disk and memory bitmap 136 * Adds an {@link ImageCache} to this {@link ImageWorker} to handle disk and memory bitmap 162 * the final bitmap 369 AsyncDrawable(Resources res, Bitmap bitmap, BitmapWorkerTask bitmapWorkerTask) argument [all...] |
H A D | ImageCache.java | 143 // balancing of memory usage between this set and the bitmap LruCache. It would also 168 // We're running on Honeycomb or later, so add the bitmap 177 * for a bitmap cache 231 * Adds a bitmap to both memory and disk cache. 232 * @param data Unique identifier for the bitmap to store 233 * @param value The bitmap drawable to store 290 * @return The bitmap drawable if found in cache, null otherwise 312 * @return The bitmap if found in cache, null otherwise 317 Bitmap bitmap = null; 337 // Decode bitmap, bu [all...] |
/development/samples/Support7Demos/src/com/example/android/supportv7/graphics/ |
H A D | ImageLoader.java | 42 void onImageLoaded(Bitmap bitmap); argument 71 protected void onPostExecute(Bitmap bitmap) { 72 imageView.setImageBitmap(bitmap); 74 if (bitmap != null) { 76 CACHE.put(id, bitmap); 79 listener.onImageLoaded(bitmap);
|
/development/samples/devbytes/animation/ActivityAnimations/src/com/example/android/activityanim/ |
H A D | BitmapUtils.java | 63 Bitmap bitmap = getBitmap(resources, resourceId); 64 Bitmap thumbnail = getThumbnail(bitmap, 200); 72 * Utility method to get bitmap from cache or, if not there, load it 76 Bitmap bitmap = sBitmapResourceMap.get(resourceId); 77 if (bitmap == null) { 78 bitmap = BitmapFactory.decodeResource(resources, resourceId); 79 sBitmapResourceMap.put(resourceId, bitmap); 81 return bitmap; 85 * Create and return a thumbnail image given the original source bitmap and a max
|
/development/samples/training/ContactsList/src/com/example/android/contactslist/util/ |
H A D | ImageCache.java | 30 * This class holds our bitmap caches (memory and disk). 86 * for a bitmap cache 89 protected int sizeOf(String key, Bitmap bitmap) { 90 final int bitmapSize = getBitmapSize(bitmap) / 1024; 97 * Adds a bitmap to both memory and disk cache. 98 * @param data Unique identifier for the bitmap to store 99 * @param bitmap The bitmap to store 101 public void addBitmapToCache(String data, Bitmap bitmap) { argument 102 if (data == null || bitmap 138 getBitmapSize(Bitmap bitmap) argument [all...] |
H A D | ImageLoader.java | 38 * This class wraps up completing some arbitrary long running work when loading a bitmap to an 67 * created to asynchronously load the bitmap. 78 Bitmap bitmap = null; 81 bitmap = mImageCache.getBitmapFromMemCache(String.valueOf(data)); 84 if (bitmap != null) { 86 imageView.setImageBitmap(bitmap); 97 * Set placeholder bitmap that shows when the the background thread is running. 125 * the final bitmap. This will be executed in a background thread and be long running. For 126 * example, you could resize a large bitmap here, or pull down an image from the network. 130 * @return The processed bitmap 247 onPostExecute(Bitmap bitmap) argument 263 onCancelled(Bitmap bitmap) argument 295 AsyncDrawable(Resources res, Bitmap bitmap, BitmapWorkerTask bitmapWorkerTask) argument 312 setImageBitmap(ImageView imageView, Bitmap bitmap) argument [all...] |
/development/ndk/platforms/android-17/samples/Teapot/src/com/sample/helper/ |
H A D | NDKHelper.java | 77 Bitmap bitmap = null; 89 bitmap = BitmapFactory.decodeStream(new FileInputStream(file)); 92 bitmap = BitmapFactory.decodeStream(context.getResources().getAssets() 100 // bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), 101 // bitmap.getHeight(), matrix, true); 109 if (bitmap != null) 111 GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); 119 Bitmap bitmap [all...] |
/development/ndk/platforms/android-18/samples/MoreTeapots/src/com/sample/helper/ |
H A D | NDKHelper.java | 77 Bitmap bitmap = null; 89 bitmap = BitmapFactory.decodeStream(new FileInputStream(file)); 92 bitmap = BitmapFactory.decodeStream(context.getResources().getAssets() 100 // bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), 101 // bitmap.getHeight(), matrix, true); 109 if (bitmap != null) 111 GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); 119 Bitmap bitmap [all...] |
/development/samples/browseable/RenderScriptIntrinsic/src/com.example.android.renderscriptintrinsic/ |
H A D | ThumbnailRadioButton.java | 60 public void setThumbnail(Bitmap bitmap) { argument 62 BitmapDrawable bmp = new BitmapDrawable(getResources(), bitmap); 71 rectChecked.setIntrinsicWidth(bitmap.getWidth() + strokeWidth); 72 rectChecked.setIntrinsicHeight(bitmap.getHeight() + strokeWidth); 81 rectUnchecked.setIntrinsicWidth(bitmap.getWidth() + strokeWidth); 82 rectUnchecked.setIntrinsicHeight(bitmap.getHeight() + strokeWidth); 104 setPadding(getPaddingLeft() + (int) ((bitmap.getWidth() - w) / 2.f + .5f), 105 getPaddingTop() + (int) (bitmap.getHeight() * 0.70),
|
/development/samples/XmlAdapters/src/com/example/android/xmladapters/ |
H A D | ImageDownloader.java | 77 // Soft cache for bitmap kicked out of hard cache 92 * otherwise. A null bitmap will be associated to the ImageView if an error occurs. 111 Bitmap bitmap = getBitmapFromCache(url); 113 if (bitmap == null) { 117 imageView.setImageBitmap(bitmap); 201 * @return The cached bitmap or null if it was not found. 206 final Bitmap bitmap = sHardBitmapCache.get(url); 207 if (bitmap != null) { 211 sHardBitmapCache.put(url, bitmap); 212 return bitmap; 316 onPostExecute(Bitmap bitmap) argument [all...] |
H A D | ContactPhotoBinder.java | 78 // decoding the bitmap could be done in a worker thread too. 79 Bitmap bitmap = BitmapFactory.decodeStream(stream); 80 d = new BitmapDrawable(mResources, bitmap);
|
/development/samples/browseable/MediaBrowserService/src/com.example.android.mediabrowserservice/utils/ |
H A D | BitmapHelper.java | 37 // Get the dimensions of the bitmap 44 Bitmap bitmap = BitmapFactory.decodeStream(is, null, bmOptions); 45 return bitmap; 49 // Get the dimensions of the bitmap 73 Bitmap bitmap = scaleBitmap(scaleFactor, inputStream); 74 return bitmap;
|
/development/samples/devbytes/animation/ListViewCellInsertion/src/com/example/android/insertingcells/ |
H A D | CustomArrayAdapter.java | 104 Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), 108 imgView.setImageBitmap(CustomArrayAdapter.getCroppedBitmap(bitmap)); 114 * Returns a circular cropped version of the bitmap passed in. 116 public static Bitmap getCroppedBitmap(Bitmap bitmap) { argument 117 Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), 120 final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); 127 int halfWidth = bitmap.getWidth() / 2; 128 int halfHeight = bitmap [all...] |
/development/samples/devbytes/animation/ListViewExpandingCells/src/com/example/android/expandingcells/ |
H A D | CustomArrayAdapter.java | 109 public Bitmap getCroppedBitmap(Bitmap bitmap) { argument 110 Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), 113 final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); 120 int halfWidth = bitmap.getWidth()/2; 121 int halfHeight = bitmap.getHeight()/2; 127 canvas.drawBitmap(bitmap, rect, rect, paint);
|
/development/samples/devbytes/animation/KeyframeAnimation/src/com/example/android/keyframeanimation/ |
H A D | KeyframeAnimation.java | 75 Bitmap bitmap = Bitmap.createBitmap(400, 400, Bitmap.Config.ARGB_8888); 76 Canvas canvas = new Canvas(bitmap); 82 return new BitmapDrawable(getResources(), bitmap);
|
/development/samples/devbytes/graphics/BitmapScaling/src/com/example/android/bitmapscaling/ |
H A D | BitmapScaling.java | 29 * bitmap. Sub-sampling can speed up load times and reduce the need for large bitmaps 30 * in memory if your target bitmap size is much smaller, although it's good to understand 46 Bitmap bitmap = BitmapFactory.decodeResource(getResources(), 48 originalImageView.setImageBitmap(bitmap); 51 addScaledImageView(bitmap, i, container); 58 // load time by simply reading less pixels for every pixel value in the final bitmap. 59 // Note that it only scales by powers of two, so a value of two results in a bitmap 60 // 1/2 the size of the original and a value of four results in a bitmap 1/4 the original 61 // size. Intermediate values are rounded down, so a value of three results in a bitmap 1/2
|
/development/samples/devbytes/graphics/ImagePixelization/src/com/example/android/imagepixelization/ |
H A D | ImagePixelization.java | 155 public BitmapDrawable customImagePixelization(float pixelizationFactor, Bitmap bitmap) { argument 157 int width = bitmap.getWidth(); 158 int height = bitmap.getHeight(); 172 bitmap.getPixels(bitmapPixels, 0, width, 0, 0, width, height); 211 * This method of image pixelization utilizes the bitmap scaling operations built 212 * into the framework. By downscaling the bitmap and upscaling it back to its 216 public BitmapDrawable builtInPixelization(float pixelizationFactor, Bitmap bitmap) { argument 218 int width = bitmap.getWidth(); 219 int height = bitmap.getHeight(); 229 Bitmap pixelatedBitmap = Bitmap.createScaledBitmap(bitmap, downScaledWidt 278 pixelizeImage(float pixelizationFactor, Bitmap bitmap) argument [all...] |
/development/samples/ApiDemos/src/com/example/android/apis/graphics/ |
H A D | DensityActivity.java | 59 addLabelToRoot(root, "Prescaled bitmap in drawable"); 66 addLabelToRoot(root, "Autoscaled bitmap in drawable"); 88 addLabelToRoot(root, "Prescaled bitmap"); 95 addLabelToRoot(root, "Autoscaled bitmap"); 135 Bitmap bitmap; 136 bitmap = loadAndPrintDpi(resource, scale); 140 final BitmapDrawable d = new BitmapDrawable(getResources(), bitmap); 161 Bitmap bitmap; 162 bitmap = loadAndPrintDpi(resource, scale); 164 ScaledBitmapView view = new ScaledBitmapView(this, bitmap); 199 ScaledBitmapView(Context context, Bitmap bitmap) argument [all...] |
/development/samples/Support4Demos/src/com/example/android/supportv4/content/ |
H A D | FileProviderExample.java | 65 final Bitmap bitmap = Bitmap.createBitmap( 67 final Canvas canvas = new Canvas(bitmap); 73 bitmap.compress(Bitmap.CompressFormat.PNG, 100, os);
|
/development/samples/browseable/RecipeAssistant/Application/src/com.example.android.wearable.recipeassistant/ |
H A D | AssetUtils.java | 60 Bitmap bitmap = null; 64 bitmap = BitmapFactory.decodeStream(is); 77 return bitmap;
|
/development/samples/ApiDemos/src/com/example/android/apis/app/ |
H A D | PrintBitmap.java | 32 * This class demonstrates how to implement bitmap printing. 76 // Get the bitmap for the ImageView's drawable. 77 Bitmap bitmap = ((BitmapDrawable) mImageView.getDrawable()).getBitmap(); 79 // Print the bitmap. 80 printHelper.printBitmap("Print Bitmap", bitmap);
|
/development/samples/Snake/src/com/example/android/snake/ |
H A D | TileView.java | 100 Bitmap bitmap = Bitmap.createBitmap(mTileSize, mTileSize, Bitmap.Config.ARGB_8888); 101 Canvas canvas = new Canvas(bitmap); 105 mTileArray[key] = bitmap;
|
/development/samples/devbytes/animation/PictureViewer/src/com/example/android/pictureviewer/ |
H A D | PictureViewer.java | 64 Bitmap bitmap = BitmapFactory.decodeResource(getResources(), 66 drawables[i] = new BitmapDrawable(getResources(), bitmap);
|
/development/samples/devbytes/animation/ListViewDraggingAnimation/src/com/example/android/listviewdragginganimation/ |
H A D | DynamicListView.java | 55 * a bitmap and its visibility is set to INVISIBLE. A hover cell is then created and 146 * Creates the hover cell with the appropriate bitmap and of appropriate 147 * size. The hover cell's BitmapDrawable is drawn on top of the bitmap every 171 Bitmap bitmap = getBitmapFromView(v); 172 Canvas can = new Canvas(bitmap); 174 Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); 181 can.drawBitmap(bitmap, 0, 0, null); 184 return bitmap; 187 /** Returns a bitmap showin [all...] |