Bug 468 : PGraphics problem with fillColor
Last modified: 2007-10-10 12:29




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
ksteinfe
Assigned To:
fry

Attachment Type Created Size Actions
jar file demonstrating unexpected PGraphics fill behavior application/java-archive 2006-12-09 16:12 150.68 KB

Description:   Opened: 2006-12-09 16:11
hello,

long time user, first time bug reporter... hope i've got something
worthwhile here.
i'm trying to use a PGraphics instance to draw to an off-screen graphics
buffer, and have encountered some strange behavior. when i try drawing
simple shapes to the buffer and specify anything besides the default fill
color, i seem to get transparent pixels instead.

some code follows demonstrating the problem, i would expect this would
generate a red circle rather than a transparent one.

apologies if i've missed something obvious, or if this bug is already reported.

-kyle

using v0121 + v0123, jdk1.5.0_09, windowsXP

code:
////////////////////////////
PGraphics buffer;

void setup() {
size(100, 100);
buffer = createGraphics(80, 80, P3D);
}

void draw() {
background(150, 0, 150);
line(0,0,width,height);
line(width,0,0,height);
drawEllipseToBuffer();
image(buffer, 10, 10);
}

void drawEllipseToBuffer(){
buffer.beginDraw();
buffer.background(120);
buffer.stroke(0);
buffer.fill(120,0,0);
buffer.ellipse(mouseX-30,mouseY-30,50,50);
buffer.endDraw();
}
Additional Comment #1 From ksteinfe 2006-12-09 16:12
edit]
jar file demonstrating unexpected PGraphics fill behavior
Additional Comment #2 From fry 2006-12-11 18:45
on first glance, i'm stumped. though i might be missing something obvious..
i'll look into it further, thanks for the report.
Additional Comment #3 From fry 2007-03-13 03:04
*** Bug 527 has been marked as a duplicate of this bug. ***
Additional Comment #4 From fry 2007-03-13 03:05
*** Bug 534 has been marked as a duplicate of this bug. ***
Additional Comment #5 From ewjordan 2007-06-10 23:17
Just a couple notes on this.

First, it's not just creating a P3D buffer and drawing it to the default
JAVA2D renderer. If you create a JAVA2D buffer, the drawing to the buffer
doesn't work at all, and all you see is the background. Same with drawing
a JAVA2D buffer to an OPENGL screen. In fact, the only combination that
seems to work is using a JAVA2D buffer and drawing it to a P3D screen.

Anyone have any ideas how this could possibly be arising? Is it something
to do with the color packing orders or something like that? Even that
wouldn't seem to explain why no renderer can handle displaying an image
created by another version of the same renderer...
Additional Comment #6 From fry 2007-06-11 05:15
actually i have some ideas about this one and its cousins, having seen a
couple more reports about it. i should be able to get the fix in soon.
Additional Comment #7 From fry 2007-10-10 12:29
now fixed for 0127.