On Thu, 18 Nov 2010 08:13:57 -0500
[email protected] wrote:

> Haven't tested this, but it could be a start...
> 
>                 final RenderedDynamicImageResource rd = new 
> RenderedDynamicImageResource(100, 100) {
>  
>                         @Override
>                         protected boolean render(Graphics2D graphics)
> { return false;
>                         }

That was my idea before I came up with my NonCaching...Resource.
However, the return value of render(Graphics2D) is used to indicate the
requirement to immediately re-render due to a change in image
dimensions. Simply returning false would throw render() into an infinite
loop:

[RenderedDynamicImageResource]
protected byte[] render()
{
 while (true)
  {
   final BufferedImage image = new
     BufferedImage(getWidth(), getHeight(), getType());
   if (render((Graphics2D)image.getGraphics())) {
     return toImageData(image);
   }
  }
}

Carl-Eric
www.wicketbuch.de

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to