mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 19:31:16 +01:00
Image transparency for PDF output
Before, drawing an image with transparency would result in black, opaque pixels in the PDF file. This change, figured out together with Jürg Lehni, fixes this. At its core, switching from drawImage(img, int, int, int, int, int, int, int, int, null) to drawImage(img, int, int, null) seems to do the trick - so this might have been a bug in iText all along. Signed-off-by: Jürg Lehni <juerg@scratchdisk.com> Signed-off-by: Gottfried Haider <gottfried.haider@gmail.com>
This commit is contained in:
@@ -404,22 +404,18 @@ 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);
|
||||
g2.drawImage(image.getImage(), u1, v1, null);
|
||||
popMatrix();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user