Merge pull request #2070 from gohai/pdf-transparency

Image transparency for PDF output
This commit is contained in:
Ben Fry
2013-10-06 12:40:55 -07:00
@@ -404,22 +404,24 @@ public class PGraphicsPDF extends PGraphicsJava2D {
//////////////////////////////////////////////////////////////
/*
protected void imageImplAWT(java.awt.Image awtImage,
protected void imageImpl(PImage image,
float x1, float y1, float x2, float y2,
int u1, int v1, int u2, int v2) {
pushMatrix();
translate(x1, y1);
int awtImageWidth = awtImage.getWidth(null);
int awtImageHeight = awtImage.getHeight(null);
scale((x2 - x1) / (float)awtImageWidth,
(y2 - y1) / (float)awtImageHeight);
g2.drawImage(awtImage,
0, 0, awtImageWidth, awtImageHeight,
u1, v1, u2, v2, null);
int imageWidth = image.width;
int imageHeight = image.height;
scale((x2 - x1) / (float)imageWidth,
(y2 - y1) / (float)imageHeight);
if (u2-u1 != imageWidth || v2-v1 != imageHeight) {
PImage tmp = new PImage(u2-u1, v2-v1, ARGB);
tmp.copy(image, u1, v1, u2, v2, 0, 0, u2-u1, v2-v1);
g2.drawImage(image.getImage(), 0, 0, null);
} else {
g2.drawImage(image.getImage(), u1, v1, null);
}
popMatrix();
}
*/
//////////////////////////////////////////////////////////////