Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1. BitmapFactory.Options options=new BitmapFactory.Options();// Create object of bitmapfactory's option method for further option use
  2.            // options.inPurgeable = true; // inPurgeable is used to free up memory while required
  3.            // options.inSampleSize=3;
  4.             //options.inPreferredConfig = Config.RGB_565;
  5.             options.inJustDecodeBounds = false;
  6.             Log.d("image data",currentProduct.getimage().toString());
  7.            
  8.             byte[] data = Base64.decode(currentProduct.getimage(), Base64.NO_PADDING );
  9.             Log.d("image ds",data.toString());
  10.             Bitmap bitmap = null ;
  11. try
  12. {
  13.             Bitmap bitmap1 = BitmapFactory.decodeByteArray(data ,0,data.length,options);//Decode image, "thumbnail" is the object of image file
  14.              bitmap = Bitmap.createScaledBitmap(bitmap1, 25 , 25 , true);// convert decoded bitmap into well scalled Bitmap format.
  15. }
  16. catch(NullPointerException ex)
  17. {
  18.    
  19. }
  20.             vh.myImage.setImageBitmap(bitmap);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement