How to display a binary image in a webpage?

Hi,
I want to display a binary image in a webage. The image has been stored in a DB as binary format. I am using servlet. How could I retrieve it and display it on a webpage? Could you give me some suggestions?
I have read some metrial about JAI, the method 'createImageEncoder( )', which seems very helpful! I am on the right way, right? Thanks for your any comments!
Best Regards,
Hai

Here is my idea to display the pic on the webpage:
The pic is stored in DB as binary, after retrieving it, the binary data will be converted to JPEG pic. Then, the pic will be saved to the local machine automaticly. After that, I get the pic's SRC, and use html display it.
My code is as follow (not completed), some errors in it.     public static String getPayoffSRC(Services serv, long fileId)
                                                                throws FileNotFoundException,
                                                              DBException,
                                                              DbFileNotFoundException,
                                                          IOException {
        BufferedImage buffy = new BufferedImage(300, 400,
                                                    java.awt.image.BufferedImage.TYPE_INT_RGB);   
        FileOutputStream out = new FileOutputStream(serv.getFileManager().getFileDb(fileId).getFileName());
        JPEGImageEncoder jencoder = JPEGCodec.createJPEGEncoder(out);
        JPEGEncodeParam enParam = jencoder.getDefaultJPEGEncodeParam(buffy);
        enParam.setQuality(1.0F, true);
        jencoder.setJPEGEncodeParam(enParam);
        jencoder.encode(buffy);
        out.close();
        return Pic's SRC,
    }

