Solved

RenderedImage and ImageIcon

Posted on 2001-06-25
5
987 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

776 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