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

From: Don Dietrick <dietrick_at_bbn.com>
Date: Fri, 26 Jan 2007 10:49:53 -0500

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"]
Received on Fri Jan 26 2007 - 10:50:04 EST

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