Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Bug in Graphics.drawImage ?!

Reply
Thread Tools

Bug in Graphics.drawImage ?!

 
 
Rene
Guest
Posts: n/a
 
      08-24-2004
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();
}
}


 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      08-24-2004
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
 
Reply With Quote
 
 
 
 
Rene
Guest
Posts: n/a
 
      08-24-2004
> 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


 
Reply With Quote
 
Larry Barowski
Guest
Posts: n/a
 
      08-25-2004

"Rene" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> > 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.


 
Reply With Quote
 
Rene
Guest
Posts: n/a
 
      08-26-2004
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:(E-Mail Removed)...
>
> "Rene" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> > 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.
>
>



 
Reply With Quote
 
Larry Barowski
Guest
Posts: n/a
 
      08-26-2004

"Rene" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
*bug* *bug* *bug* David Raleigh Arnold Firefox 12 04-02-2007 03:13 AM
ASP.NET Login control bug or SQL 2005 bug? RedEye ASP .Net 2 12-13-2005 10:57 AM
Re: BUG? OR NOT A BUG? John ASP .Net 2 09-21-2005 10:31 AM
Bug Parade Bug 4953793 Michel Joly de Lotbiniere Java 4 12-02-2003 05:05 AM
how to report bug to g++ ? got a bug and fixed up source code DarkSpy C++ 4 06-27-2003 09:05 AM



Advertisments