Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.graphics.BitmapFactory;
import android.graphics.Point;

import android.util.Log;

import static android.graphics.BitmapFactory.decodeFile;

public class Main {

    public static Point getBitmapSize(String path) {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        decodeFile(path, options);
        int realWidth = options.outWidth;
        int realHeight = options.outHeight;

        Log.d("loadimage", "realWidth: " + realWidth);
        Log.d("loadimage", "realHeight: " + realHeight);

        return new Point(realWidth, realHeight);
    }
}