Get the option for obtain the image size of bitmap. - Android Graphics

Android examples for Graphics:Bitmap Size

Description

Get the option for obtain the image size of bitmap.

Demo Code


//package com.java2s;

import android.graphics.BitmapFactory;

public class Main {

    public static BitmapFactory.Options getBitmapSize(String strImagePath) {

        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        //Bitmap photo = BitmapFactory.decodeFile(strPath, options);
        BitmapFactory.decodeFile(strImagePath, options);

        return options;
    }/*from   w w w  .  ja  va  2s.  co m*/
}

Related Tutorials