org.apache.wicket.extensions.markup.html.image.resource
Class ThumbnailImageResource
java.lang.Object
org.apache.wicket.request.resource.AbstractResource
org.apache.wicket.request.resource.DynamicImageResource
org.apache.wicket.extensions.markup.html.image.resource.ThumbnailImageResource
- All Implemented Interfaces:
- java.io.Serializable, IClusterable, IResource
public class ThumbnailImageResource
- extends DynamicImageResource
Image resource that dynamically scales the given original resource to a thumbnail. It is scaled
either using the given maxSize as width or height, depending on its shape. If both the width and
height are less than maxSize, no scaling is performed.
- Author:
- Eelco Hillenius, Eugene Kamenev
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThumbnailImageResource
public ThumbnailImageResource(IResource unscaledImageResource,
int maxSize)
- Construct.
- Parameters:
unscaledImageResource
- the unscaled, original image resource. Must be not nullmaxSize
- maximum size (width or height) for resize operation
getImageData
protected byte[] getImageData(IResource.Attributes attributes)
- Description copied from class:
DynamicImageResource
- Get image data for our dynamic image resource. If the subclass regenerates the data, it
should set the
DynamicImageResource.setLastModifiedTime(Time)
when it does so. This
ensures that image caching works correctly.
- Specified by:
getImageData
in class DynamicImageResource
- Parameters:
attributes
- the context bringing the request, response and the parameters
- Returns:
- The image data for this dynamic image
getScaledImageInstance
protected final java.awt.image.BufferedImage getScaledImageInstance(IResource.Attributes attributes)
- get resized image instance.
- Parameters:
attributes
-
- Returns:
- BufferedImage
Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.