xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Domagoj Cosic <Domagoj.Co...@hypercis.de>
Subject org.apache.fop.render.awt.AWTRenderer, again
Date Wed, 04 Oct 2000 08:39:29 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A few weeks ago, I posted a patch for the AWTRenderer. However, due to
changes between 0.13.0 an 0.14.0, this patch was not completely correct.
Here is a correct, functioning version:

	public void renderImageArea(ImageArea area) {
		int x = currentAreaContainerXPositionShadow +
		    area.getXOffset();
		int y = currentYPosition;
		int w = area.getContentWidth();
		int h = area.getHeight();
		
		FopImage img = area.getImage();
		
		if (img == null) {
		    System.out.println("area.getImage() is null");
		}
		
		String urlString = img.getURL();
		try {
			URL url = new URL(urlString);
			
			ImageIcon icon = new ImageIcon(url);
			Image image = icon.getImage();
			
			graphics.drawImage(image, x / 1000,
					   pageHeight - y / 1000,
					   w / 1000,
					   h / 1000,
					   null);
		} catch(MalformedURLException mue) {
		}
		
		currentYPosition -= h;
	}

It produces same results as the PDF renderer, as one would expect.

I wonder about why my other patch (DOM tree formatting) caused no reaction
at all...

Regards,

Domagoj

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.0.2i

iQA/AwUBOdresTZvP6Gs5imAEQJ5cQCcCNXKE4tDcMVMJUi8zExQMQ7XQvYAoIBK
SM50TvRcpNaiCfZnwDBm20cE
=Zqpk
-----END PGP SIGNATURE-----

Mime
View raw message