United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4193338 : drawArc() to offscreen produces unsmooth arc

Details
Type:
Bug
Submit Date:
1998-11-28
Status:
Closed
Updated Date:
1999-04-09
Project Name:
JDK
Resolved Date:
1999-04-09
Component:
client-libs
OS:
generic
Sub-Component:
2d
CPU:
generic
Priority:
P4
Resolution:
Duplicate
Affected Versions:
1.2.0
Fixed Versions:

Related Reports
Duplicate:
Relates:

Sub Tasks

Description

Name: gsC80088			Date: 11/28/98


// drawArc() incorrect in 1.2RC2 when
// drawn onto off-screen Image
//

import java.applet.*;
import java.awt.*;

public class ArcBug extends Applet {

public static void main(String args[]) {

ArcBug	arcBug = new ArcBug();
Frame	frame = new Frame("Arc bug");

frame.add("Center", arcBug);
frame.setSize(200, 120);
frame.show();
}

public void paint(Graphics g) {

int		width = getSize().width,
		height = getSize().height;
Graphics	offscreenGraphics;
Image		offscreenImage;

// Create the off-screen drawable
//
offscreenImage = createImage(width, height);
offscreenGraphics = offscreenImage.getGraphics();

// Draw the arc off-screen (incorrectly drawn)
//
offscreenGraphics.setColor(Color.white);
offscreenGraphics.fillRect(0, 0, width, height);
offscreenGraphics.setColor(Color.blue);
offscreenGraphics.drawString("Incorrect arc", 10, 30);
offscreenGraphics.drawArc(35, 50, 20, 20, 0, 180);

// And copy it onto the screen
//
g.drawImage(offscreenImage, 0, 0, this);

// Now, draw the arc on-screen (correctly drawn)
//
g.setColor(Color.black);
g.drawString("Correct arc", 110, 30);
g.drawArc(125, 50, 20, 20, 0, 180);
}
}
(Review ID: 43406)
======================================================================

                                    

Comments
WORK AROUND



Name: gsC80088			Date: 11/28/98


None
======================================================================
                                     
2004-06-11



Hardware and Software, Engineered to Work Together