Solved

RenderedImage and ImageIcon

Posted on 2001-06-25
5
969 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
  • 2
  • 2
5 Comments
 
LVL 92

Accepted Solution

by:
objects earned 50 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues undeā€¦
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilationā€¦
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now