• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1076
  • Last Modified:

RenderedImage and ImageIcon

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
ahTri
Asked:
ahTri
  • 2
  • 2
1 Solution
 
objectsCommented:
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
 
MoondancerCommented:
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
 
objectsCommented:
0
 
MoondancerCommented:
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
 
ahTriAuthor Commented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now