RAP img token with markup and varying size [message #1832974] |
Wed, 30 September 2020 04:56  |
Eclipse User |
|
|
|
I know that so far, using the img markup token in RAP it is mandatory to specify the width, height and src attributes, which works OK.
However, I'd like to dynamically set the markup to point to any old image url, for which I do not know the width and height at the time of coding, or indeed at runtime, as the image has not yet been fetched.
Is there any way to allow markup to automatically deduce width and height according to the control size that it will go into?
I'd like to say width='100%' for example, and leave height to auto-calculate in order to retain proprotions.
Is this possible, or perhaps as an enhancement to RAP in the future?
|
|
|
Re: RAP img token with markup and varying size [message #1832982 is a reply to message #1832974] |
Wed, 30 September 2020 06:16  |
Eclipse User |
|
|
|
I've sort of got what I want visually by using a Browser control and setting a value like this:
browser.setText("<img style='height: 100%; width: 100%; object-fit: contain' src='...some URL with an image...'/>")
However, I'm assuming that this is quite inefficient and more complex for the page, so potentially not great for performance, compared to direct markup on a Text control?
Not sure if 'object-fit:contain' style is supported universally either?
Plus, I cannot use a Browser control in a Table, which I'll need to do as there could be many images. It needs to be markup really.
[Updated on: Wed, 30 September 2020 06:19] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03477 seconds