Re: Dynamically loading image
Hi, I have only tried to load image from URL http://www.yiigo.com/guides/csharp/how-to-download-from-url.shtml with the help of some toolkits. You can also google it and choose one to help you. I hope you success. Good luck. Best regards, Arron - Best Regards, Arron | Image Processing SDK | Next Tomorrow is Another Day. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamically-loading-image-tp3064795p4663375.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dynamically loading image
Thanks for the help guys. I've got it all working correctly now. For other people's future reference. I think this is the page that Igor was referring to which I pretty much copied : https://cwiki.apache.org/WICKET/uploaddownload.html I am retrieving the images from a db as a byte array //heres a simplified version of my code. Hope this helps someone! //this is the class that serves up the images public class ImageResource extends DynamicWebResource { private static final long serialVersionUID = 1L; public ImageResource() { super(); } @Override protected ResourceState getResourceState() { ValueMap params = getParameters(); String id = params.getString(id); if (id.equals(image1)) { //show image 1 return new ResourceState() { @Override public byte[] getData() { //get the image1 from server return image; } @Override public String getContentType() { return image/jpeg; } } } else (id.equals(image2)) { //show image 2 return new ResourceState() { @Override public byte[] getData() { //get the image2 from server return image; } @Override public String getContentType() { return image/jpeg; } } } } } //this is how I access the image from wicket add(new Label(profileImage, ) { private static final long serialVersionUID = 1L; @Override protected void onComponentTag(ComponentTag tag) { ResourceReference imageResource = new ResourceReference(imageResource); tag.put(src, RequestUtils.toAbsolutePath(getRequestCycle().urlFor(imageResource).toString())+?id=image1); super.onComponentTag(tag); } }); //and this needs to be added to the wicket application init method getSharedResources().add(imageResource, new ImageResource()); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamically-loading-image-tp3064795p3068044.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dynamically loading image
Where are you storing the image, on the file system, classpath, database...? From: Matthew Goodson matt...@spidertracks.co.nz To: users@wicket.apache.org Date: 11/29/2010 10:12 PM Subject:Dynamically loading image Hi all, I'm needing to generate the url to an image dynamically on the client. i.e. I want to be able to chuck a generated url (e.g localhost:8080/images?imageId=blah) into the src of an img which would then go off and hit a wicket page which returns the binary data for the image. I'm not really getting anywhere by myself. Does anyone have any pointers?! Hope that makes sense. Thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamically-loading-image-tp3064795p3064795.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Notice: This communication, including any attachments, is intended solely for the use of the individual or entity to which it is addressed. This communication may contain information that is protected from disclosure under State and/or Federal law. Please notify the sender immediately if you have received this communication in error and delete this email from your system. If you are not the intended recipient, you are requested not to disclose, copy, distribute or take any action in reliance on the contents of this information.
Dynamically loading image
Hi all, I'm needing to generate the url to an image dynamically on the client. i.e. I want to be able to chuck a generated url (e.g localhost:8080/images?imageId=blah) into the src of an img which would then go off and hit a wicket page which returns the binary data for the image. I'm not really getting anywhere by myself. Does anyone have any pointers?! Hope that makes sense. Thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamically-loading-image-tp3064795p3064795.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dynamically loading image
there is a wiki page that explains how to serve images...search for it, i think its called uploade/download or something like that. -igor On Mon, Nov 29, 2010 at 7:11 PM, Matthew Goodson matt...@spidertracks.co.nz wrote: Hi all, I'm needing to generate the url to an image dynamically on the client. i.e. I want to be able to chuck a generated url (e.g localhost:8080/images?imageId=blah) into the src of an img which would then go off and hit a wicket page which returns the binary data for the image. I'm not really getting anywhere by myself. Does anyone have any pointers?! Hope that makes sense. Thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamically-loading-image-tp3064795p3064795.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org