Java BufferedImage Size Get getDimension(BufferedImage img)

Here you can find the source of getDimension(BufferedImage img)

Description

get Dimension

License

Open Source License

Declaration

public static Dimension getDimension(BufferedImage img) 

Method Source Code

//package com.java2s;
/*//  w  w w  . j  av a2 s  .c om
 * Copyright (C) 2014. EMBL, European Bioinformatics Institute
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.awt.Dimension;

import java.awt.image.BufferedImage;

public class Main {
    public static Dimension getDimension(BufferedImage img) {
        int h = img.getHeight();
        int w = img.getWidth();

        Dimension dim = new Dimension(w, h);

        return dim;
    }
}

Related

  1. getDimension(File f)
  2. getDimension(final Image anImage, final ImageObserver obs)
  3. getDimensions(byte[] image)
  4. getSize(BufferedImage image)