images.java
If you want to debug this class, then you should use class that FullScreen.javaimport java.awt.*; import javax.swing.JFrame; import javax.swing.ImageIcon; public class images extends JFrame{ /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub DisplayMode dm = new DisplayMode(800,600,16,DisplayMode.REFRESH_RATE_UNKNOWN); images i = new images(); i.run(dm); } private FullScreen s; private Image bg; private Image pic; private Image ani; private boolean loaded; //run method public void run(DisplayMode dm){ setBackground(Color.WHITE); setForeground(Color.BLACK); setFont(new Font("Arial",Font.PLAIN,24)); loaded = false; s = new FullScreen(); try{ s.setFullScreen(dm, this); loadpics(); try{ Thread.sleep(3000);//milliseconds }catch(Exception ex){} }finally{ s.restoreScreen(); } } //load pictures public void loadpics(){ bg = new ImageIcon("C:\\anywhere.jpg").getImage(); pic = new ImageIcon("C:\\anywhere.png").getImage(); ani = new ImageIcon("C:\\anywhere.gif").getImage(); loaded = true; repaint(); } public void paint(Graphics g){ if(g instanceof Graphics2D){ Graphics2D g2 = (Graphics2D)g; g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); } if(loaded){ g.drawImage(bg, 30, 30, null); g.drawImage(pic, 170, 180, null); g.drawImage(ani,100,100,null); } } }
No comments:
Post a Comment