| Author |
Image component problem.
|
Darrin Smith
Ranch Hand
Joined: Aug 04, 2003
Posts: 276
|
|
I am using an image component to display an image on a page and since I don't know ahead of time the height and width of the actual image, I don't set them at design time so the image itself determines its own size (otherwise you get aspect ratio issues). My problem is that some of the images are very large. Is there any way to allow the native aspect ratio to be kept but limit the maximum size that the image component can automatically grow to? Maybe there is a way to "know" when the rednering of the image takes place, grab its height and width, calculate the aspect ratio, then scale accordingly? Thanks!
|
 |
Varun Khanna
Ranch Hand
Joined: May 30, 2002
Posts: 1400
|
|
Maybe there is a way to "know" when the rednering of the image takes place, grab its height and width, calculate the aspect ratio, then scale accordingly? Thanks!
For this you just need to check out the image renderer. Extend it and play around the way you want.
|
- Varun
|
 |
Darrin Smith
Ranch Hand
Joined: Aug 04, 2003
Posts: 276
|
|
Originally posted by Varun Khanna: For this you just need to check out the image renderer. Extend it and play around the way you want.
Never had to write a renderer before. I guess I'll Google around for a tutorial and see what my copy of JavaServer Faces In Action book has to say. The thing is, I'm using Creator, so hopefully everthing can integrate OK. Thanks for the feedback!
|
 |
 |
|
|
subject: Image component problem.
|
|
|