Stephen Williams
YaBB Newbies
Offline
Posts: 39
Graz, Austria
|
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++; }
|