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.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Point;

public class Main {

    public static Point getImageDimension(Context context, int resource) {
        Bitmap bm = BitmapFactory.decodeResource(context.getResources(), resource);
        Point point = new Point();
        point.x = bm.getWidth();
        point.y = bm.getHeight();
        bm.recycle();
        bm = null;

        return point;
    }
}