import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.widgets.Display;
public class ImageDataFromImage {
public static void main(String[] args) {
Display display = new Display();
Image image = new Image(display, "yourFile.gif");
ImageData data = image.getImageData();
System.out.println(data.width);
System.out.println(data.height);
if (image != null) image.dispose();
display.dispose();
}
}
|