Display Images Dynamically

Hai
I am new to Jdeveloper. I have a task to display images dynamically.
<img src="file:///Z:/Image/sample.bmp "
alt="images" />
i am using mysql database.i am getting the path from database.
Now i want to pass the path of the image file.how can i do it
If anybody knows please tell me
thanks
raju

Hi,
Assuming that your technology is ADF/JSF .... you only need to create a binding for the image source attribute and then use an af:objectImage tag to display the image. You could use for example something like this :
<af:objectImage source="#{bindings.ImageSource.inputValue}"/>Just remember that in order for the image to display correctly, the path from the database has to be relative to your web root.
Thanassis

Similar Messages

  • Proble displaying images dynamically in jsp

    Hi, I am new here. I have to display the images dynamically reading from a database. I have no problem displaying images. When i try to reduce the width in img tag then it is slowly rendering it. How to overcome this.
    <img src="image.jsp?imgID=112" width="150" heigth="130" border="0">
    I am also giving the sample jsp to display
         byte [] imgData = blob.getBytes(1,(int)blob.length());
    response.setContentType("image/jpeg");
    OutputStream o = response.getOutputStream();
    o.write(imgData);
    I want to display the image without any time taken. How could I solve this. Please Help me.
    Thanks.
    Phani.

    You should not crosspost questions. It is rude and a waste of our time.
    Please stick to one topic: [http://forums.sun.com/thread.jspa?threadID=5372144].

  • Displaying image dynamically

    Hi,
    i am getting data from backend sys its working fine.
    when eve we r give input like material number like 1, 2, ....... then then press button it shows data and IMAGE also
    here i have taken images 1.jpg, 2.jpg, .......... workspace -
    > mimes-----> comp.............
    i am setting source of that image prop like 1.jpg here
    when i give input   1   and click button it display r/3data and image but it is used for that only. if i want to display 2  then i change image prop source (here material number is 1 and image is 1.jpg.........depends up on material num can we write code here)
    i want to display it dynamically (depends upon material num it can show the data and image)
    can any one help
    Regards
    bhanu

    Hi Nikhil,
    i am explaining about my thread clearly
    i have taken 1.jpg, 2.jpg, 3.jpg....... images in workspace ..mimes ... components ... packageee
    now take button and image with  visible prop
    In  init() method i have take instance,bind for backend data
    setting visible prop none(image)
    In onaction()
    have taken execute,invalidate in try catch
    setting visible prop is visible(image)
    when i give material no  1  then it can display output  data and image
    if i want to display material no 2 data
    when i give  material no 2 then it can display output data  but image is 1.jpg  b'coz  i set source of image porp as 1.jpg
    the above posted code i have taken in onaction button().
    through hard coding i can display it individually but i want to display it dynamically  likee
    when we give material no 1 it can display 1's data and image 
    when we give material no 2 it must  display 2's data and image
    can u explain me clearly if possible with step by step.
    sorry for the late reply
    Regards,
    bhanu.

  • Display Images dynamically on a servlet

    I saw postings earlier on this topic and adopted the suggestions given , but I can display only a single image.This works for a single image jpg .All the files uploaded are
    into c:\temp. The Servlet program parses through the dir and picks up
    only jpg's (since I want to display all jpg's first and then expand to
    gif's).The servlet now displays only an icon but no images .
    I initially brought all the images in to a ArrayList but I thought its
    better to display directly from the filesystem.
    Please let me know what is the problem
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    import com.sun.image.codec.jpeg.* ;
    * @author
    public class DisplayImage extends HttpServlet
    java.util.List aList = new ArrayList();
    public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException
    String path= "c:\\temp\\";
    File f = new File(path);
    String[] dirList = f.list();
    int l=100;
    int k=100;
    response.setContentType("image/jpeg");
    OutputStream out = response.getOutputStream();
    PrintWriter out = response.getWriter();
    for( int i = 0; i < dirList.length; ++i )
    String fExt= "jpg";
    // System.out.println(">>The files in the dir are>>:"+dirList[i] );
    String filename = dirList.toString();
    // System.out.println("FileName is"+filename);
    int sLength = filename.length();
    int sLastIndex = filename.lastIndexOf(".",sLength);
    //System.out.println(">>Last Index Value>>"+sLastIndex);
    String imageExt = filename.substring(sLastIndex+1,sLength);
    //System.out.println(">>ImageExtensionis>>"+imageExt);
    if(imageExt.equalsIgnoreCase(fExt))
    String imagefilename = path+filename;
    //System.out.println(">>Final filename is>> "+imagefilename);
    Image myImage = new ImageIcon(imagefilename).getImage();
    BufferedImage outImage = new BufferedImage(10,10 ,BufferedImage.TYPE_INT_RGB);
    Graphics2D d2g = outImage.createGraphics();
    d2g.drawImage(myImage, l, k, null);
    //AffineTransformOp afo = new AffineTransformOp(af,1);
    //BufferedImageFilter bf = new BufferedImageFilter(afo);
    //d2g.drawImage(myImage, null, l,k);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    encoder.encode(outImage);
    k+=100;
    else
    System.out.println(">>Not a jpeg file>>");
    out.close();

    Thanks for the reply.
    What I intend to do is :
    1.Displa.jsp calls a servlet DisplayImage
    2.DisplayImage goes to a known directory in the filesystem and picks up all images.
    3.Display all the images on the servlet at once in thumbnail fashion.
    4.Click on each image to enlarge it.
    So far I am stuck at step 3.
    So how do I proceed about on this problem , do I need to open and close the request in the for loop each time?

  • Display images like in images search engines

    I have a list of images that I want to display like the results in yahoo image and google image search engines.But when i use tha datatable component I can just display one column.And after I want to do something after that the user clicks on an image for example displaying it with real size not in thumbnail mode.
    I also tryed using the image browse widget and the yahoo carousel but I dont know how to hand events and how to know which picture is selected.
    Can you please help me.
    Thanks in advance

    fiedlerm wrote:
    I try to display workspace Image in a HTML Region dynamically.
    The Image Source is stored in a hidden Item filled by an application process.
    Region - Source:Always post code using <tt>\...\</tt> tags.
    <img src="#WORKSPACE_IMAGES#Sunny.gif">
    <br></br>
    &P1_ICON_SRC.
    <br></br>The first "hardcoded" Image was displayed.
    The second "dynamic" Image shows the following Text in the HTML - Region:
    <img src="wwv_flow_file_mgr.get_file?p_security_group_id=7856557026011968186&p_fname=Blizzard.gif"> Hidden page items cannot contain HTML mark-up. Look at the page source. When the item is rendered its value is contained in the hidden <tt>input</tt> element's <tt>value</tt> attribute:
    <input type="hidden" name="p_t01" id="P1_ICON_SRC" value="&lt;img src=&quot;wwv_flow_file_mgr.get_file?p_security_group_id=7856557026011968186&amp;p_fname=Blizzard.gif&quot;&gt;">The value must be properly HTML-escaped like this otherwise the browser would see it as tag soup:
    <input type="hidden" name="p_t01" id="P1_ICON_SRC" value="<img src="wwv_flow_file_mgr.get_file?p_security_group_id=7856557026011968186&p_fname=Blizzard.gif">">What exactly are you trying to achieve?
    Options for displaying images dynamically would include putting the required mark-up in an HTML region, only storing the image URI (or parts of it) in the page item, and referencing this using static text substitution. Others would be custom report templates or Dynamic PL/SQL regions.
    If you must store HTML code in session state and access it using static text substitution (not recommended) then use an application item.
    h4. Page Process
    begin
      :P1_ICON_SRC := 'Blizzard.gif'; -- Hidden page item
      :F41327_ICON_SRC2 := '<img src="#WORKSPACE_IMAGES#Blizzard.gif">'; -- Application item;
    end;h4. HTML region source
    <img src="#WORKSPACE_IMAGES#Sunny.gif">
    <br></br>
    <img src="&WORKSPACE_IMAGES.&P1_ICON_SRC.">
    <br></br>
    &F41327_ICON_SRC2.

  • How to display a dynamic image file from url?

    Hey,I want to display a dynamic image file from url in applet.For example,a jpg file which from one video camera server,store one frame pictur for ever.My java file looks like here:
    //PlayJpg.java:
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    public class PlayJpg extends Applet implements Runnable {
    public static void main(String args[]) {
    Frame F=new Frame("My Applet/Application Window");
    F.setSize(480, 240);
    PlayJpg A = new PlayJpg();
    F.add(A);
    A.start(); // Web browser calls start() automatically
    // A.init(); - we skip calling it this time
    // because it contains only Applet specific tasks.
    F.setVisible(true);
    Thread count = null;
    String urlStr = null;
    int sleepTime = 0;
    Image image = null;
    // called only for an applet - unless called explicitely by an appliaction
    public void init() {
                   sleepTime = Integer.parseInt(getParameter("refreshTime"));
              urlStr = getParameter("jpgFile");
    // called only for an applet - unless called explicitely by an appliaction
    public void start() {
    count=(new Thread(this));
    count.start();
    // called only for applet when the browser leaves the web page
    public void stop() {
    count=null;
    public void paint(Graphics g) {
    try{
    URL location=new URL(urlStr);
    image = getToolkit().getImage(location);
    }catch (MalformedURLException mue) {
                   showStatus (mue.toString());
              }catch(Exception e){
              System.out.println("Sorry. System Caught Exception in paint().");
              System.out.println("e.getMessage():" + e.getMessage());
              System.out.println("e.toString():" + e.toString());
              System.out.println("e.printStackTrace():" );
              e.printStackTrace();
    if (image!=null) g.drawImage(image,1,1,320,240,this);
    // called each time the display needs to be repainted
    public void run() {
    while (count==Thread.currentThread()) {
    try {
    Thread.currentThread().sleep(sleepTime*1000);
    } catch(Exception e) {}
    repaint(); // forces update of the screen
    // end of PlayJpg.java
    My Html file looks like here:
    <html>
    <applet code="PlayJpg.class" width=320 height=240>
    <param name=jpgFile value="http://Localhost/playjpg/snapshot0.jpg">
    <param name=refreshTime value="1">
    </applet>
    </html>
    I only get the first frame picture for ever by my html.But the jpg file is dynamic.
    Why?
    Can you help me?
    Thanks.
    Joe

    Hi,
    Add this line inside your run() method, right before your call to repaint():
    if (image != null) {image.flush();}Hope this helps,
    Kurt.

  • Not able to display a dynamic image

    I'm not able to display a dynamic image on Adobe print form.
    Here is what I did.
    Please let me know what I need to do to get this working...
    1. Created a Graphics node in the Context of the Adobe form.
    2. In the URL tab of the graphics node defined the following two lines:
         <URL pointing to the MIME repository folder>
         IM_FILENAME_1
         Where IM_FILENAME_1 is being passed to the Adobeform function module.
    3. In the Layout mode, dragged and dropped the Graphics node from the
        contenxt tab to the form layout. On doing so it appears as a image field in the form layout.
    4. Activated the form.
    BUT, when I run the form , the image is not showing up.
    The idea is to pass the image file name to the form so that it will show up a dynamic image at run time.
    PLEASE HELP.

    Hi Atul,
    Try this, that should work.
    In the interface , define a parameter type string where you will store the URL of the image .
    In the initialization part of the interface , check if the URL is defined, in case it's empty define a default URL . You should put the compelte URL of the image like "http://www.company.org:8080/logo.logo.jpg" .
    Then link this parameter to the Grpahic Node in the URL parameters .
    Let me know if that works

  • Displaying a dynamic image in a jsp

    I am interested in the way of dynamically generating an image in a web browser. The image should be formed on the servlet, more precisely with the aid of a servlet, and reloaded in the web browser every time it suffers modifications (for example, elements are drawn). The drawing and displaying part is already functioning not as a server application, but as a desktop one. The result of the drawing actions are displayed in a Bufferd Image view. What I have to do is to display this image in the browser, encoded as a gif (I already know how to do the encoding part).
    //code from TheServlet.java
    ImageViewPort view = new ImageViewPort(600, 600); // BufferedImage type
    Image image = view;
    g = image.getGraphics();
    response.setContentType("image/gif");
    GifEncoder encoder = new GifEncoder(image, out);
    encoder.encode();
    How would I correctly reference in the HTML form this servlet? In the HTML form I have to display the dynamically created GIF image as a server side image map?
    // code from the HTML form
    <img WIDTH=600 HEIGHT=600 BORDER="2" src="http://localhost:8080/servlet/TheServlet");
    ISMAP/>
    How should be written the source of these image map?

    you can use AJAX for this.. google maps is using ajax for rendering their maps..

  • How to display  servlet dynamically generated image ?

    Hi,
    How to display servlet dynamically generated image ?
    I have a servlet generating a buffered image in the doGet. I want to display the image in a jsp page with other information. I'm not able to get it properly displayed.
    **Try n# 1 **************************************************************
    This displays my image but nothing elle :
    ServletOutputStream sos = pResponse.getOutputStream();
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sos);
    encoder.encode(img);
    **Try n# 2 ****************************************************************
    I tried also :
    In the servlet :
         request.setAttribute("renderedImage", img);
    and in the jsp page :
         BufferedImage image = (BufferedImage) request.getAttribute("renderedImage");
         <img src="<%=ImageIO.write(image,"jpeg",response.getOutputStream())%>" width="300" height="280"/>
    This last try draws big crap in the jsp page, thank you in advance.
    Nelson

    Call another servlet from the IMG tag. Have the servlet stream out the image using ImageIO (instead of writing HTML).

  • Displaying a dynamic image using a PDF file.

    I am trying to find a way to display an image dynamically in my report.  The image happens to be .pdf  I have Crystal Reports  XI and I have the graphic location formula completed "
    10.93.138.250\Production\ProdOut\00\" & {Order_Record.URN_text} + "_p1.pdf" however it tells me PDF is not supported.  Is there a way around this?

    I have to agreed that what you are saying appears to be true from my attempts at getting .pdf files to work dynamically.  Using .bmp and .jpg files seems to work just fine but not .pdf, .xls, or .doc.
    In the Users Guide, in chapter 16, in the section titled "Working with static OLE objects" - it only talks about the picture type formats you mentioned and metafiles.  Later in this section is where it explains how to make a static OLE object dynamic.
    While it doesn't specifically say it won't work for other types - it sure doesn't seem to.  I see no reason why this should be true however!  Certainly Crystal appears to be set up to allow this and the fact that the objects are not images shouldn't matter.  Why is there a picture tab and a conditional formula button next to the graphic location label on the object if it can't be used?
    I'm trying to do something similiar to Carey.  I have maps to customers in a customer list and they are in .pdf files.  The location of the map is stored in the database.  I'm putting together a report of service calls and I want to print the map with each call.  It looks like I'll have to convert several thousand .pdf files to .jpg - that should be fun!
    Any chance this limitation will be eliminated sometime soon...
    Edited by: Randy Walter on Oct 2, 2008 6:40 PM

  • Dynamic display image

    hi, everyone. i have a question on displaying image. for displaying image from a folder, i use:
    <IMG src="/image/me.jpeg" >
    But i can only display one image at one times. Is there ways to display images from folder dynamically?? Thank in advance.

    if u are new to java.. then u may have to go thru some tutorials on servlets to get ur required job done. here are a list of online tutorials
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets.html
    http://www.novocode.com/doc/servlet-essentials/
    http://www.acknowledge.co.uk/java/tutorial/servlet_tutorial/
    hope these will be useful for u.. u may have to spend some time on these...

  • How to add Image dynamically in Webdynpro ABAP

    Hi Experts,
    How to add Image dynamically in Webdynpro ABAP.
    My requirement is i maintain all the images in a table.
    image source has to pick the table URl dynamically and display.
    is that possible in webdynpro?
    and also please give the suggesion,
    without using MIME objects is that anyway to get images?
    Thanks in advance.
    Regrads,
    Jeyanthi

    Hi,
      are those icons wou want to display then. he following code will be useful.
    data : lo_IMG type ref to CL_WD_IMAGE.
    LO_IMG = cl_wd_IMAGE=>new_IMAGE( id = img_id SOURCE = 'ICON_BW_APD_TARGET' tooltip = sts_tltp ).
    lo_cont->add_child( the_child = lo_img ).
    here lo_cont is the container where you want to add the image dynamically and source is the attribiute through which you can change the ICON image. this thing you can getit from data base table and change accordingly.
    Regards,
    Anil kumar G

  • How to display images on local disk(outside of WebContent of WAR) in jsp?

    In a web application, I want to display images on local disk(outside of WebContent of WAR) in jsp. I couldn't put it in "WebContent/images/" because the images are portraits of users and they could be changed dynamically. If I put images in "WebContent/images/", I have to transfer the images back and forth every time when I update my WAR file.
    Obviously, in jsp, something like
    "<img src="/home/username/images/local/PRTR.jpg" />"
    doesn't work.
    Is it durable to store the images at somewhere else like "/home/username/images/local/" in the server's local disk?

    Hi aiGrace,
    You have to transform your file path into the appropriate URL, this way :
    try {
        File file = new File("D:/Test/MyPic.jpg");
        System.out.println(file.toURI().toURL());
    } catch (MalformedURLException ex) {
        ex.printStackTrace();
    }Then, you insert the URL in your img tag.

  • Display image on jsp page

    I have to display image on jsp page with some text output. This image is already saved at a location parallel to web-inf and is generated dynamically using a servlet. I have used img tag html to display the image. Other outputs are taking their values from database.
    First problem is that image will be taking time to display in comparision of other outouts from database. I have to refresh the page to get imageon my page.
    Second is that if I save image in a folder parallel to web-inf in my project then it will not be displaying the image.
    Can I use any jsp functionality to display image with other outputs from database. I have used "*include*". but it shows only that image and other outputs.

    Best way is to use a servlet for this.
    <img src="path/to/imageservlet?id=someidentifier">
    <!-- or -->
    <img src="path/to/imageservlet/someidentifier">In the servlet's doGet() just write code which gets an InputStream of the image (either directly generated, or just read from the local disk file system, if necessary with help of ServletContext#getRealPath(), or even from the DB by ResultSet#getBinaryStream()) and writes it to the OutputStream of the response. That's basically all. Don't forget to buffer the streams properly to speedup performance and to save memory.
    You can find here a basic example: [http://balusc.blogspot.com/2007/04/imageservlet.html].

  • How to change the image dynamically depend upon the input parameter

    Hi All
    I have one report running depend upon the Organization specific, I have 15 operating unit and 15 different logo for each operating unit.
    How to change the Logo dynamically depend upon the input passed by the user.
    If I have three or four logo i can add in my layout using if else statement and its works fine but i have more that 10 logos so its no possible to keep these in My RTF Template.
    Is it possible to change the logo according to the input without keeping this in Template.
    I have seen this link but its not working fine
    http://erpschools.com/articles/display-and-change-images-dynamically-in-xml-publisher
    Regards
    Srikkanth.M

    Hi,
    I have not completed fully,so sorry i cant able to share the files, could you please give me some tips and steps to do.
    Without having the logo in RTF if it possible to bring the logo depends on the user input (Ie Operating unit).
    Regards
    Srikkanth

Maybe you are looking for

  • Loose coupling transport  in PI 7.0

    Hi,   We are trying to implemet OTO.I am tring to do a loose coupling transport in PI 7.0 from DEV to QUA.  I have created one workbench request in se09 and have exported my IR object. I can see my exported IR object in IR>Tools>Find transports.  But

  • IPad mini screen not responding.

    Was using my iPad for a short duration and locked the screen. Went back to it about 10-20 min later, and the screen was not responding. Would try to slide the lock screen, press the camera, and nothing would work. I have restarted it multiple times w

  • Ar reserve invoices and returns on account report

    hello i would like to know how to go about finding out my last 10 ar reserve invoices on account (did not receive payment for) and my last 10 returns to on account as well.  your help is greatly appreciated..... thanks in advance

  • IPhoto - Can no longer drag photos from Library to created Albums..

    Up until last week I had no problem dragging photos from my Library to Albums I'd created on the right side. All of a sudden I can no longer drag photos and have to put photos in Albums by clicking on desired photos and creating Album with + button o

  • Database name in MS SQL server 7/2000

    Hi, Folks!! I have a (basic) question regarding connecting up to an MS SQL server. I know the basic syntax of connecting to the server, however, I have not seen any examples on the java.sun.com site that show where you can insert the database name in