SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
it seems to me that the IconImage isn't that great for rotating
Rob Camick wrote:
it seems to me that the IconImage isn't that great for rotating
What exactly do you mean by rotating?
Do you want it to continually rotate like an animated gif?
Do you want it to rotate when a button is clicked?
Maybe Rotated Icon will give you some ideas. You can replace the existing icon on the label with a newly rotated icon.
Adam Cripps wrote:I want to rotate the image through 90 degress - colleauges sometimes take digital photographs that need rotating before publishing to the web. I will have a look at rotated icon, as long as I can write it back out to a file, then it should do the job.
luck, db
There are no new questions, but there may be new answers.
Darryl Burke wrote:
Adam Cripps wrote:I want to rotate the image through 90 degress - colleauges sometimes take digital photographs that need rotating before publishing to the web. I will have a look at rotated icon, as long as I can write it back out to a file, then it should do the job.
If your concern is rotating a BufferedImage, consider using AffineTransformOp -- that's what it's for. Here's an example of its use.
I found little resources on the web for putting a BufferedImage in a JPanel
or casting it to an ImageIcon
luck, db
There are no new questions, but there may be new answers.
Darryl Burke wrote:
I found little resources on the web for putting a BufferedImage in a JPanel
There's an example on this very site, and at least a few dozen more on other sites. What search terms did you use?
I used "creating imageicon from bufferedimage" in google. I hadn't searches these forums, but will give it a go now.
or casting it to an ImageIcon
You don't cast a BufferedImage to an ImageIcon, you construct an ImageIcon, passing the BufferedImage to its constructor.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:BufferedImage extends Image.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
luck, db
There are no new questions, but there may be new answers.
Darryl Burke wrote:Or, more generally, inheritance (extends) defines a is-a relationship. So, a BufferedImage is-a Image and can be used wherever Image is required.
Note that the opposite does not hold true; any arbitrary instance of Image may or may not be a BufferedImage.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |