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
Image Control Resizing
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 10
- Joined: Sun Sep 15, 2013 7:44 pm
- Location: Andover, MA
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Something like this:
Code: Select all
controls.IMAGE1.imageHeight= "50%";
controls.IMAGE1.imageWidth = "50%";
0 x
-
- Ebase User
- Posts: 10
- Joined: Sun Sep 15, 2013 7:44 pm
- Location: Andover, MA
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%"
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
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Single quotes instead of double quotes in FPL i.e.
Code: Select all
set THUMBNAIL_IMAGE.imageWidth = '50%';
0 x
-
- Ebase User
- Posts: 10
- Joined: Sun Sep 15, 2013 7:44 pm
- Location: Andover, MA
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
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
-
- Ebase User
- Posts: 10
- Joined: Sun Sep 15, 2013 7:44 pm
- Location: Andover, MA
Who is online
Users browsing this forum: No registered users and 13 guests