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]