Java JComponent Size getSize(byte[] data)

Here you can find the source of getSize(byte[] data)

Description

get Size

License

LGPL

Declaration

public static Dimension getSize(byte[] data) 

Method Source Code

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

import java.awt.Dimension;

import java.awt.Image;

import javax.swing.ImageIcon;

public class Main {
    public static Dimension getSize(byte[] data) {

        ImageIcon ii = new ImageIcon(data);

        Image img = ii.getImage();

        return new Dimension(img.getWidth(null), img.getHeight(null));
    }//w w  w.  ja  v  a2 s  .  co  m
}

Related

  1. getPreferredSize(String html, boolean width, int prefSize)
  2. getPreferredSize(Window window)
  3. getPreferredSizeComponent(JComponent component)
  4. getScreenSize()
  5. getScreenSize(Component invoker)
  6. getSize(Component c, int sizeflag)
  7. getValidatedSize(Component c, int sizeflag)
  8. getViewableScreenSize()
  9. getVisibleSizeInViewport(Component c)