Image Control Resizing

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

jaffleck
Ebase User
Posts: 10
Joined: Sun Sep 15, 2013 7:44 pm
Location: Andover, MA

Image Control Resizing

#1

Postby jaffleck » Fri Oct 25, 2013 3:02 pm

Is it possible to modify the dimensions of an image control on the fly? I have a table that includes a thumbnail in an image control, and I want to adjust the size of the images to 50% of the actual image size.

Thanks. for the help.

Jim
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Fri Oct 25, 2013 4:09 pm

Something like this:

Code: Select all

controls.IMAGE1.imageHeight= "50%";
controls.IMAGE1.imageWidth = "50%";
0 x

jaffleck
Ebase User
Posts: 10
Joined: Sun Sep 15, 2013 7:44 pm
Location: Andover, MA

#3

Postby jaffleck » Fri Oct 25, 2013 4:41 pm

Can this be done in an FPL script?
I have something like this (the database only has the file name in the THUMBNAIL column - not the complete path):

fetchtable T_OBJECTS;
if [$FOUND = 'Y']
loop at table T_OBJECTS
set THUMBNAIL_IMAGE.imageURL = '../ufs/images/Thumbnails/' + T_OBJECTS-THUMBNAIL;
set THUMBNAIL_IMAGE.imageWidth = "50%";
set THUMBNAIL_IMAGE.imageHeight = "50%";
endloop
endif

But it throws an error:
Invalid SET expression set THUMBNAIL_IMAGE.imageWidth = "50%" - Script F_OBJECTS_TABLE1_FETCHTABLE_001: Error parsing expression "50%"
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Fri Oct 25, 2013 4:57 pm

Single quotes instead of double quotes in FPL i.e.

Code: Select all

set THUMBNAIL_IMAGE.imageWidth = '50%'; 
0 x

jaffleck
Ebase User
Posts: 10
Joined: Sun Sep 15, 2013 7:44 pm
Location: Andover, MA

#5

Postby jaffleck » Fri Oct 25, 2013 9:19 pm

Getting closer, I think.

The code now looks like this:
fetchtable T_OBJECTS;
if [$FOUND = 'Y']
loop at table T_OBJECTS
set THUMBNAIL_IMAGE.imageURL = '../ufs/images/Thumbnails/' + T_OBJECTS-THUMBNAIL;
set THUMBNAIL_IMAGE.imageWidth = '50%';
set THUMBNAIL_IMAGE.imageHeight = '50%';
endloop
endif

and I get this error:

"Failed setting property THUMBNAIL_IMAGE.imageWidth on Control THUMBNAIL_IMAGE to value 50% with error: property imageWidth does not exist"

Jim
0 x

jaffleck
Ebase User
Posts: 10
Joined: Sun Sep 15, 2013 7:44 pm
Location: Andover, MA

#6

Postby jaffleck » Fri Oct 25, 2013 10:13 pm

I found the solution:

set THUMBNAIL_IMAGE.imageProperties.imageWidth = '50%';
set THUMBNAIL_IMAGE.imageProperties.imageHeight = '50%';

This works.

Thanks for the help.

Jim
0 x


Who is online

Users browsing this forum: No registered users and 25 guests