Solved

RenderedImage and ImageIcon

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Which is the latest version of Apache Tomcatl 3 50
mockito example issue 8 62
github account with ecipse 1 42
varialbe initialization 11 30
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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…

914 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

16 Experts available now in Live!

Get 1:1 Help Now