PDA

View Full Version : Display image to Ext Panel



Prabhjot
13 Feb 2011, 8:50 PM
I am trying to do one task where i have to generate image dynamically depending on the contents selected by the user from the webpage. Currently i am able to generate the image. This is being done in Java on the server side (Tomcat). I have an instance of "BufferedImage" that stores the image in memory. I am writing this down to a ".png" file and from my Ext JS Panel i specify the path where that image is being stored..something like this

var panel = new Ext.Panel({
.....
html: '<img src="Path to me image file" />'
});

This works fine.

However, i don't want to write down the BufferedImage to a file. Instead i want to give the Ext panel a buffered image or an instance of Graphics and get the panel to display the image. Please let me know if there is a way to do this. Thanks in advance.

steffenk
14 Feb 2011, 1:23 AM
you can write rawdata in src tag.

Prabhjot
14 Feb 2011, 12:08 PM
Could you please explain in bit more detail. I am quite new to Ext..Thanks

steffenk
14 Feb 2011, 12:43 PM
it's nothing Ext specific, just an image
<img src="url_to_your_server_streaming_the_imagedata" />