Displaying an image in large object type

hello
I am getting large object ( image) from a database.
like this way:
obj.read(buf, 0, obj.size());
I was not able to this image by OutputStream object
could you give me a hint ?
regards
Ahmet Temiz

orkun wrote:
InputStream is=rs.getBinaryStream(1); So you get an InputStream to read the image from.
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];And you create a byte array which contains a bunch of zeros.
for (int length; (length = is.read(buffer)) != -1;) {
out.write(buffer, 0, length); # out is in OutputStream
}And then you ignore the InputStream where the image was, and copy all the zeroes from
the byte array to the output.
that did not display any image.
what may the problem be ?Do you need more explanation?

Similar Messages

  • Create and display an Image within a object?

    Hi,
    I'd like to make objects that (among other things) hold a GIF-image. Then I would like for these objects to be able to display themselves. Like this:
    public class MyApplet extends Applet {
    private Tree tree;
    public void init() { tree = new Tree();}
    public void paint(Graphics g) { tree.display(g);}
    class Tree {
    private Image im;
    public Tree() { //create im here from file "tree.gif" ??}
    public void display(Graphics g) { //display im here??}
    Any idea how I can do this? Which librarymethods could I use and how?
    Thanx,
    JB

    What you could do is have theTree class extend JLabel and include a constuctor like
    public Tree(String filename)
    /*path is a class variable*/
    path=filename;
         ImageIcon ii= new ImageIcon(filename);
         this.setIcon(ii);
    then in a JFrame you could do something like
    Tree theTree = new Tree("/images/picture.gif");
    add(theTree);
    or use a layout Manager. Hope this helped

  • Displaying value of Object type

    Hi All,
    I have created one type as Object and I am trying to display the values available in object type for debugging purpose. Please assist me to display the contents of object type.
    Thanks in Advance.
    Regards,
    Venkatesh S

    vivekan wrote:
    I have created one type as Object and I am trying to display the values available in object type for debugging purpose. Please assist me to display the contents of object type.You can do this statically or dynamically.
    The static approach would be to add a DebugDump() method to the object type class - and code this method to display a "debug dump" (via DBMS_OUTPUT for example) of the current instantiated object. Of course, should the class change (new attributes added for example), this DebugDump() method has to be updated.
    The dynamic method is more flexible - but requires a copy of the object to be created for the dynamic code to use and "dump".
    As the static method is pretty straightforward, I'm only providing a basic example of the dynamic method.
    // create a function that generates a PL/SQL anonymous code block that accepts the
    // object to dump as bind variable and the display the object's attributes
    SQL> create or replace function GenerateDumpCode( typeName varchar2 ) return varchar2 is
      2          LF_INDENT       constant varchar2(10) default chr(10)||chr(9);
      3          LF              constant varchar2(10) default chr(10);
      4          type TAttrList is table of user_type_attrs.attr_name%Type;
      5          type TAttrTypeList is table of user_type_attrs.attr_type_name%Type;
      6          attrName        TAttrList;
      7          attrType        TAttrTypeList;
      8          plCode          varchar2(32767);
      9  begin
    10          select
    11                  a.attr_name, a.attr_type_name
    12                          bulk collect into
    13                  attrName, attrType
    14          from    user_type_attrs a
    15          where   a.type_name = typeName
    16          order by
    17                  a.attr_no;
    18 
    19          plCode :=
    20  'declare
    21          obj '||typeName||';
    22 
    23          procedure W( line varchar2 ) is
    24          begin
    25                  DBMS_OUTPUT.put_line( line );
    26          end;
    27  begin
    28          obj := :var1;
    29  ';
    30 
    31          for i in 1..attrName.Count loop
    32                  plCode := plCode ||LF_INDENT|| 'W( ''Attribute '||attrName(i)||'=''||';
    33                  case attrType(i)
    34                          when 'NUMBER' then plCode := plCode || 'to_char(obj.'||attrName(i)||') );';
    35                          when 'INTEGER' then plCode := plCode || 'to_char(obj.'||attrName(i)||') );';
    36                          when 'VARCHAR2' then plCode := plCode || 'obj.'||attrName(i)||' );';
    37                          when 'DATE' then plCode := plCode || 'to_date(obj.'||attrName(i)||',''yyyy/mm/dd hh24:mi:ss'') );';
    38                  else
    39                          plCode := plCode || '''data type '||attrType(i)||': value not displayed.'');';
    40 
    41                  end case;
    42          end loop;
    43 
    44          plCode := plCode ||LF|| 'end;';
    45 
    46          return( plCode );
    47  end;
    48  /
    Function created.
    // we need a sample object type/class for, so here's a basic one
    SQL> create or replace type TFunkyFoo is object(
      2          day             date,
      3          empID           integer,
      4          empName         varchar2(20),
      5          contract        clob
      6  );
      7  /
    Type created.
    // the dynamic code block that the function will generate looks as follows:
    SQL> select GenerateDumpCode( 'TFUNKYFOO' ) as PLSQL_CODE from dual;
    PLSQL_CODE
    declare
            obj TFUNKYFOO;
            procedure W( line varchar2 ) is
            begin
                    DBMS_OUTPUT.put_line( line );
            end;
    begin
            obj := :var1;
            W( 'Attribute DAY='||to_date(obj.DAY,'yyyy/mm/dd hh24:mi:ss') );
            W( 'Attribute EMPID='||to_char(obj.EMPID) );
            W( 'Attribute EMPNAME='||obj.EMPNAME );
            W( 'Attribute CONTRACT='||'data type CLOB: value not displayed.');
    end;
    // using the function to dynamically display an object's attributes
    SQL> declare
      2          foo TFunkyFoo;
      3  begin
      4          foo := new TFunkyFoo( sysdate, 100, 'John Smith', null );
      5          execute immediate
      6                  GenerateDumpCode( 'TFUNKYFOO' )
      7          using   foo;
      8  end;
      9  /
    Attribute DAY=2012-08-30 14:48:35
    Attribute EMPID=100
    Attribute EMPNAME=John Smith
    Attribute CONTRACT=data type CLOB: value not displayed.
    PL/SQL procedure successfully completed.
    SQL>

  • Display byte array image or ole object in Section through dynamic code?

    To Start I am a Complete Newbe to Crystal Reports. I have taken over a project originally written in VS2003 asp.net using SQL Server 2005 and older version of Crytal Reports. I have moved project to VS2010 and Cryatal Reports 10 still using SQL Server 2005. Have multiple reports (14 to be exact) that display data currently being pulled from database suing a dataset, each report has from 4 to 14 Sections. I have modified database table with two new fields. Field1 contains string data with full path to a scanned document (pdf or jpeg). Field2 holds a byte array of the actual image of the scanned document. I have tested the database and it does infact contain the byte array and can display the image via VB.net code. I can make the report display the scanned image using ole object.
    Now my real question: I need to add a new Section and it should display either the byte array of the scanned image or the actual scanned image (pdf or jpeg) . How can I have it do either of these options via code dynamicly while application is running?

    First; only CRVS2010 is supported on VS2010. You can download CRVS2010 from here;
    SAP Crystal Reports, developer version for Microsoft Visual Studio: Updates & Runtime Downloads
    Developer Help files are here:
    Report Application Server .NET API Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_api_en.zip
    Report Application Server .NET SDK Developer Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_dg_en.zip
    SAP Crystal Reports .NET API Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_api_2010_en.zip
    SAP Crystal Reports .NET SDK Developer Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip
    To add the images, you have a number of options re. how to. You even have two SDKs that y ou can use (RAS and CR).
    Perhaps the best place to start is with KB [1296803 - How to add an image to a report using the Crystal Reports .NET InProc RAS SDK|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233393336333833303333%7D.do]. The KB describes how to add images to a report using the InProc RAS SDK, but also references other KBs that use CR SDK.
    Also, don't forget to use the search box in the top right corner of this web page.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • How to display an image of BLOB type from a Table in an OAF page?

    Hi,
    My requirement is that in the database table images gets saved of type BLOB and i have to display these images in my OAF page .I looked in OA developers guide and followed the instruction but unable to achieve my requirement .As per the developers guide "I created an item of type messageDownload ,in the viewattribute i set the view attribute FileData and File View Attribute FileContentType the table used is FND_LOBS" but i couldn't achieve anything.
    Please help me and if possible give me exact way to achieve it as i am new to this framework.
    Thanks in advance

    Map the database table columns to the Table region columns. For image column set the item style as "Messagedownload". Set the View Instance (VO) , View Attibute Name (image name) and View Attribute Data (blob col).

  • Object type for Vendor Invoice (FB60) to attach image

    Hi,
    I was wondering if any of you experts would know the Object Type for Vendor Invoice which allows an image to be attached to it in early archiving.
    Many thanks
    G

    The object for attaching an image to a document entered directly into FI is BKPF.  This is the object for vendor invoices entered into FB60 as well as vendor credit memos (FB65), customer invoices (FB70), customer credit memos (FB75) and GL adjustments (FB50).  It also applies to any document posted via a complex (non-enjoy) FI transaction like FB01.

  • I have the requirment, i have to display the equipment object type.

    Hi,
    i have to display data from the following fields, the equipment object type(EQUI_EQART), materil numb(EQUI-MATNR),asset number(EQUI-ANLNR),  placement date(AFKO-GLTRP),
    QMEL-VBELN, VBAP-NEPR, IHPA-PARNR, KNA1-NAME1, KNA1-STRAS, KNA1-KATR6,
    KNVP-PARVW, KNVV-VKBUR,
    JCDS-STAT.
    how can i map the field(GLTRP) from AFKO  with other tables.
    Kindly send me as soon as possible.

    Hi:
    Declare 2 variables in page attribute like tdate/ydate type d
    in intilization
    assign like
    tdate = sy-datum
    ydate = sy-datum-1.
    in page attribute like
          <tr><td>
          <htmlb:label for       = "ip_doj"
                       labelType = "MEDIUM"
                       text      = "Current Date (DD.MM.YYYY)" />
          </td>
                                  <td>
          <htmlb:inputField id         = "tdate"
                            required   = "TRUE"
                            doValidate = "TRUE"
                            type       = "DATE"
                            showHelp   = "TRUE"
                            size       = "10"
                            maxlength  = "10" />
          </td></tr>
          <tr><td>
          <htmlb:label for       = "ip_doj"
                       labelType = "MEDIUM"
                       text      = "Yesterday Date (DD.MM.YYYY)" />
          </td>
                                  <td>
          <htmlb:inputField id         = "ydate"
                            required   = "TRUE"
                            doValidate = "TRUE"
                            type       = "DATE"
                            showHelp   = "TRUE"
                            size       = "10"
                            maxlength  = "10" />
          </td></tr>
    Regards
    Shashi

  • How to read local large JPEG files and display into Images Tile

    Hi all,
    I can read the local multiple files by FLEX/AIR FileListEvent
    and loader to read the large JPEG files but cannot display them
    into a TileList. Since it is a number of images files, how can I
    put them into a thumbnail TileList.
    Please kindly advise.
    Regards,
    Billy

    1. So I would like to know which is the {color:#3366ff}best way to load local images in ImageView{color}.I'm no expert, but is there a reason that you are using Swing to do the loading?
    2. secondly, currently the system displays all images only after the completion of creating all images. {color:#3366ff}How to display images as and when they are created.{color} So that the user has a feeling that the images are loading.JavaFX Image class let you display a lightweight placeholder, and you can bind the progress to some kind of visual indicator. I don't think you can display an image that is partially loaded.
    def PATHS: String[] = [
        "C://Ariel Atom//ariel-atom-1.jpg",
        "C://Ariel Atom//ariel-atom-2.jpg",
        "C://Ariel Atom//ariel-atom-3.jpg",
        "C://Ariel Atom//ariel-atom-5.jpg"
    function getImage(path: String): Image {
        Image {
            url: "file:///{path}"
            backgroundLoading: true
    Stage {
        title: "Image Tiles"
        width: 1024
        height: 800
        scene: Scene {
            content: [
                Tile {
                    columns: 2
                    tileWidth: 400
                    tileHeight: 400
                    content: for (i in [0..3]) {
                        ImageView {
                            image: getImage(PATHS)

  • Transaction SMOEAC does not display Object type and Object Name options.

    Dear all,
    When I go to transaction SMOEAC system does not display fields Object type and Object Name option instead displays an empty frame allowing only to create new objects.
    System does not allow and display existing objects to edit.
    Most imp with the same ID, I am able to see the existing objects and two fields "Object type" and "Object Name" on different machine. So there is no authorization issue.
    My SAP GUI version where these fields are not visible is 640 Final Release with 6405.5.18.1016 version and Patch level 18.
    My SAP GUI version here these fields are visible is 640 Final Release with 6404.4.14.1012 version and Patch Level 14.
    Any idea what could be the reason?
    Regards,
    Sandeep Parab

    With installation of latest version of SAP GUI 710 final Release resolved my problem.
    Regards,
    Sandeep

  • Display BLOB (image) column in (interactive) report

    Hi,
    I have a field called "picture" in my table "details" which is of type BLOB. i also have a field for "MIMETYPE" and "filename"
    i additionally have a "name" and "description" columns which i need to display along with the picture as columns in a report (preferably interactive).
    i have also modified the BLOB display format as per
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm
    what i am missing is the correct query. if possible, i would like to control the size of the picture rendered within the report like say 40*50.
    I have also referred to the thread
    APEX 3.1 Display BLOB Image
    But i don't know how to place the
    dbms_lob.getlength("BLOB_CONTENT") as "BLOB_CONTENT"
    in my query.
    The above also makes the report column as of type "number". is this expected?
    Any help would be much appreciated.
    Regards,
    Ramakrishnan

    You haven't actually said what the problem is?
    >
    I have a field called "picture" in my table "details" which is of type BLOB. i also have a field for "MIMETYPE" and "filename"
    i additionally have a "name" and "description" columns which i need to display along with the picture as columns in a report (preferably interactive).
    i have also modified the BLOB display format as per
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm
    what i am missing is the correct query.
    I have also referred to the thread
    APEX 3.1 Display BLOB Image
    But i don't know how to place the
    dbms_lob.getlength("BLOB_CONTENT") as "BLOB_CONTENT"
    >
    Something like:
    select
              name
            , description
            , dbms_lob.getlength(picture) picture
    from
              details
    if possible, i would like to control the size of the picture rendered within the report like say 40*50.For images close to this size it's easy to do this for declarative BLOB images in interactive reports using CSS. Add a style sheet with:
    .apexir_WORKSHEET_DATA td[headers="PICTURE"] img {
      display: block;
      width: 40px;
      border: 1px solid #999;
      padding: 4px;
      background: #f6f6f6;
    }where the <tt>PICTURE</tt> value in the attribute selector is the table header ID of the image column. Setting only one dimension (in this case the width) scales the image with the correct aspect ratio. (The border, padding and background properties are just eye candy...)
    However, scaling large images in the browser this way is a huge waste of bandwidth and produces poorer quality images than creating proper scaled down versions using image tools. For improved performance and image quality, and where you require image-specific scaling you can use the database ORDImage object to produce thumbnail and preview versions automatically, as described in this blog post.

  • Is it possible to display an image instead of button in a radio group?

    I am building an application to be operated with touch screens. I would like to display radio group buttons larger than they are by default. Is it possible to make them seem larger, or to display a custom image instead of the radio group?
    Francisco

    Rather than using a radio group, have you looked into using a list? That is what we use for navigation in APEX in many places when we show large images (like App Builder home page - Run Application, Supporting Objects, Shared Components, Utilities, Export / Import).
    If you need to use radio groups, you can use the template under Globalization to include a larger, clickable image (we do that for pages like selecting the type of page to create). An example template is:
    #DISPLAY_VALUE#&lt;br /&gt;&lt;a href="f?p=4000:4700:&SESSION.::::P259_CHOOSE_PAGE_TYPE,P4700_SELECT_REPORT_TYPE:FORM,FORM_ON_A_TABLE"&gt;&lt;img src="#IMAGE_PREFIX#menu/wiz_form_140x90.gif" alt="#DISPLAY_VALUE#" class="htmldbGreenIcons" width="140" height="90" /&gt;&lt;/a&gt;
    Hope it helps -
    -- Sharon

  • How to create Image as Custom Property Type used in Configurable Web Part?

    I wanted to create custom configurable web part property for Image.
    Example - the screenshot of Image property used in Image web part is shown below:
    My goal is to create as many images as possible in custom configurable web part.
    I tried to write the code:
    [WebBrowsable(true),
    WebDisplayName("Example Photo"),
    WebDescription("Example Photo of the user"),
    Category("Custom User Profile"),
    Personalizable(PersonalizationScope.Shared)]
    public Image ExampleUserPhoto { get; set; }
    However, the result does not display Image configurable web part property.
    I wonder why the data type Image does not cause the custom web part to have Image configurable web part property.
    Other data types such as Boolean, Enum, Integer, String and DateTime can be used.
    How can I create Image as Custom Property Type used in Configurable Web Part?

    I have examined that context node __00 has been enhanced,and  has a class name  z___00. But  when I created a new attirubute by right click " Attributes" with wizard under context node __00.There is still  a error message "view is not enhaced or copied with wizard".
    But  when  I created a method  "getvaliation "  in the class of context node zcl__00, the attribute  'valiation' automatically created(at the same time the method "getvaliation' automatically  created for the attribute 'valiation') and I need not to create attibute 'validation' by wizard .  It seemed as if the problem is resloved. But when I make test for it in web ui .There is a runtime erro message.
    Do I need to make some configurations in  the business object layer  for the checkbox? but  the checkbox is only used as a flag  to decide whether a backgoud job is needed to be executed.
    Edited by: samhuman on Jun 22, 2010 10:31 AM

  • I want to display BLOB image in JSP Using  html tags IMG src=

    GoodAfternoon Sir/Madom
    I Have got the image from oracle database but want to display BLOB image using <IMG src="" > Html tags in JSP page . If it is possible than please give some ideas or
    Send me sample codes for display image.
    This code is ok and working no problem here Please send me code How to display using html tag from oracle in JSP page.
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="javax.swing.ImageIcon;" %>
          <%
            out.print("hiiiiiii") ;
                // declare a connection by using Connection interface
                Connection connection = null;
                /* Create string of connection url within specified format with machine
                   name, port number and database name. Here machine name id localhost
                   and database name is student. */
                String connectionURL = "jdbc:oracle:thin:@localhost:1521:orcl";
                /*declare a resultSet that works as a table resulted by execute a specified
                   sql query. */
                ResultSet rs = null;
                // Declare statement.
                PreparedStatement psmnt = null;
                  // declare InputStream object to store binary stream of given image.
                   InputStream sImage;
                try {
                    // Load JDBC driver "com.mysql.jdbc.Driver"
                    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
                        /* Create a connection by using getConnection() method that takes
                        parameters of string type connection url, user name and password to
                        connect to database. */
                    connection = DriverManager.getConnection(connectionURL, "scott", "root");
                        /* prepareStatement() is used for create statement object that is
                    used for sending sql statements to the specified database. */
                    psmnt = connection.prepareStatement("SELECT image FROM img WHERE id = ?");
                    psmnt.setString(1, "10");
                    rs = psmnt.executeQuery();
                    if(rs.next()) {
                          byte[] bytearray = new byte[1048576];
                          int size=0;
                          sImage = rs.getBinaryStream(1);
                        //response.reset();
                          response.setContentType("image/jpeg");
                          while((size=sImage.read(bytearray))!= -1 ){
                response.getOutputStream().write(bytearray,0,size);
                catch(Exception ex){
                        out.println("error :"+ex);
               finally {
                    // close all the connections.
                    rs.close();
                    psmnt.close();
                    connection.close();
         %>
         Thanks

    I have done exactly that in one of my applications.
    I have extracted the image from the database as a byte array, and displayed it using a servlet.
    Here is the method in the servlet which does the displaying:
    (since I'm writing one byte at a time, it's probably not terribly efficient but it works)
         private void sendImage(byte[] bytes, HttpServletRequest request, HttpServletResponse response) throws IOException {
              ServletOutputStream sout = response.getOutputStream();
              for(int n = 0; n < bytes.length; n++) {
                   sout.write(bytes[n]);
              sout.flush();
              sout.close();
         }Then in my JSP, I use this:
    <img src="/path-to-servlet/image.jpg"/>
    The name of the image to display is in the URL as well as the path to the servlet. The servlet will therefore need to extract the image name from the url and call the database.

  • I have a picture library with images in sharePoint, now i want display that images in sharepoint webpage as a webpart.

    Hi All,
    I have a picture library with images in sharePoint, now i want display that images in sharepoint webpage as a webpart.
    i have displayed the all the images as a webpart.
    Now i want to enable thumbnail on that images and when i click the thumbnail of the image, it will be dilplayed as large image.
    How can i do this, any help!

    Hi,
    Please do the following to complete this task.
    1) Insert the picture library as list view webpart in your page.
    2)Specify the column titled  Thumbnail Preview in the list view.
    3) Edit the webpart and set the Toolbar Type to Summary Toolbar.
    Regards,
    Anurag

  • Oracle BLOB  Display an image in Web Form

    I have an Oracle database that stores image data. The data type of this image column is BLOB. I created a Window application using Visual C#, Oracle Provider for OLE DB to display the images on the Window forms. The mechanism to retrieve the data from Oracle database from client is to call an Oracle stored procedure that returns BLOB type. Now I want to convert it into Web application. I have difficulty to find
    (1) Appropriate web control
    (2) A way to bind OracleLOB object to this web control so the image can be displayed.
    I am aware of the fact that in ASP .NET you can use ImageUrl property of an Image object to link a file stored in a particular URL.
    Your help is very much appreciated.

    Hi ,
    Please can you give me some examples or where can i find the solution.
    Can you guys send some FMB examples on [email protected]
    Please reply as sson as possible because we got stuck up here.
    Regards,

Maybe you are looking for

  • Visitors can't subscribe to my iWeb website blog. All ideas are welcome.

    Hello, good people. OK. I've figured out the PDF issue. Thanks. Visitors to my iWeb website, nancysolomon.net, cannot subscribe to my blog. It's not that what I have to say is so important, but I would like to offer that option. Because they can't su

  • Approval before COST DISTRIBUTION Process

    Hi, Is there any standard functionality (in 12.0.6) of Approval available before Cost Distributions ? After importing actual transactions, creating pre-approved batches or doing Project Transfer, user want to put restriction on Cost Distribution. The

  • HT3964 how do I save files before resetting computer

    how do I save files before resetting computer

  • Object link doesn't work

    We have a problem that we can go through the Workflow overview. But in the following screens in the box " Information objects addressed so far" when we click the links viz. PDOCapprovalhistory 450000001 Nothing comes up. In other development & qualit

  • Socket mapping to server process

    Hi, I am trying to back into process information using netstat. What I am attempting to do is map back a specific socket from the netstat command to the server process that is listening or using that particular port. My hope is to identify a path fro