This discussion is archived
4 Replies Latest reply: Feb 6, 2013 10:40 AM by garcol RSS

manipulating image width and heigth on FORM

garcol Newbie
Currently Being Moderated
Hello,

I would like to show an image thumbnail on a form page.
I have used the apex_util.get_blob_src-something but then it shows a big image.
The problem is I can not set the width and height. On a report it works with an <img-tag> in the query, but I do not have that option on a Form.

Does anyone know how to solve this?

This option is also possible (http://dgielis.blogspot.nl/2008/07/show-blob-of-other-table-in-apex-form.html), but then my text-field only show the <img>-tag. I do not know how to configure the field so it shows the image... (in a report you set 'standard report column', but in Forms???)

Gr.
garco
  • 1. Re: manipulating image width and heigth on FORM
    fac586 Guru
    Currently Being Moderated
    garcol wrote:
    Hello,

    I would like to show an image thumbnail on a form page.
    I have used the apex_util.get_blob_src-something but then it shows a big image.
    How are you doing this?

    Why not use a Display Image item?

    Suggest you create an example on apex.oracle.com.
  • 2. Re: manipulating image width and heigth on FORM
    garcol Newbie
    Currently Being Moderated
    Yes I have also tried that:

    This is the img-tag:
    <img src="apex_util.get_blob_file?a=17629&s=522214350672&p=711&d=10901110819995477223&i=11051767507604824287&p_pk1=2430&p_pk2=&p_ck=A2F9082C92304A8BB5C4DEE40CB957D9" height="50" width="50" alt="Avatar" />
    On the item P1210_AVATAR I change 'Basis on' (under Settings) to 'Image URL stored in page item value'.
    Under Source I have put this in the 'source value or expression':
    return  '<img src="'||apex_util.get_blob_file_src('P711_AFB',:P1210_DNR_ID)||'" height="50" width="50" alt="Avatar" />';
    P711_AFB is an image item (BLOB), P1210_DNR_ID is the primary key from the table where I get my image from.

    Then I see a 50x50 image with a red cross which means 'I can not find image'.
    I have the feelings that it almost works...

    When I make it a Text item, it just shows me the <img>-tag mentioned above (3rd sentence).

    Edited by: garcol on Feb 6, 2013 1:26 PM
  • 3. Re: manipulating image width and heigth on FORM
    fac586 Guru
    Currently Being Moderated
    garcol wrote:

    On the item P1210_AVATAR I change 'Basis on' (under Settings) to 'Image URL stored in page item value'.
    Under Source I have put this in the 'source value or expression':
    return  '<img src="'||apex_util.get_blob_file_src('P711_AFB',:P1210_DNR_ID)||'" height="50" width="50" alt="Avatar" />';
    That's not a URL, it's an HTML element. Inspect the source code and I think you'll find that the <tt>src</tt> attribute of the image item is completely garbled.
    P711_AFB is an image item (BLOB), P1210_DNR_ID is the primary key from the table where I get my image from.
    Create the <tt>P1210_AVATAR</tt> item with

    Display As: Display Image
    Based On: Image URL stored in Page Item Value
    HTML Form Element Attributes: width="50" height="50" alt="Avatar"
    Source Type: PL/SQL Function Body
    Source value or expression:
    return apex_util.get_blob_file_src('P711_AFB', :P1210_DNR_ID);
  • 4. Re: manipulating image width and heigth on FORM
    garcol Newbie
    Currently Being Moderated
    Wow, that's great!
    It works. Thanks!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points