package Porcess_Picture;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import sun.awt.image.GifImageDecoder;
import java.awt.Image;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
public class ShowBmp extends JFrame{
public ShowBmp(String bmpFile){
super("ShowBmp");
Image image =null;
System.out.println(bmpFile);
try{
image=ImageIO.read(new File(bmpFile));
}catch(IOException ex){
}
JLabel label =new JLabel(new ImageIcon(image));
add(label);
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
}
public static void main(String[] args){
final String fileName ="D:/rad/CF010600VP4.gif"; //把这个改成你自己的bmp图片的路径
SwingUtilities.invokeLater(new Runnable(){
public void run(){
new ShowBmp(fileName).setVisible(true);
}
});
}
}