Android Bitmap Size Get obtainBitmapSize(String pathName)

Here you can find the source of obtainBitmapSize(String pathName)

Description

obtain Bitmap Size

Declaration

public static final int[] obtainBitmapSize(String pathName) 

Method Source Code

//package com.java2s;

import android.graphics.BitmapFactory;

public class Main {
    public static final int[] obtainBitmapSize(String pathName) {
        int[] size = new int[2];
        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeFile(pathName, options);
        size[0] = options.outWidth;/*  w ww .  j  av  a2  s. c o  m*/
        size[1] = options.outHeight;
        return size;
    }
}

Related

  1. computeSampleSize(BitmapFactory.Options options, int minSideLength, int maxNumOfPixels)
  2. computeSampleSize(BitmapFactory.Options options, int target)
  3. getBitmapSize(String filePath)
  4. getImageWH(String path)
  5. inSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight)
  6. computeSampleSize(BitmapFactory.Options options, int minSideLength, int maxNumOfPixels)
  7. computeInitialSampleSize( BitmapFactory.Options options, int minSideLength, int maxNumOfPixels)
  8. computeInitialSampleSize(int w, int h, int minSideLength, int maxNumOfPixels)
  9. computeInitialSampleSize( BitmapFactory.Options options, int minSideLength, int maxNumOfPixels)