Sounds to me like you're somewhat confused. ;-)
Load the image from the classpath into a bufferedimage as you would
outside of Wicket (Foo.class.getResourceAsStream() or whatever it is).
Draw text, etc. on it as you see fit.
Display it with Wicket if you want to via a BufferedDynamicImageResource.

If you don't want the overhead of storing the image in the session,
use a RenderedDynamicImageResource and load the classpath resource
image in the render method.

These things are always a trade-off between having to do the graphics
drawing operations every time you render the page, and keeping the
image hanging around which takes up space. Your choice.

Regards,

Al

2008/8/22 insom <[EMAIL PROTECTED]>:
>
> Sorry, it took me a bit to get back to this problem. Do you mean I can do
> this:
>
>    org.apache.wicket.markup.html.image.Image wicketImage;
>    wicketImage = new Image("img", new ResourceReference(ImageAnchor.class,
> "image.png"));
>
>    RenderedDynamicImageResource wicketImageResource;
>    wicketImageResource = new RenderedDynamicImageResource(1013,1276, "png")
> {
>        protected boolean render(Graphics2D graphics) {
>            graphics.drawString(user.getName(), 443, 215);
>            return true;
>        }
>    };
>    wicketImageResource.render(/* Somehow get wicketImage's Graphics
> attribute in here */);
>
>    add(new Image("theImage", wicketImageResource));
>
> As you can tell, my difficulty is still in how I can grab the Image using
> the ResourceReference and then draw a String onto it. I hope this clarifies
> where I'm having trouble. Thanks again for your help.
>
>
> jwcarman wrote:
>>
>> You can use Graphics2D's drawImage() method can't you?
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Wicket-Image--%3E-Java-Image-tp19034138p19099200.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to