Similar Messages

  • How to display multiple page images in forms ?

    Hi,
    What is the best method to display multiple pages image(100 pages) in forms 10g?
    Thanks

    Hello,
    <p>this is a link to a tutorial that contains several sample forms.<br> One of them (ALBUM.FMB) demonstrates how to display hundred of images.<br><br>The tutorial is in French, but you can simply download the samples on the introduction chapter</p>Francois

  • How to display multiple thumbnail images in jframe

    hi
    please help me about how to display multiple thumbnail images in jframe

    Multi post:
    http://forum.java.sun.com/thread.jspa?threadID=627253&messageID=3588990

  • How to display multi-channel image in the 'proxy'?

    There're many examples to show how to display composite channels in the 'proxy'. But I don't find any example to show how to display multi-channel image in the 'proxy'. I found that I can use PSPixelOverlay to display alpha channel data like this:
    int nSpotChannel = gChannelCount - 4;
    PSPixelOverlay* overlay = new PSPixelOverlay[nSpotChannel];
    for(int i = 0; i < nSpotChannel; i++){
           if( i != (nSpotChannel - 1) )
                 overlay[i].next = overlay + i + 1;
           else
           overlay[i].next = NULL;
           overlay[i].data = gChannelData + (4 + i) * nPlaneBytes;
           overlay[i].rowBytes = gProxyRect.Width() * gDocDesc->depth / 8;
           overlay[i].colBytes = 1;
           overlay[i].r  = 230;
           overlay[i].g = 161;
           overlay[i].b = 174;
           overlay[i].opacity = 255;
           overlay[i].overlayAlgorithm = kStandardAlphaOverlay;
    pixels.pixelOverlays = overlay;
    Then, Seeing red part, it will trigger a new problem, that is how to get the color value of the alpha channel by plung-in itself? It seems that no channel color value info is in FilterRecord.
    If you have other solution, please tell me. Many thanks!

    This is what I've been doing - was just curious if there was a way to see a more cohesive image.
    If the individual EQ plugins are in fact the answer, is there any way to smooth how the Analyzer displays? The image I posted above, all of the tonal curves are very smooth. The analyzer tool shows a lot of peaks and valleys within the overall curve and it's hard to pinpoint each instrument's "sweet spot." Vocals for example are very hard to spot.
    - Morgan

  • How to display every other images in image indicator

    Hi All,
    I am using IMAQ to grab and save high freq and high resolution images. I have an image indicator directly from "Image Grab Acquire". So, the image indicator is displaying every single images at a very high frequency too. We have to display frames, but not necessarily every single one (enough so the operator can see what's going on). So, I am wondering how I can display, say every other images (such as all odd/even number of images), or jump over two and display the third?
    Any help will be appreciated!
    Thanks!
    Wenlong
    Solved!
    Go to Solution.

    Here are some general comments.
    Image acquisition is "a horse of a different color" -- unlike many other I/O devices, the memory that holds the data (here called the "buffer") is managed by the driver, and isn't directly available to LabVIEW.
    I'm guessing that you are using NI Video hardware, as you are using IMAQ functions (I've only used IMAQdx).  Is this true?  What camera are you using?
    The IMAQ Extract Buffer (probably) "clocks" itself to the camera (I say "probably" because I don't know the hardware you are using).  This means that the While loop containing it will run at the frame rate of the camera (hence you can easily calculate the frame rate, as your code shows).
    This looks like an NI Demo routine, so I'm guessing that you don't have a lot of experience with Vision processing.  If you've got a lot of other LabVIEW experience, you should be able to make the leap to vision, once you get the idea of how buffers work.  Unfortunately, there's not as much in the way of tutorials and white papers on Vision as on other LabVIEW topics.
    So to your question -- how to display every Nth image.  Here's the key loop (which is lifted directly from your code):
    As menioned above, this routine is "clocked" by the Extract Buffer function.  What you do to display every N'th image is to put the Image control inside something like a Case statement that "fires" every Nth time.  
    Here's an "Nth" version of the above loop (some details omitted) --
    We still drive the loop filling every buffer with a frame.  But we then use the Integer Divide function to select the Nth image (those that have a remainder of 0 when i is divided by Nth) and wire the "image" line (it doesn't really hold an image) to the "Image" control, with the other case being "Default" (so all other valeus go there) and with nothing inside.  Thus every Nth time through this loop, the output of Extract Buffer is wire to an Image (and displayed), the other N-1 times the wire goes nowhere.
    Bob Schor

  • How to display a blob image in RTF template's Header.

    Hi,
    I want to display a blob image (logo company) in my RTF template,
    my problem is how i can display this image in the template's Header.
    I tried this
    <?
    <fo:instream-foreign-object content-type="image/jpeg" >
    <xsl:value-of select=".//LOGO"/>
    </fo:instream-foreign-object>
    ?>
    but was unsuccessful
    Thanks in advance.

    I tried this
    <?
    <fo:instream-foreign-object content-type="image/jpeg" >
    <xsl:value-of select=".//LOGO"/>
    </fo:instream-foreign-object>
    ?>
    but was unsuccessful
    sure
    what is red elements ?
    you template can be looks like
    ..... some data .....
    ( after  all data )
    <?template:footer_logo?>
    <fo:instream-foreign-object content-type="image/jpeg" ><xsl:value-of select=".//LOGO"/></fo:instream-foreign-object> (as field )
    <?end template?>
    <?call-template:footer_logo?> ( in header/footer )
    some remarks https://oralublog.wordpress.com/2014/10/04/bi-publisher-11g-footers-and-headers-in-rtf-template/

  • How to display a BLOB (Image) in a EBS Report?

    User requested to add a Logo image to a report which is called from E-Business Suite (EBS).
    The image is currently stores in a BLOB column.
    How can I make the image to display on the report?
    Thanks!

    I was trying to use the BLOB and display the image in a report.
    Per your suggestion:
    "Select the column in your query.
    Create an item in the layout editor and set the source to this column.
    Set File Format to Image."
    My question was I dont know how to "set the source to this column" as you described above.
    So, to work around it, I moved the image file phyically to the UNIX file system.
    Then, created an item in the layout editor which required a valid "image file path" the property palette.
    Since, the report was created under windows, it did not validate with UNIX file path.
    That's why i need to perform extra steps to get the file path correct to work in UNIX.
    EDIT:
    I guess when you said "set the source to this column", you mean to map the "Field source" attribute in the property palette to the database column from query.
    But depends on what item you want me to create (I created a "Link File" item) and it does not have the "Field source" attribute available to map to a database column.
    Edited by: user595907 on Sep 21, 2009 9:47 AM
    Edited by: user595907 on Sep 21, 2009 9:54 AM

  • How to display an animated image of any sort in centre of screen

    Hi,
    Would really appreciate some help on how to present the user with a animated image in the centre of the screen whilst a user is waiting for a operation to load/complete.
    I basically have a situation where a user presses a button to load a CSV file and during this operation, want to display this animated image and then remove it on completion.
    Thanks.
    Tony.

    Hi Tony,
    Is this the kind of thing you are looking for?
    Re: Displaying 'please wait' graphic during long running process
    Regards
    Paul

  • RoboHelp 8 HTML WebHelp How to display a larger image of a thumbnail by clicking on or rolling over the thumbnail?

    How would you display a larger image of a thumbnail by clicking or rolling over the thumbnail?

    Hi there
    For a mouseover you would have to add some custom developed JavaScript. You could probably find some pre-made on the web if you poked around.
    Generally speaking, any way you slice it you will be using two images. One for the thumbnail and one for the full sized image. You could employ the popup functionalty to pop up the larger image.
    I used to simply create DHTML drop-downs and insert the large images in the drop-down area.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • 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.

  • How to display a static Image in a region (Not From Database)

    Hi
    How can I display a company logo in a region? Not from any database.
    If we can display a static company logo in a region then where Do I have to place this Company Image (Which Directory or is there any location I have to place this company logo).
    Regards
    Kiran Akkiraju

    Scott
    Thanks for reply.
    I have gone through the link and as per the link
    navigate to the Application Builder for your application.
    click on the Shared Components icon
    click the Images icon
    click Create to upload a new image
    click Browse... to locate an image on your local filesystem
    make sure you remember the name of the image, for example: my_logo.gif
    When I click on Application Builder I am not able to see shared Components.
    I am able to see a Shared Components in a page definiton only.
    Could you please let me know where Can I find this Shared components option.
    Regards
    Kiran Akkiraju

  • How to display List and Image on Single Screen?

    Hi Friends,
    I wanna display Image and List on single screen.
    Its not possible using Form which will contain both. either I can list or form which contain image as far I know.
    I have seen one J2ME application which contain Image and below that there is list. Can anybody tell me how?
    Thanks,
    Rohan Chandane

    Hi,
    Are you able to put a list and image into a form.
    If so plz let me know the method to do tht.
    thanks.

  • How to display 16 bit image in VBAI custom inspection interface?

    I'm working with 16 bit grey scale images in VBAI. In configuration mode, there is an option on how to handle 16 bit display mapping, and it works very well to preview the effect of the different display possibilities. However, those settings do not carry over into inspection mode. In the custom inspection interface, if I right click on the image display area it also has an option for 16 bit image mapping, with a default value of "Full Dynamic". It allows me to choose something else, but if I save the custom interface and reopen it, the value always reverts back to "Full Dynamic" For the time being, I've worked around it by adding a vision assistant step to convert the 16 bit image to 8 bit, but I would really prefer to take this step out. Are there any tricks to getting the image mapping setting to work properly within the custom interface? Thanks, Jason

    I would not expect that to happen. I will investigate. In the mean time if you have LabVIEW you can export the custom ui and edit the block diagram in LabVIEW. Then you can add a property node for the image display control to set the 16 bit display mapping when the vi runs. Make sure to reimport this updated ui and edit the step that updates the custom ui to run the code when the step executes. I'll let you know what I find out about why it reverts when you try to set it from the editor in VBAI.
    Thanks
    Brad

  • How to display 2 PNP image in one screen

    Hi,
    I want to divide the screen of 7970 to 2 parts, one to display PNP picture1, and another to display PNP picture2.
    How can I do? or IP Phone can not support this kind of operation.
    Thanks.
    Yours.
    Hankers

    The phone can only display one image in it's display area at a time. However, you can programmatically combine two images into one and send the one to the phone. In Java this is a relatively simple thing to do. In fact, I did it with my screen saver (idle timeout) app that displays weather info as a single image. It gets an icon and other text info and creates a single image, assembled from the icon and the text, and sends it to the phone. Are you a Java coder?

  • How to display number of images per album?

    I have forgotten how to have albums display the number of images within each.

    Note that with a large library this can cause slow to poor preformance - if your speed slows down after turning item count on consider turning it back off
    LN

Maybe you are looking for

  • Music won't download from itunes to iphone

    Hiya, I have purchased music from Itunes App on my iPhone (4S with iOS7 update) and now it won't download to my music without being connected to the computer.  There are no restrictions to my data usage, iCloud is correctly signed in.  I have no trou

  • Logon failed. Detail [Database Vendor Code: 1005]

    The application make use of ODBC to connect to Oracle database The way the reports are produced in the current VB application is by using the following line of codes cryQueryReport.Connect = ObjAdoConnection.sADOconnectstr cryQueryReport..SQLQuery = 

  • SCCM Reports won't populate from console

    Hello, When on a remote device, I'm unable to get the reports tab to populate nor can I reach out to the reports ssrs site without getting a prompt (endless). I know I have rights because I'm unable to replicate these issues on the SCCM server. Anyon

  • Scaling text, pictures etc. when changing document format in InDesign

    Hi, I am making an example of a cookbook layout in InDesign. This is my first time working with the software and I made the document in a totally wrong format. I made a document in 200 x 260 cm, when I was suppose to make it in 200 x 260 mm (duhh). S

  • Coldfusion Creating Random SQL Queries

    Here is an error I received from one of our sites: Syntax error or access violation: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE user_id = '19152' AND pa