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


---------------------------------------------------------------------
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]

Reply via email to