We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsSoftware Bugs › ARGB Images with createGraphics
Page Index Toggle Pages: 1
ARGB Images with createGraphics (Read 1722 times)
ARGB Images with createGraphics
Nov 3rd, 2006, 5:50pm
 
When painting an ARGB image to a PGraphics object (created with createGraphics) using image() or as a texture on a polygon it doesn't work.

It works fine when painting to the PApplets g object but not when I create my own Graphics object.

I found the resulved bug http://dev.processing.org/bugs/show_bug.cgi?id=350 which is similar but a different problem.

below is some code that illustrates the problem.

PGraphics pg;

PImage b;

void setup() {
 size(20, 20, P3D);
 pg = createGraphics(20, 20, P3D);
 //pg.format = ARGB;
 b = loadImage("gui_small_handle_normal.gif");
 // b = loadImage("gui_small_handle_normal.png");
 // b = loadImage("gui_small_handle_normal.jpg");
}

void draw() {
 background(255, 100, 0);
 pg.beginDraw();
 pg.background(255, 100, 0);
 // pg.background(255);
 // pg.image(b, 0, 0, width, height);
 // pg.background(b);
 pg.beginShape();
 pg.texture(b);
 pg.vertex(0, 0, 0, 0);
 pg.vertex(20, 0, 100, 0);
 pg.vertex(20, 20, 100, 100);
 pg.vertex(0, 20, 0, 100);
 pg.endShape();

 pg.endDraw();

 g.image(b, 50, 50);
 g.image(pg, 0, 0);

 if (mousePressed) {
   g.beginShape();
   g.texture(b);
   g.vertex(0, 0, 0, 0);
   g.vertex(20, 0, 100, 0);
   g.vertex(20, 20, 100, 100);
   g.vertex(0, 20, 0, 100);
   g.endShape();
 }
 int bob = 0;
 bob++;
}
Re: ARGB Images with createGraphics
Reply #1 - Nov 5th, 2006, 11:19pm
 
that's this bug here:
http://dev.processing.org/bugs/show_bug.cgi?id=419
i think i've just got it fixed for 0120, which i hope to post soon.
Page Index Toggle Pages: 1