[OpenMap Users] Update:Bug or Feature? OMRasterObject, not rendering 'RenderedImage'

From: JR Andreassen <janrune_at_io.com>
Date: Tue, 11 Dec 2007 15:13:27 -0600

Hi ...
 An update to this issue.
After using the ToolkitImage for a while we started getting stack
overflows...

Exception in thread "AWT-EventQueue-0" java.lang.StackOverflowError
sun.awt.image.ImageWatched$WeakLink.isWatcher(ImageWatched.java:84)

The culprit was an infinate/circular list of ImageWatched.
toolkitimage.imagerep.watcherList

I traced it to(and could be others as well)
OMRasterObject.java(503) in OMRasterObject.setImage(Image ii)
There were repeated cals to :
Toolkit.getDefaultToolkit().prepareImage(bitmap, -1, -1, this);
on the same image(since I was reusing the same image).

I Changed it to retur/use BufferedImage, which now eorks and it seams to
have solved the problem.

  I'll post more details if I do anything elses with it.
     JR


> Hi thanks for getting back to me...
>
> OK... Don't know why it's ot working...
> I've managed to work arround it for now.
> Thanks
> JR
>
>> Hi JR,
>>
>> You should be able to use a BufferedImage directly. I do this all
>> the time, creating a new BufferedImage with a certain image type,
>> getting the Graphics object from it an rendering into the image, and
>> then sticking it in a OMRaster.
>>
>> - Don
>>
>> On Jan 19, 2007, at 3:17 PM, JR Andreassen wrote:
>>
>>> JR Andreassen wrote:
>>>
>>>> Hi..
>>>> I'm trying to use Icon Images with locations.
>>>> When I use Images loded from the disk it works fine.
>>>> When I use the same image from BufferedImage it doesn't draw.
>>>> I've traced it to 'OMRasterObject.render.java' (line357)
>>>>
>>>> //-------------------------------------------------------------------
>>>> -------------------
>>>> if (g instanceof Graphics2D && bitmap instanceof
>>>> RenderedImage) {
>>>> // Affine translation for placement...
>>>> ((Graphics2D) g).drawRenderedImage((BufferedImage)
>>>> bitmap,
>>>> new AffineTransform(1f, 0f, 0f, 1f,
>>>> point1.x, point1.y));
>>>> // Undo the affine translation for future graphics??
>>>> ((Graphics2D) g).translate(-point1.x, -point1.y);
>>>> } else {
>>>> g.drawImage(bitmap, point1.x, point1.y, this);
>>>> }
>>>> //-------------------------------------------------------------------
>>>> -------------------
>>>> When I load the Image from disk it's a 'sun.awt.image.ToolitImage'
>>>> and it renders just fine.
>>>> When It's loaded from memory(image I've drawn) it's a
>>>> 'BufferedImage'/RenderedImage' it does not render.
>>>>
>>>> Any Ideas ??
>>>> Any insight on this would be appriciated.
>>>> Thanks
>>>> JR
>>>>
>>> It works when I use:
>>> Toolkit.getDefaultToolkit().createImage(BufferedImage.getSource());
>>>
>>> JR
>>>
>>> --
>>> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
>>> with the following text in the BODY of the message "unsubscribe
>>> openmap-users"]
>>
>>
>>
>>
>>
>> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> Don Dietrick, dietrick_at_bbn.com
>> BBN Technologies, Cambridge, MA
>> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>>
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Tue Dec 11 2007 - 16:16:52 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:08 EDT