ktrinad Posted August 19, 2006 Share Posted August 19, 2006 By: adf ads dsf - pkw Image in JRDesignParameter 2004-02-04 05:59Hi:) I have a little problem. I defined report with parameter which class is java.awt.Image. This image is read from jar file. When I run report for the first time I always get exception: Identifier: java.lang.IllegalArgumentException Message: Width (-1) and height (-1) cannot be <= 0 (no data is retrieved??) but if my application is still running and I execute the same report for the second time I can see the image! Can anybody help me? Best regards Chris By: Paulo Soares - psoares33 RE: Image in JRDesignParameter 2004-02-04 08:39You must actually load the image. This was extracted from iText's PdfGraphics2D: private MediaTracker mediaTracker; private synchronized void waitForImage(java.awt.Image image) { if (mediaTracker == null) mediaTracker = new MediaTracker(new PdfGraphics2D.fakeComponent()); mediaTracker.addImage(image, 0); try { mediaTracker.waitForID(0); } catch (InterruptedException e) { // empty on purpose } mediaTracker.removeImage(image); } static private class fakeComponent extends Component { } Best Regards, Paulo Soares By: adf ads dsf - pkw RE: Image in JRDesignParameter 2004-02-05 10:02It works! Thank You:) Best Regards, Chris Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now