I am new to wicket but have enjoyed it alot so far. I am interested in using Wicket with dynamic images.  I have tried to use the Wicket 1.2.2 examples as a guide on how to use dynamic image resources.  When I run the Wicket 1.2.2 examples on my own machine both the dynamic images on the image example page show up as empty images.  Here is a quick example piece of code. Are there any gothcas about working with dynamic images? 

TestImagePage.java

package com.testimage;
import wicket.markup.html.WebPage;
import wicket.markup.html.image.resource.RenderedDynamicImageResource;
import wicket.markup.html.image.Image;
import java.awt.Graphics2D;


public class TestImagePage extends WebPage {
   
    public TestImagePage() {
       
        add( new Image("cross", new RenderedDynamicImageResource(100, 100)
                {
                    protected boolean render(Graphics2D graphics)
                    {
                        graphics.drawLine( 0, 0, 20, 20 );
                        graphics.drawLine( 0, 20, 20, 0 );
                        return true;
                    }
                }));
       
    }

}

TestImagePage.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
 <html 
      xmlns="http://www.w3.org/1999/xhtml
      xmlns:wicket=" http://wicket.sourceforge.net/
      xml:lang="en" 
      lang="en"> 

    <head>
        <title>Test Dynamic Image</title>
    </head>

    <body>
   
    <img wicket:id="cross"/>

    </body>
   
</html>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to