andyhill Posted December 23, 2020 Share Posted December 23, 2020 UniImage1.AutoSize:= True; // DOES NOT WORK UniImage1.Url:='images/myimage.png'; // LOADS // Work Around below corrects size but need image to be centered UniImage1.JSInterface.JSCode('Ext.defer(function(){var el='#1'.el.select("img").elements[0]; '+ 'el.style.maxWidth = "100%"; '+ 'el.style.height="100%"; }, 20);'); After work around above, UniImage1.Center:= True; now works. Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted April 20, 2023 Share Posted April 20, 2023 I have this problem, it is creating a TUniImage and loading the image at runtime, I leave the properties vImage.Center := True; vImage.Proportional:= True; but the image is not centered. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 20, 2023 Share Posted April 20, 2023 42 minutes ago, eduardosuruagy said: loading the image at runtime How? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted April 20, 2023 Share Posted April 20, 2023 1 hour ago, eduardosuruagy said: I have this problem, it is creating a TUniImage and loading the image at runtime, I leave the properties vImage.Center := True; vImage.Proportional:= True; but the image is not centered. Hi, after loading image try to add this: TuniImage(YoureUniImage).Invalidate; TuniImage(YoureUniImage).JSInterface.JSCall('updateLayout', []); Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted April 20, 2023 Share Posted April 20, 2023 Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.