0 Replies Latest reply: Sep 22, 2010 8:52 PM by 843802 RSS

    drawImage and jimi

    843802
      hello
      I tryed to paint an PCX-Image with Jimi, but it paints only a black rectangle. when I isolated the problem, there was instead of the black, a green rectangle. I made it grey, by comentig out the setBackground-method. so my question is, why drawImage dont works within Jimi.
      Thank you!

      [Edit]: or may there be an other solution? Tanks!

      my code is so far:
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;
      import com.sun.jimi.core.*;
      
      public class Qwg extends JPanel
      {
           public JFrame shot;
           private Integer shknr;
           private String zeros;
           public Image image;
           
           public Qwg()
           {
                shot = new JFrame();
                shot.add(this);
                image = Jimi.getImage("dump005.pcx");
                shot.setSize(1024, 768/*image.getWidth(this), image.getHeight(this)*/);
                //shot.setBackground(Color.green);
                shot.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                shot.setVisible(true);
                if(image!=null)
                     repaint();
           }
           
           public void paint(Graphics g)
           {
                Graphics2D gv = (Graphics2D) g;
                if(image!=null)
                     gv.drawImage(image, 0, 0, null);
           }
      
           public static void main(String[] argv)
           {
                Qwg q = new Qwg();
           }
      }
      Edited by: nixphoe666 on 21.09.2010 00:45 /n/r

      Edited by: nixphoe666 on 23.09.2010 02:50