Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » How to change the size of a picture on the page (APEX 3.2)
How to change the size of a picture on the page [message #540079] Fri, 20 January 2012 02:43 Go to next message
balckbandit5
Messages: 104
Registered: December 2011
Senior Member
Hello Smile

I've got a table in my database for users where they can upload a photo of themselves. Now I have managed to display it using a report and the query:
Select DBMS_LOB.getlength (PICTURE)picture_muid, muid
  from legal_person where muid = :P19_MUID

The thing is...If the picture is a high quality one or a particularly big one, it displays at its actual size...I don't know how to change the size of the photo from the report to lets say width:100 height:200. I know in apex 4.0 that you can make an item with 'display picture' or something like that...and you can change the size of it then...But is there a way to do this in 3.2? (It doesn't have to be in a report)

thanks Smile


P.S. I realise I've been posting a tonne in this forum...hope I'm not getting annoying :/
Re: How to change the size of a picture on the page [message #540106 is a reply to message #540079] Fri, 20 January 2012 05:13 Go to previous messageGo to next message
c_stenersen
Messages: 255
Registered: August 2007
Senior Member
I can't quite see how that query would display the image.
What's your exact code? you could just add a width and height to the img html tag.
Re: How to change the size of a picture on the page [message #540115 is a reply to message #540106] Fri, 20 January 2012 05:56 Go to previous messageGo to next message
balckbandit5
Messages: 104
Registered: December 2011
Senior Member
That is the exact code that's in the report region 'source'...copy pasted, there might be some other code hiding somewhere but I have not a clue where. I didn't actually write it, I'm picking up the development where someone left it...like a year ago o_O

Tbh when I'm not entirely sure what some of the code is refering to...neither 'getlength' nor 'picture_muid' are columns in any table in the schema i'm working with and 'DBMS_LOB' isn't a table either so I don't really know what any of it means...but it does work

If theres a better way of getting the image from the table that would be good
I guess the code to get to where the picture is would be:
select picture from legal_person
 where MUID = :p19_muid

but I don't know how to display the image from there...if there is even anything special I need to do?
Re: How to change the size of a picture on the page [message #540178 is a reply to message #540115] Fri, 20 January 2012 10:01 Go to previous messageGo to next message
c_stenersen
Messages: 255
Registered: August 2007
Senior Member
DBMS_LOB is a built-in package in Oracle. DBMS_LOB
DBMS_LOB.getlength will simply give you the length of the lob in bytes. Picture_muid is the alias you're giving to dbms_lob.getlength(picture) so that later you can refer to it by that name. It's not something already defined in the table. This query will then just give you a number and the value of legal_person.muid.
Look at the column properties in the report properties to see what might be going on behind the scenes. There must be some manipulation somewhere if this is in fact the report where your picture shows up.
Re: How to change the size of a picture on the page [message #540183 is a reply to message #540178] Fri, 20 January 2012 10:06 Go to previous messageGo to next message
balckbandit5
Messages: 104
Registered: December 2011
Senior Member
ah ok that makes a little more sense I guess...

In the columns the only thing I found was
IMAGE:LEGAL_PERSON:PICTURE:MUID::::::inline:Download
which was the number/date format in the column 'Picture_muid'
Thats the 'Column Attributes' mind you is that what you meant or is there another place I could look?
Re: How to change the size of a picture on the page [message #540191 is a reply to message #540183] Fri, 20 January 2012 11:05 Go to previous messageGo to next message
c_stenersen
Messages: 255
Registered: August 2007
Senior Member
Aha, when I look at this a bit I can see what it does.
IMAGE - you're telling it that you want to show an image
LEGAL_PERSON - the table it comes from
PICTURE - the column name with the blob
MUID - the primary key in the table
Apex then takes care of the rest. I had no idea that this existed.

I found this : http://www.apexexplorer.com/wp-content/uploads/2011/07/How-to-upload-and-display-images-in-apex2.pdf which explains the syntax of this string (see the page before the last one)
But it doesn't have a segment for any style attributes or other html attributes unfortunately.

But this is the procedure I've used in the past: http://www.mandsconsulting.com/oracle-apex-tutorial-8-up-and-downloading-files-part-2-video-training
Then you can just embed the call to this procedure in an img tag in your query, and in that tag you can set a style attribute to reduce the size of the display of the image.
Re: How to change the size of a picture on the page [message #540373 is a reply to message #540191] Mon, 23 January 2012 02:16 Go to previous message
balckbandit5
Messages: 104
Registered: December 2011
Senior Member
awesome, thanks Smile
Previous Topic: Any value in doing a new install of Apex?
Next Topic: Long tabular form checkboxes not working right.
Goto Forum:
  


Current Time: Mon Mar 18 22:25:05 CDT 2024