Android Bitmap Load getBitmap(Context context, int resId)

Here you can find the source of getBitmap(Context context, int resId)

Description

get Bitmap

Declaration

public static Bitmap getBitmap(Context context, int resId) 

Method Source Code

//package com.java2s;

import android.content.Context;

import android.graphics.Bitmap;

import android.graphics.drawable.BitmapDrawable;

public class Main {
    public static Bitmap getBitmap(Context context, int resId) {
        BitmapDrawable drawable = (BitmapDrawable) context.getResources()
                .getDrawable(resId);/*w  w  w.j  av a 2 s . c om*/
        return drawable.getBitmap();
    }
}

Related

  1. getImageFromAssetFile(Context context, String fileName)
  2. downloadImageToSd(String urlSource, String pathDest)
  3. downloadImageToSd(String urlSource, String pathDest, String referer)
  4. getResizedBitmap(Uri imageUri, Activity activity)
  5. downSampleBitmap(Uri uri, Activity act, Boolean needRotate)
  6. getBitmap(String photoId)
  7. getBitmapFromAsset(String strName, Context context)
  8. getBitmapFromInternet(String strName)
  9. getBitmapFromUri(Context ctxt, Uri selectedImageURI)