org.apache.wicket.extensions.markup.html.image.resource
Class ThumbnailImageResource
java.lang.Object
org.apache.wicket.Resource
org.apache.wicket.markup.html.WebResource
org.apache.wicket.markup.html.DynamicWebResource
org.apache.wicket.markup.html.image.resource.DynamicImageResource
org.apache.wicket.extensions.markup.html.image.resource.ThumbnailImageResource
- All Implemented Interfaces:
- Serializable, IClusterable, IRequestListener, IResourceListener
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
- 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(WebResource 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()
- Description copied from class:
DynamicImageResource
- Get image data for our dynamic image resource. If the subclass regenerates the data, it
should set the lastModifiedTime when it does so. This ensures that image caching works
correctly.
- Specified by:
getImageData
in class DynamicImageResource
- Returns:
- The image data for this dynamic image
getScaledImageInstance
protected final BufferedImage getScaledImageInstance()
- get resized image instance.
- Returns:
- BufferedImage
setScaleHints
public final void setScaleHints(int scaleHints)
- Sets hint(s) for the scale operation.
- Parameters:
scaleHints
- hint(s) for the scale operation
invalidate
public void invalidate()
- Description copied from class:
Resource
- Sets any loaded resource to null, thus forcing a reload on the next request.
- Overrides:
invalidate
in class Resource
- See Also:
Resource.invalidate()
Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.