|Home Ľ Technical Support Ľ Elevate Web Builder Technical Support Ľ Support Forums Ľ Elevate Web Builder General Ľ View Thread|
|Messages 1 to 5 of 5 total|
|How to scroll a large image?|
|Sat, Sep 2 2017 8:59 AM||Permanent Link|
I am a EWB newbie and have a doubt: I need to show a big image (it's a map) on a browser and I would like the users could view the various portions of the image.
I've tried to put a TScrollPannel with a TImage inside but the image do not scroll inside the container, no success.
Could anyone show me how to do it? Which components and its right properties should I use ?
Thanks a lot
|Sat, Sep 2 2017 9:07 AM||Permanent Link|
> I've tried to put a TScrollPannel with a TImage inside but the image do not scroll inside the container, no success.
> Could anyone show me how to do it? Which components and its right properties should I use ?
TScrollPanel should work fine for that.
Did you set any Layout properties for the Image? Are the scrollbars visible?
Show some code or a sample project please.
|Sat, Sep 2 2017 11:28 AM||Permanent Link|
attached test.zip with files Project3 and unit3.
|Sat, Sep 2 2017 12:08 PM||Permanent Link|
Iíve come across this before and there are a few steps required to make it work the way that you want it to:
- Remove the PNG from the TImage Background.Image property
- Add the PNG to the project as an external file
- Put the name of the PNG in the URL property of the TImage
This will now display the image, but only at runtime. You will not see it at design time.
Finally you need to size the TImage to be the same size as the PNG. To do this you should:
- Set its layout to TopLeft
- Trap its OnLoad event
- In the OnLoad event handler set Height = ActualHeight and Width = ActualWidth
This works because the TImage needs to load the PNG in order to get its size. Once itís done this it puts the size into the ActualHeight and ActualWidth properties. By setting the Height and Width to be the same you have resized your TIMage accordingly.
If the final size of the TImage exceeds the TScrollBox then youíll see the scroll bars exactly as you require.
|Mon, Sep 4 2017 9:00 AM||Permanent Link|
it worked very fine! Thank you very much.
Thank you all for your time.