Size of a displayed image in memory

Hello,
I am interested in controlling the memory usage of an application. The application loads and displays images from files (mostly GIFs). I'd like to prevent an image from being displayed if it would occupy more memory than some preset limit. Is there a way of determining how much memory a displayed Image object would take before it is created and displayed?
Thanks in advance,
Misha

True. But Gifs are for outdated weirdos ;o)
It gets a bit complicated. Typically, screen memory will use 4-byte buffers. Non-'true'-color file formats often don't. You can store an image in various forms: typically either compatible with the file format or compatible with the screen. If you want to use an image for rendering then it should be in a screen-compatible form, otherwise rendering will be very slow. However, an image in a reduced bit depth does occupy less heap space. So if we're talking about "displayed images" then we should probably be reckoning on 32bpp images, for desktop use at least.
One thing I'm not 100% sure about is whether Toolkit produces a file- or screen-compatible image by default. And I would assume that it would be perfectly possible to implement an ImageReader which always produced 32bpp images regardless of the file bpp.

Similar Messages

  • Change image size in web display of SRM MDM 3.0

    Hello,
    how can I change the size of the displayed images in the catalog?
    I would like to display the image in the detail of the material data in the catalog larger.
    The images are stored in in the repository.
    Thanks for your help.
    melanie

    You can change this in the Web UI interface. In the Customize Display tab you can specify the size of you images to be displayed in pixel.
    The UI interface that I'm talking about is where you change your OCI mapping, Search... etc
    If you want to crop, resize your uploaded images you can do this in MDM Data manager.
    Edited by: Joy Natividad on Mar 3, 2010 7:08 PM

  • Recommended image size and dimensions for images displayed on iPad retina?

    What are the recommended dpi image size and dimensions for images designed in DPS app as displayed on an iPad retina?

    Take a look at the following link:
    http://blogs.adobe.com/indesigndocs/2012/03/guidelines-for-creating-folios-for-ipad-3.html

  • How to set a uniform display size of multiple intermedia image types - wher

    I have read "If you want to limit the size of the file that can be uploaded, you can do this as a post generation
    step, by adding the maxFileSize property to the <controller> element in the struts-config:
    This does not address how to limit the *** display size *** where you have multiple intermedia image types - where the original size is not uniform.
    If an image is uploaded where the true image display size is 1024 x 768 - it will display that way in the table/table-form. This will create un-even display size's where previous images sizes where different 384 x 384 and so on.
    Is there a way to encode the display size so that *** ALL *** images regardless of their true size are displayed uniformly at least on one dimension (64 x ???)? This is possible when using products such as Dreamweaver or Flash.
    BTW - JHS/***JDev*** synergy is truely magnificient!!! Way-To-Go Oracle!!!!!!!!!!! Keep it up!!!!
    BG...

    Bill,
    I did some tests, and was able to reproduce it. The problem is that JHeadstart distinguishes between display types fileDownload and image, but UIX uses the same <media> tag to handle both display types. It will look at runtime whether it must render a hyperlink to download the document, or to render it right away as an image.
    To get all images the same size, you can set the display width and height, AND the display type must be set to image.
    However, to get the file name used as download link, you must set the FileName attribute AND the display type must be set to "fileDownload" ..
    So, to solve your problem, it is easiest to set the displayType to "fileDownload" and set the width and height properties post-generation in the generated UIX page.
    In the next release of Jheadstart, we will fix this, and always pick up width, height and fileName settings regardless of the display type.
    Note that you should also set the FileName property against the attribute you are using to upload the file.
    Steven Davelaar,
    JHeadstart Team.

  • How to decode a set of datas received from serial port and display image on a canvas based on CVI ?

    Hi !
    I have received a set of datas via rs232 and it contains picture messages. I have to decode the datas first and then display them on a canvas.
    I have known several functions that may be used . Such as
    int SetBitmapData (int bitmapID, int bytesPerRow, int pixelDepth, int colorTable[], unsigned char bits[], unsigned char mask[]);
    int CanvasDrawBitmap (int panelHandle, int controlID, int bitmapID, Rect sourceRectangle, Rect destinationRectangle);
     However,I don't know how to set the following parameters according to the actual pixel values and color values.
    int bytesPerRow, int pixelDepth, int colorTable[], unsigned char bits[], unsigned char mask[]
     What's more,I have no idea how to decode the datas.
    The  attachment is a incomplete project. I will be very appreciated if anyone could help me .
    Best regards.
    xiepei
    I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance.
    Attachments:
    Decode and display image.zip ‏212 KB

    Well, things are getting a bit clearer now.
    1. Your image is actually 240x240 pixel (not 320x240 as you told before). The size of image data is 57600 bytes which corresponds to that frmat (I was puzzled by such a data size compared with larger image dimensions!)
    2. The image is a 8-bits-per-pixel one; this means that you must provide a color palette to create the bitmap
    3. You cannot simply copy image data into bitmap fields in CVI: CreateBitmap always produce an image with pixeldepth matched with display colour depth (normally 24 or 32 bpp)
    All that means that you must:
    1. Create the appropriate color palette with 256 colors: it may be a grayscale or color palette depending on camera characteristics. Grayscale palette can be found in my sample project, while sample colour palettes can be found here (here the description of a "standard" 8-bpp color palette)
    2. Create the bits array correctly dimensioned for the color depth of your monitor
    3. Get each pixel value from the camera, lookup in the color palette for the appropriate colour and create the RGB informations into the bits array in memory
    4. Display the bitmap on the canvas
    As a first step, I would configure my system for 256-color display setting, create a bitmap and simply copy image data into it: you should be able to get the correct image back to your screen.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Lightroom 2.1 will not display images.

    I use previous versions of Lightroom 1.3, 1.4, 2 Beta and they work fine. Now I upgraded to Lightroom 2.1 and Masters Collection CS4 and Lightroom 2.1 will not display images. All the images I import are just a shade of gray.
    When I adjust the parameters of the image the histogram is changing but the image is blank.
    I have a Vista machine.
    Thank you

    I have a Vista Home Premium, I am on Vista X86 and I just installed LR 1.4 and is working. Also LR2 Beta was working.
    So on the same Vista X86 machine LR 1.4 is working LR 2.1 is not displaying the images.
    This is the sysinfo:
    Lightroom version: 2.1 [512205]
    Operating system: Windows Vista Home Edition Service Pack 1 (Build 6001)
    Version: 6.0 [6001]
    Application architecture: x86
    System architecture: x86
    Physical processor count: 4
    Processor speed: 2.4 GHz
    Built-in memory: 3069.7 MB
    Real memory available to Lightroom: 716.8 MB
    Real memory used by Lightroom: 99.9 MB (13.9%)
    Virtual memory used by Lightroom: 75.2 MB
    Memory cache size: 65.9 MB
    Serial Number: 116040017170941123477699
    Application folder: C:\Program Files\Adobe\Adobe Photoshop Lightroom 2
    Library Path: C:\Users\Alex\Pictures\Lightroom\Lightroom 2 Catalog.lrcat

  • How to display images and information

    how to display images and information(e.g. like questions) on a jsp page that stored in a database

    Look As far as i can see....
    Utlimately every file could be expressed as a bytes buffer.
    so say if you have a bean called Choice Bean which is expressed as
    public class ChoiceBean{
       private String choiceid;
       private String choicedesc;
       private byte image[];
       public void setChoiceId(String choiceid){
              this.choiceid = choiceid;
        public String getChoiceId(){
               return this.choiceid;
          public void setChoiceDesc(String choicedesc){
               this.choicedesc = choicedesc;
           public String getChoiceDesc(){
               return this.choicedesc;
           public void setImage(byte image[]){
                  this.image = image;
             public byte[] getImage(){
                  return this.image;
    }QuestionList.java:
    ===============
    public class QuestionList{
         private List<ChoiceBean> choicelist;
          /*Other member variable declarations*/
           public  List<ChoiceBean> getChoiceList(){
                    /*Custom code where you may build the list by querying the DA layer*/
                     return this.choicelist;
         public int search(String choiceid){
                 int index = -1;
                 for(int i =0 ; i < this.choicelist.size() ; i++){
                        ChoiceBean cb = this.choicelist.get(i);
                         if(cb.getChoiceId().equals(choiceid)){
                                index = i;
                                break;
                 return index;
        /* Other member method declarations */
    }and you are retreving List<ChoiceBean> from DB using your query & have created a session attribute / <jsp:useBean> named ChoiceList
    NOTE: sometimes your application server can go out of bounds as you are consuming a lot of memory by creating an arraylist object.
    use the following methodology to display images & choices
    sample.jsp:
    =========
    <jsp:useBean id="QuestionList"  class="com.qpa.dao.QuestionList" scope="session"/>
    <TABLE>
    <%
    /* QuestionList.getChoiceList() is a method which fetches data from the DB & returns it in form of  List<ChoiceBean> */
    List<ChoiceBean> choicelist = QuestionList.getChoiceList();
    for(int i =0 ; i < choicelist.size() ; i++){
    %>
    <TR>
    <TD><%!=choicelist.get(i).getChoiceId()%></TD>
    <!-- calling servlet which renders an images in JPG format based upon given choiceid(unique field) -->
    <TD><IMAGE src="ImageServlet?choiceid=<%!=choicelist.get(i).getChoiceId()%>"/> </TD>
    <TD><%!=choicelist.get(i).getChoiceDesc()%></TD>
    </TR>
    <%
    %>
    </TABLE>
    <%
        session.remove("QuestionList");
    %>
    NOTE: usage of JSTL or any other custom built tag-libraries makes life more simpler in the following case
    ImageServlet.java:
    ===============
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            byte buffer[] = null;
            HttpSession session = request.getSession(false);
            /*getting the QuestionList from the session*/
            QuestionList ql = null;
            String choiceid = new String("");
            try{
                 choiceid = request.getParameter("choiceid");
                 /*getting the QuestionList from the session*/
                ql = (QuestionList)  session.getAttribute("QuestionList");
            } catch(Exception exp){
            if(choiceid.equals("") == false &&  ql != null ){
                List<ChoiceBean> clist = QuestionList.getChoiceList();           
                   assuming that you have created a serach method which searches the entire choice list and would give you
                   the index of that object which is being refered by unique choiceid and returns -1 if not found
                int index =  QuestionList.search(choiceid);
                if(index != -1){
                   ChoiceBean cb = clist.get(index);
                   buffer = cb.getImage();
            if(buffer != null){
                 // assuming that we have stored images in JPEG format only
                 JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(new ByteArrayInputStream(buffer));
                 BufferedImage image =decoder.decodeAsBufferedImage();
                 response.setContentType("image/jpeg");
                 // Send back image
                 ServletOutputStream sos = response.getOutputStream();
                 JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sos);
                 encoder.encode(image);
            } else {
               response.setContentType("text/html");
               response.getWriter().println("<b>Image data not found</b>");              
    }However,i still feel there are few loopholes with this approach where Application Server can eat up a lot of heap space which may result in outofmemorybound exception.
    Hope this might help :)
    REGARDS,
    RaHuL

  • QuickPreview and Preview won't display images

    OK.  We're on a MacPro 5,1 and have been running mountain lion for a week or two now with no issues.  all of a sudden, preview has stopped displaying images when you open them.  The finder window, when in column view, will not display the preview, and hitting spacebar to go into QuickView will just open a blank white screen in the size of the image. Image icons for the pgs do display. Interestingly enough, Screen sharing also is displaying blank white screens. 
    The system config is below:
      Model Name:          Mac Pro
      Model Identifier:          MacPro5,1
      Processor Name:          Quad-Core Intel Xeon
      Processor Speed:          2.8 GHz
      Number of Processors:          1
      Total Number of Cores:          4
      L2 Cache (per Core):          256 KB
      L3 Cache:          8 MB
      Memory:          8 GB
      Processor Interconnect Speed:          4.8 GT/s
      Boot ROM Version:          MP51.007F.B03
      SMC Version (system):          1.39f11
      SMC Version (processor tray):          1.39f11
      Serial Number (system): 
      Serial Number (processor tray):      
      Hardware UUID:          DCB72D90-0983-55C8-AD71-E92CCFD886E4
    We have 2 x ATI Radeon HD 5770 video cards running a total of 3 displays (2 at 1024x768, 1 at 1280 x 1024)
    Any suggestions as to what's gone wrong?

    Try deleting the Finder .plists.
    You need to look in your user Library/Preferences for the .plist. Hold down the option key while using the Finder "Go To Folder" command. Enter ~`/Library. Delete the .plist(s) for the application or move them to your desktop so you can put them back. Since there are several .plists, you may want to try them one at a time You'll need to Force quit Finder to get it to relaunch (command - option- esc).
    If you prefer to make your user library permanently visible, use the Terminal command found below.
    http://osxdaily.com/2011/07/04/show-library-directory-in-mac-os-x-lion/
    You might want to bookmark the command. I had to use it again after I installed 10.8.2. I have also been informed that if you drag the user library to Finder it will remain visible.

  • Open and display image in MVC layout

    Hello!
    I cant figure out how I shall do this in an MVC layout:
    The program request user to open an image file that are then displayed in a JLabel
    My setup at the moment resolve in a nullpointerexeption because it dont get any actual image file, but I dont understand what I have missed.
    I can not post the whole code fo you to run because it is to big, so I post the part that are the most important. please have a look.
    PicturePanel
    //Import Java library
    import javax.swing.*;
    import java.awt.*;
    public class PicturePanel extends JPanel {
         //Variables
         private ImageIcon picture;
         //Method to get information of the selected file
         PicturePanel (String fileName) {
              picture = new ImageIcon (fileName); //Get the filename
              int w = picture.getIconWidth(); //Get the image with
              int h = picture.getIconHeight(); //Get the image height
              //Set preferable size for the image (Use the properties for the selected image)
              setPreferredSize(new Dimension(w, h));
              setMinimumSize(new Dimension(w, h));
              setMaximumSize(new Dimension(w, h));
         //Method to draw the selected image
         protected void paintComponent(Graphics g) {
              super.paintComponent(g); //We invoke super in order to: Paint the background, do custom painting.
              g.drawImage(picture.getImage(), 0, 0, this); //Draw the image at its natural state
    }From my model:
    //Local attributes
         boolean check = false; //Used to see if a statement is true or not
         PicturePanel pp;
         JFileChooser fc;
         int returnVal;
    //newFile in File menu
         public void newFile() {
              //Open a file dialog in users home catalog
              fc = new JFileChooser();
              //In response to a button click:
              returnVal = fc.showOpenDialog(pp);
              System.out.println("You pressed new in file menu");
         }From my controler:
    //User press "New" in File menu
              else if (user_action.equals("New")) {
                   //Call method in model class
                   model.newFile();
                   //Update changes
                   if (model.returnVal == JFileChooser.APPROVE_OPTION) {
                        System.out.println("Hello1");
                        File f = model.fc.getSelectedFile();
                        if (model.pp != null)     
                             model.pp = new PicturePanel(f.getAbsolutePath());
                        System.out.println("Hello2");
                        //Display image (Here is line 83)
                        view.setImage_DisplayArea(model.pp);
                        System.out.println("Hello3");
              }From my view:
    //Sets the image to be displayed on the image_display area (Here is line 302)
         public void setImage_DisplayArea(PicturePanel pp) {
              image_display.add(pp);
         }The complet error:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
         at java.awt.Container.addImpl(Container.java:1015)You pressed new in file menu
    Hello1
    Hello2
         at java.awt.Container.add(Container.java:351)
         at View_Inlupp2.setImage_DisplayArea(View_Inlupp2.java:302)
         at Control_Inlupp2.actionPerformed(Control_Inlupp2.java:83)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:334)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1050)
         at apple.laf.CUIAquaMenuItem.doClick(CUIAquaMenuItem.java:119)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1091)
         at java.awt.Component.processMouseEvent(Component.java:5602)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3129)
         at java.awt.Component.processEvent(Component.java:5367)
         at java.awt.Container.processEvent(Container.java:2010)
         at java.awt.Component.dispatchEventImpl(Component.java:4068)
         at java.awt.Container.dispatchEventImpl(Container.java:2068)
         at java.awt.Component.dispatchEvent(Component.java:3903)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
         at java.awt.Container.dispatchEventImpl(Container.java:2054)
         at java.awt.Window.dispatchEventImpl(Window.java:1801)
         at java.awt.Component.dispatchEvent(Component.java:3903)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)Edited by: onslow77 on Dec 16, 2009 5:00 PM
    Edited by: onslow77 on Dec 16, 2009 5:04 PM

    Hello again!
    Anyone that can help me figure out how to implement this in an MVC layout, I feel stuck.
    I post a little program that open and display an image file so that you better can understand what I whant to do.
    ShowImage
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.File;
    import javax.swing.filechooser.*;
    public class ShowImage extends JFrame{
         //Variables
         JFileChooser fc = new JFileChooser();
         PicturePanel pp = null;
         ShowImage () {
              super("Show"); //Title
              //Create the GUI
              JPanel top = new JPanel();
              add(top, BorderLayout.NORTH);
              JButton openBtn = new JButton("Open");
              top.add(openBtn);
              openBtn.addActionListener(new Listner());
              //Settings for the GUI
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              pack();
              setVisible(true);
         class Listner implements ActionListener {
              public void actionPerformed(ActionEvent ave) {
                   int answer = fc.showOpenDialog(ShowImage.this);
                   if (answer == JFileChooser.APPROVE_OPTION){
                        File f = fc.getSelectedFile();
                        //Check
                        System.out.println(f);
                        System.out.println(pp);
                        if (pp != null)
                             remove(pp); //Clean so that we can open another image
                        //Check
                        System.out.println(pp);
                        //Set the PicturePanel
                        pp = new PicturePanel(f.getAbsolutePath());
                        //Check
                        System.out.println(pp);
                        //Add PicturePanel to frame
                        add(pp, BorderLayout.CENTER);
                        validate();
                        pack();
                        repaint();
         //Main
         public static void main(String[] args) {
              new ShowImage();
    }PicturePanel
    //Import Java library
    import javax.swing.*;
    import java.awt.*;
    public class PicturePanel extends JPanel {
         //Variables
         private ImageIcon picture;
         //Method to get information of the selected file
         PicturePanel (String fileName) {
              picture = new ImageIcon (fileName); //Get the filename
              int w = picture.getIconWidth(); //Get the image with
              int h = picture.getIconHeight(); //Get the image height
              //Set preferable size for the image (Use the properties for the selected image)
              setPreferredSize(new Dimension(w, h));
              setMinimumSize(new Dimension(w, h));
              setMaximumSize(new Dimension(w, h));
         //Method to draw the selected image
         protected void paintComponent(Graphics g) {
              super.paintComponent(g); //We invoke super in order to: Paint the background, do custom painting.
              g.drawImage(picture.getImage(), 0, 0, this); //Draw the image at its natural state
    }//The endEdited by: onslow77 on Dec 16, 2009 7:30 PM

  • Display image in JPanel without saving any file to disk

    Hi,
    I am fetching images from database. I am saving this image, display in JPanel and delete it. But this is not actually I want.
    I wish to fetch this image as stream , store in memory and display in JPanel without saving any fiel in disk.
    I wonder if it is Possible or any used implementation that I can use in my project. Any idea or experienced knowledge is enough.
    Thanks

    In what format is the image coming to you from the database? If it's an InputStream subclass, just use javax.imageio.ImageIO:
    InputStream in = getImageInputStream();
    BufferedImage image = null;
    try {
       image = ImageIO.read(in);
    } finally {
       in.close();
    // ... Display image in your JPanel as you have beenIf you receive the image as an array of bytes, use the same method as above, but with a ByteArrayInputStream:
    byte[] imageData = getImageData();
    ByteArrayInputStream in = new ByteArrayInputStream(imageData);
    BufferedImage image = null;
    try {
       image = ImageIO.read(in);
    } finally {
       in.close();
    // ... Display image in your JPanel as you have been

  • Display image in Smart camera web interface

    Hi!
    I need some assistance with LV-RT. 
    What I have succeeded is to enalble the web server on NI 17XX camera and successfully displayed a VI with Image Display on it. I thikn I got the hang of it. 
    What I would like to know is there another way to display images on the camera web page. I really do not need the whole VI up there just an image and a string with serial number. One way I know would work is to write an image file to the system memory and then embed that image to the web page, but I am not sure that is the best solution as writing process takes time and it is not recommended to write too often to the program memory (am I right?).
    So, is there some way to assign some object to say a memory bank and display it (without having to install the runtime maybe) on the page?
    Thank you for your attention,
    Mart

    Hey Mart,
    Going back to your original question; are you looking to stream images to a web page from your smart camera or simple see what your camera is seeing when you go to a particular site? Take a look at the sample project below. It is sort of a work around, but it posts an image to a web service. Essentially it snaps an image, saves it, and then posts the saved image to a web service. You will have to change the file path for the image, then build and deploy the webservice from the project view. Also, it would be beneficial to take a look at the webservice build specifications. The webbing to view the snapped image from your local machine would then be viewable from your web browsers at the address : "http://localhost/Stream_Service/ShowImag"
    Let us know if you have trouble getting this example working. Also, perhaps another visit to what your end goal is would be helpful. What was it that you had working?
    Hope this helps
    -Ben
    Message Edited by BCho on 04-10-2009 02:27 PM
    Hope this helps.
    -Ben
    WaterlooLabs
    Attachments:
    SnapWebService.zip ‏14 KB

  • How to display image in selection-screen of a report

    Dear all ,
    i want to show my image from url or from desktop to the report selection-screen . i have searched sdn and found some code . after applying it i am not able to display image in the selection-screen although it is displaying the box in which the image should appear . here i am sending my code plz verify where is the mistake .
    REPORT  ZPIC2.
    DATA: docking TYPE REF TO cl_gui_docking_container,
    picture_control_1 TYPE REF TO cl_gui_picture,
    url(256) TYPE c .
    PARAMETERS: A(4) DEFAULT '4' .
    PARAMETERS: B(4) DEFAULT '5' .
    AT SELECTION-SCREEN OUTPUT.
    PERFORM show_pic.
    **& Form show_pic
    FORM show_pic.
    CREATE OBJECT picture_control_1 EXPORTING parent = docking.
    CHECK sy-subrc = 0.
    CALL METHOD picture_control_1->set_3d_border
    EXPORTING
    border = 5.
    CALL METHOD picture_control_1->set_display_mode
    EXPORTING
    display_mode = cl_gui_picture=>display_mode_stretch.
    CALL METHOD picture_control_1->set_position
    EXPORTING
    height = 100
    left =   150
    top =    58
    width =  350.
    CALL METHOD picture_control_1->load_picture_from_url
    EXPORTING
    url = 'C:\abc.jpg' .
    endif .
    IF sy-subrc NE 0.
    ENDIF.
    ENDFORM.
    CORECT ANSWERS WILL BE HIGHLY APPRECIATED AND SURELY REWARED .
    THANKS ,
    AMIT RANJAN

    Hi,
    Try this code. hope it will work.
    DATA: DOCKING TYPE REF TO CL_GUI_DOCKING_CONTAINER,
          PICTURE_CONTROL_1 TYPE REF TO CL_GUI_PICTURE,
          URL(256) TYPE C,
          PIC_DATA TYPE TABLE OF W3MIME WITH HEADER LINE,
          PIC_SIZE TYPE I.
    SELECTION-SCREEN BEGIN OF BLOCK B1.
    PARAMETERS: A(4) DEFAULT '4' .
    PARAMETERS: B(4) DEFAULT '5' .
    SELECTION-SCREEN END OF BLOCK B1.
    AT SELECTION-SCREEN OUTPUT.
      PERFORM SHOW_PIC.
    *&      Form  SHOW_PIC
    FORM SHOW_PIC .
      CREATE OBJECT PICTURE_CONTROL_1
    EXPORTING PARENT = DOCKING.
      CHECK SY-SUBRC = 0.
      CALL METHOD PICTURE_CONTROL_1->SET_3D_BORDER
        EXPORTING
          BORDER = 5.
      CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
        EXPORTING
          DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_STRETCH.
      CALL METHOD PICTURE_CONTROL_1->SET_POSITION
        EXPORTING
          HEIGHT = 200
          LEFT   = 100
          TOP    = 20
          WIDTH  = 400.
    CHANGE POSITION AND SIZE ABOVE**************************
      IF URL IS INITIAL.
        CALL FUNCTION 'DP_CREATE_URL'
          EXPORTING
            TYPE     = 'image'
            SUBTYPE  = CNDP_SAP_TAB_UNKNOWN
            SIZE     = PIC_SIZE
            LIFETIME = CNDP_LIFETIME_TRANSACTION
          TABLES
            DATA     = PIC_DATA
          CHANGING
            URL      = URL
          EXCEPTIONS
            OTHERS   = 1.
      ENDIF.
      CALL METHOD PICTURE_CONTROL_1->LOAD_PICTURE_FROM_URL
        EXPORTING
          URL = 'file://D:\img.jpg'.
    ENDFORM.                    " SHOW_PIC

  • Problems displaying images stored in SQL Server as Datatype "image"

    I am trying to display an Image stored in SQL Server as
    datatype
    'image' and it only shows a portion of the image.
    It seems to be tied to the size (kb) of the image since the
    larger the
    image the less of it is shown before it cuts off(sometimes it
    cuts off
    mid line so it's about the file size and not fitting the
    image on the
    screen).
    Here is the code I am using that deals with the image.
    [Bindable]
    public var theImage:ByteArray = new ByteArray;
    private function getScans_result(event:ResultEvent):void{
    var imageByteArray:ByteArray = event.result[0].Image;
    theImage = imageByteArray
    <mx:Image id="theIMG" width="160" height="220"
    source="{theImage}"/>
    Any Thoughts??

    I do that sort of thing using PHP and mySQL the binary part
    of the image is stored in a BLOB field (Binary Large OBject) along
    the rest of the information necessary for the http headers (e.g.
    mime type, file name, file size) being staored in their own fields.
    That info is then used to build the file using PHP. The PHP
    file contains a mySQL query whos result is echoed with the
    appropriate headers. The URL points at the PHP file rather than at
    any saved image.
    Here's the php:
    <?
    # display_imagebank_file.php
    # Note: the ID is passed through the url e.g.
    # this_files_name.php?id=1
    # connect to mysql database
    mysql_connect('HOST', 'USERNAME', 'PASSWORD');
    mysql_select_db('DATABASE');
    # run a query to get the file information
    $query = mysql_query("SELECT FileName, MimeType, FileSize,
    FileContents FROM blobTable WHERE ID='$id'");
    # perform an error check
    if(mysql_num_rows($query)==1){
    $fileName = mysql_result($query,0,0);
    $fileType = mysql_result($query,0,1);
    $fileSize = mysql_result($query,0,2);
    $fileContents = mysql_result($query,0,3);
    header("Content-type: $fileType");
    header("Content-length: $fileSize");
    header("Content-Disposition: inline; filename=$fileName");
    header("Content-Description: from imagebank");
    header("Connection: close");
    echo $fileContents;
    }else{
    $numRows = mysql_num_rows($query);
    echo "File not found <br>";
    echo $numRows;
    echo " is the number of rows returned for id = ";
    echo $ID;
    ?>
    Hope that helps
    Phil

  • Displaying images stored in SQL Server

    Is there someway of displaying images stored within SQL
    Server. Is FDS required? Prefer a method to display images without
    using FDS; Web Service would be okay if that can work

    I do that sort of thing using PHP and mySQL the binary part
    of the image is stored in a BLOB field (Binary Large OBject) along
    the rest of the information necessary for the http headers (e.g.
    mime type, file name, file size) being staored in their own fields.
    That info is then used to build the file using PHP. The PHP
    file contains a mySQL query whos result is echoed with the
    appropriate headers. The URL points at the PHP file rather than at
    any saved image.
    Here's the php:
    <?
    # display_imagebank_file.php
    # Note: the ID is passed through the url e.g.
    # this_files_name.php?id=1
    # connect to mysql database
    mysql_connect('HOST', 'USERNAME', 'PASSWORD');
    mysql_select_db('DATABASE');
    # run a query to get the file information
    $query = mysql_query("SELECT FileName, MimeType, FileSize,
    FileContents FROM blobTable WHERE ID='$id'");
    # perform an error check
    if(mysql_num_rows($query)==1){
    $fileName = mysql_result($query,0,0);
    $fileType = mysql_result($query,0,1);
    $fileSize = mysql_result($query,0,2);
    $fileContents = mysql_result($query,0,3);
    header("Content-type: $fileType");
    header("Content-length: $fileSize");
    header("Content-Disposition: inline; filename=$fileName");
    header("Content-Description: from imagebank");
    header("Connection: close");
    echo $fileContents;
    }else{
    $numRows = mysql_num_rows($query);
    echo "File not found <br>";
    echo $numRows;
    echo " is the number of rows returned for id = ";
    echo $ID;
    ?>
    Hope that helps
    Phil

  • Apex 4.0 display image item :BLOB column returned by SQL statement

    Hello
    I'm creating an display image item in apex 4.0. The source is a BLOB column returned by SQL statement.
    When I'm issuing an sql statement like this:
       select lado.blob_content
       from   large_documents      lado
       ,        large_doc_headers    ladh
       where lado.ladh_nr = ladh.nr
       more criteriait works fine.
    When I create a function inside a package with the same query (in a cursor)
    function get_image(some parameters in) return blob
    Following in apex by:
    select get_image(some parameters) from dualI get a
    ORA-06502: PL/SQL: numeric or value error: character string buffer too smallAnybody any idea why this does not work?
    Regards Erik

    Hi Eric,
    the environment assumes varchar2-output by default, which will be limited to 32767 characters and may have problems with binary formats. You could define a blob-variable to select the value into.
    DECLARE
      l_blob BLOB;
    BEGIN
      SELECT get_image(some parameters)
        INTO l_blob
        FROM dual;
    END;
    /If you expect the BLOB-Content to be text (you should consider CLOB then), you may use UTL_RAW.CAST_TO_VARCHAR2 to convert the content. If your object is larger than the maximum varchar2 size, or you want to convert BLOB to CLOB, you might be interested in some converter like described here: {message:id=559749}
    Hope this is what you were searching for.
    -Udo

Maybe you are looking for

  • [SOLVED] awesome & urxvt results in some screen flickering

    Hi, i've been using awesome since a few weeks and i noticed a flickering problem when starting urxvt (via mod4+enter). urxvt starts, disappears, comes back again, disappears and so on. starting up urxvt (time until i get a usable promt) takes about 1

  • Firefox 12 doesn't load bookmarks in sidebar, home pages don't open, undo closed tab won't work.

    Firefox 11 worked fine. Firefox 12 seemed to install too fast. Now, when opening Firefox, bookmarks don't load in sidebar, even though the top of the sidebar says "bookmarks." Home pages won't load on opening Firefox---only a new tab. Clicking on the

  • Condition types from Central Contract not copied into Purchase Order

    Hi, When creating a central contract from SRM to ECC, all the condition types are copied well. But when creating a shopping cart from SRM or a PO in ECC referencing the created central contract, the condtion types are not displayed in the conditions

  • Strange behavior with USB stick

    I was using gnome-disk-utility in order to format a USB stick when I mistakenly clicked on the button which puts the stick offline. Since then, it refuses to mount on USB 3.0 ports on my computer, but works perfectly well on USB 2.0 ports... I have g

  • C # call BAPI_DOCUMENT_CHECKOUTVIEW2 does not download

    Hello     I'm using C # call BAPI_DOCUMENT_CHECKOUTVIEW2 when there is no error returned Structure, and the return of the table parameter (DocumentFile) there is a line of data, so why not download the file, who can give me some advice. Thanks and Re