HI Yes I'm talking about bitmap images. BTW FOP doesn't support 16 and 32 bit depth :(( I'm getting this error
:Image (file:./report_designer_graphics/FNDBAS/FND_SESSION_REP/IFSlogbw_16.bmp) has 16 which is not a supported BMP format. /Harshini -----Original Message----- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: Monday, February 11, 2008 5:10 PM To: [email protected] Subject: Re: Converting BufferredImage into FopImage? I don't understand why you want to do that. There's already a JAIImage.java which uses JAI to read bitmap images and converts a BufferedImage into the format needed by FOP (JAIImage is a subclass of FopImage). What exactly do you mean by "Bitmap image" in your first post? Windows BMP? There's a BmpImage class that supports them. And in case it doesn't work for the BMP images you use it's quite easy to replace BmpImage by JAIImage (or a customized subclass) in FopImageFactory. I hope for you that you can soon upgrade to the latest FOP as this stuff gets much easier (or even unnecessary). Good luck! On 11.02.2008 12:19:30 Harshini Madurapperuma wrote: > Hi Jeremias; > > Following shows the modified code and: > RenderedImage img2 = > (RenderedImage)JAI.create("ImageRead",imageSource); > RenderedImageAdapter ria = new RenderedImageAdapter(img2); > BufferedImage bi = ria.getAsBufferedImage(); > FopImage img = (FopImage)bi; > > It was like this earlier: > FopImage img = FopImageFactory.Make(imageSource); > > I'm using FOP 0.20.5, anyway I have to stick to this version for now no way > to change it at this moment. This is working fine for .gif, .jpg, .png images > and doesn't work for Bitmap images. That's why I have changed the code. > > Thanks > Harshini > > > > -----Original Message----- > From: Jeremias Maerki [mailto:[EMAIL PROTECTED] > Sent: Monday, February 11, 2008 4:44 PM > To: [email protected] > Subject: Re: Converting BufferredImage into FopImage? > > Of course, you get a ClassCastException. These two classes are not related. > Can you please start by explaining what you're trying to do (your overall > goal, I mean). Maybe I can then guide you in the right direction. > > On 11.02.2008 12:03:26 Harshini Madurapperuma wrote: > > > > Hi All > > > > > > Does anybody know how to convert a BufferredImage into a FopImage? > > BufferredImage bi = " XXX "; > > FopImage img = (FopImage)bi; > > > > When doing this I'm getting a ClassCastException. > > > > Regards > > Harshini. > > > Jeremias Maerki > Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ------------------------------------------------------------------------------ CONFIDENTIALITY AND DISCLAIMER NOTICE This e-mail, including any attachments, is confidential and intended only for the addressee. If you are not the intended recipient, please notify us immediately and delete this e-mail from your system. Any use or disclosure of the information contained herein is strictly prohibited. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
