Skip to main content

How to use a JAI image transformed to upodate a JPanle

3 replies [Last post]
fishel
Offline
Joined: 2005-08-30

Hi i have a problem i have to load an image(jpeg) into a Jpanel in Swing (after the image been update scaling) possibly it is possible to do it saving the image into a file but i wanna displayd in the Jpanel from the RenderImage object or how can i do that, any help will be very usufull

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fishel
Offline
Joined: 2005-08-30

Hi thanks for the help but i am new in this and the page that you gave me only tells me that use Graphics2D.drawRenderedImage(RenderedImage,AffineTransform) wich one recive the RenderedImage the one create by RenderedImage objImage = JAI.create("scale", "c:/photos/audi2003.jpg"); method but the other paramenter i AffineTransform i guess it should be this way Graphics2D.drawRenderedImage(objImage,AffineTransform.getScaleInstance(x,y)); where x is JScrollPane().heigth() and y = JScrollPane().width.
But other problems is that when i compile this it apper the message

Error(34,24): non-static method drawRenderedImage(java.awt.image.RenderedImage, java.awt.geom.AffineTransform) cannot be referenced from a static context

i really apreciate any help please and some code with be usufull

Brian Burkhalter

I would recommend taking a look at these artices:

http://java.sun.com/learning/new2java/index.html
http://java.sun.com/j2se/1.5.0/docs/guide/2d/spec/j2d-bookTOC.html
https://jai.dev.java.net/servlets/ReadMsg?list=interest&msgNo=1169

Brian

On Thu, 10 Nov 2005, jai-interest@javadesktop.org wrote:

> Hi thanks for the help but i am new in this and the page that you gave me only tells me that use Graphics2D.drawRenderedImage(RenderedImage,AffineTransform) wich one recive the RenderedImage the one create by RenderedImage objImage = JAI.create("scale", "c:/photos/audi2003.jpg"); method but the other paramenter i AffineTransform i guess it should be this way Graphics2D.drawRenderedImage(objImage,AffineTransform.getScaleInstance(x,y)); where x is JScrollPane().heigth() and y = JScrollPane().width.
> But other problems is that when i compile this it apper the message
>
> Error(34,24): non-static method drawRenderedImage(java.awt.image.RenderedImage, java.awt.geom.AffineTransform) cannot be referenced from a static context
>
> i really apreciate any help please and some code with be usufull
> ---
> [Message sent by forum member 'Fishel' (Fishel Gonzalez Berenstein)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=124217&#124217
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

----------------
Brian Burkhalter
Java Multimedia, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Brian Burkhalter

http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/co...

On Wed, 9 Nov 2005, jai-interest@javadesktop.org wrote:

> Hi i have a problem i have to load an image(jpeg) into a Jpanel in Swing (after the image been update scaling) possibly it is possible to do it saving the image into a file but i wanna displayd in the Jpanel from the RenderImage object or how can i do that, any help will be very usufull
> ---
> [Message sent by forum member 'Fishel' (Fishel Gonzalez Berenstein)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=124007&#124007
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

----------------
Brian Burkhalter
Java Multimedia, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net