Bug in Graphics.drawImage ?!

Discussion in 'Java' started by Rene, Aug 24, 2004.

  1. Rene

    Rene Guest

    Can someone please confirm the following bug.

    Compile and run the code below. Iconify the frame and
    deiconify, or make it repaint some other way.
    On my system, I get garbadge, while it was
    correct the first time.

    System is: Windows XP, Java 1.4.2_05

    Thanks a lot!

    ----------------------------------

    import java.awt.*;
    import java.awt.event.*;
    class BroadPanel extends Panel
    { Image I;
    public void paint (Graphics g)
    { int h=getSize().height;
    if (I==null)
    { I=createImage(10*h,h);
    Graphics ig=I.getGraphics();
    ig.clearRect(0,0,10*h,h);
    ig.setColor(Color.black);
    ig.drawLine(0,0,10*h-1,h-1);
    ig.dispose();
    }
    g.drawImage(I,0,0,this);
    }
    }
    public class Bug
    extends Frame
    { public Bug ()
    { setLayout(new BorderLayout());
    add("Center",new BroadPanel());
    setSize(500,500);
    setVisible(true);
    addWindowListener(new WindowAdapter()
    { public void windowClosing (WindowEvent e)
    { setVisible(false); dispose();
    }
    }
    );
    }
    public static void main(String[] args)
    { new Bug();
    }
    }
     
    Rene, Aug 24, 2004
    #1
    1. Advertising

  2. On Tue, 24 Aug 2004 16:26:25 +0200, Rene wrote:

    > Can someone please confirm the following bug.
    >
    > Compile and run the code below. Iconify the frame and
    > deiconify, or make it repaint some other way.
    > On my system, I get garbadge, while it was
    > correct the first time.
    >
    > System is: Windows XP, Java 1.4.2_05


    The sloping line rendered reliably for me*
    using WinXP/Sun 1.5 beta.

    * After both resizing and minimize/restore.

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Aug 24, 2004
    #2
    1. Advertising

  3. Rene

    Rene Guest

    > The sloping line rendered reliably for me*
    > using WinXP/Sun 1.5 beta.


    Thanks for testing. Either it is a graphic card problem, or it has been
    removed in 1.5.

    Rene
     
    Rene, Aug 24, 2004
    #3
  4. "Rene" <> wrote in message
    news:...
    > > The sloping line rendered reliably for me*
    > > using WinXP/Sun 1.5 beta.

    >
    > Thanks for testing. Either it is a graphic card problem, or it has been
    > removed in 1.5.


    Try running with -Dsun.java2d.noddraw . If it
    works with DirectDraw off, you probably have
    a bugged video driver.
     
    Larry Barowski, Aug 25, 2004
    #4
  5. Rene

    Rene Guest

    Thanks Larry, that was it. This is a mobile Radeon 9600. However, there are
    no new drivers, AFAIK.

    Hmmmmm

    Rene

    "Larry Barowski" <larrybarATengDOTauburnDOTeduANDthatISall> schrieb im
    Newsbeitrag news:...
    >
    > "Rene" <> wrote in message
    > news:...
    >> > The sloping line rendered reliably for me*
    >> > using WinXP/Sun 1.5 beta.

    >>
    >> Thanks for testing. Either it is a graphic card problem, or it has been
    >> removed in 1.5.

    >
    > Try running with -Dsun.java2d.noddraw . If it
    > works with DirectDraw off, you probably have
    > a bugged video driver.
    >
    >
     
    Rene, Aug 26, 2004
    #5
  6. "Rene" <> wrote in message
    news:...
    > Thanks Larry, that was it. This is a mobile Radeon 9600. However, there

    are
    > no new drivers, AFAIK.


    They may not be aware of the problem. Java tends to turn
    up bugs in video drivers that other applications don't. As
    those bugs get fixed, new cards and new drivers with new
    bugs are released. Some of those bugs crash the whole
    system, others just make your graphics look crappy. Either
    way, users tend to blame the application. After years of
    this we finally learned our lesson and just recently began
    releasing our product with DirectDraw disabled by default.

    In fairness, I should add that occasionally such problems
    are caused by Java itself. But video card vendors really
    need to start testing their drivers with graphics-intensive
    Java applications.
     
    Larry Barowski, Aug 26, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michele Puccini
    Replies:
    0
    Views:
    406
    Michele Puccini
    Nov 9, 2003
  2. Wolfgang
    Replies:
    3
    Views:
    6,103
    Knute Johnson
    Feb 10, 2004
  3. OtisUsenet
    Replies:
    3
    Views:
    12,556
    OtisUsenet
    Feb 24, 2004
  4. Lash Rambo
    Replies:
    5
    Views:
    654
    Lash Rambo
    Jul 15, 2004
  5. Me
    Replies:
    4
    Views:
    2,069
    Andrew Thompson
    Jun 20, 2005
Loading...

Share This Page