B4J Question ABMaterial - Scale the ImageSlider Image LIVE for User

mmieher

Active Member
Licensed User
Longtime User
I want to do something like this:
B4X:
tmpImage.SetExtraStyle("max-width: 100%; height: auto")

to that .png in the first parameter of this:
B4X:
 slider.AddSlideImage("../images/blank-portrait-1080x1350.png", ABMShared.lbClr("Image One", "#000000"), ABMShared.lbClr("Second Line Image 1","#000000"), ABM.IMAGESLIDER_CENTER)

I guess I could figure out what is going on at run-time, then recreate the .png on the fly? First thought is that this path promises much resistance. Can I put a component in that file name parameter somehow?

If there is a better way, I am not searching for the correct magic word.
 
Solution
Untested, but I think you will have to use CSS to override the Matericalize CSS settings:

Something like this in the page's Initialize:
B4X:
page.AddExtraCSSString($".slides > li > img {max-width: 100%;height: auto !important;}"$)

No idea what the effect will be.

Alwaysbusy

alwaysbusy

Expert
Licensed User
Longtime User
Untested, but I think you will have to use CSS to override the Matericalize CSS settings:

Something like this in the page's Initialize:
B4X:
page.AddExtraCSSString($".slides > li > img {max-width: 100%;height: auto !important;}"$)

No idea what the effect will be.

Alwaysbusy
 
Upvote 0
Solution

mmieher

Active Member
Licensed User
Longtime User
Thank you, AB.

This got me really close (in five minutes) so I believe it is correct path. I can build css string based on ABM.GetBrowerWidthHeight if I have to.

Please tell me if I am making this too hard.

I am trying to make easy use of images that are already the "ideal size" for FB/Instagram, TicTok, and other ATM machines. I can hopefully slam images into a properly sized panel with black background in order to deal with Portrait or Landscape.
 
Upvote 0
Top