?
Solved

RenderedImage and ImageIcon

Posted on 2001-06-25
5
Medium Priority
?
1,042 Views
Last Modified: 2012-05-04
Is there anyway to contruct/convert an ImageIcon from an existing RenderedImage ? My application currently use alot of ImageIcon, now I use JAI which construct a RenderedImage from a image file.
0
Comment
Question by:ahTri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 92

Accepted Solution

by:
objects earned 150 total points
ID: 6223898
Your RenderedImages are probably BufferedImage objects so you may be able to simply cast them to an image. Try something like the following:

RenderedImage ri = ......;

if (ri instanceof Image)
{
   ImageIcon icon = new ImageIcon((Image)ri);
}
else
{
   System.out.println("The image is a "+ri.getClass());
}
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6836523
The following listing represents all your open questions today.

http://www.experts-exchange.com/questions/Q.11676738.html
http://www.experts-exchange.com/questions/Q.20117504.html
http://www.experts-exchange.com/questions/Q.20118233.html
http://www.experts-exchange.com/questions/Q.20118846.html
http://www.experts-exchange.com/questions/Q.20129873.html
http://www.experts-exchange.com/questions/Q.20141025.html
http://www.experts-exchange.com/questions/Q.20144250.html
http://www.experts-exchange.com/questions/Q.20179242.html
http://www.experts-exchange.com/questions/Q.20227610.html
http://www.experts-exchange.com/questions/Q.20229440.html
http://www.experts-exchange.com/questions/Q.20234194.html
http://www.experts-exchange.com/questions/Q.20235266.html
http://www.experts-exchange.com/questions/Q.20240818.html
http://www.experts-exchange.com/questions/Q.20241371.html
http://www.experts-exchange.com/questions/Q.20241442.html
http://www.experts-exchange.com/questions/Q.20242748.html
http://www.experts-exchange.com/questions/Q.20253338.html
http://www.experts-exchange.com/questions/Q.20257484.html


This question appears to have been abandoned. Your options are:
 
1.  Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3.  Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4.  Delete the question. Again, you must tell the other participants why you wish to do this.
 
For special handling needs, please post a zero point question in the link below, include the question QID/link.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this Help Desk link for Member Guidelines, Member Agreement and the Question/Answer process:  Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues.
http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp
 
 
PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:
 
Please leave any comments regarding this question here on closing recommendations if this item remains inactive another three days.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange
 
P.S.  For year 2000 question, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
0
 
LVL 92

Expert Comment

by:objects
ID: 6845141
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6851624
Thanks for returning and finalizing your question.  Anytime you choose to grade less than an A, please comment as to why.  This helps all involved, including others who may visit this question at a later time for help.  Some experts look at grading history before deciding to help someone, so that also may have an impact to you and how quickly your future questions are answered.

The points to you are always the same, but the points granted the expert depend upon the grade.  Using 100 points as an example.  100 at A = 400 ... 100 at B = 300 .... 100 at C = 200, so it also has a point impact to the experts.  

If the grade chosen was in error, let me know, and I can correct this.

EE Moderator
0
 

Author Comment

by:ahTri
ID: 6851893
Moondancer,

Sorry I didn't know that there is differences in the grading , I will keep this in mind for future questions
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question