andyhill Posted December 23, 2020 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
eduardosuruagy Posted April 20, 2023 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
Sherzod Posted April 20, 2023 Posted April 20, 2023 42 minutes ago, eduardosuruagy said: loading the image at runtime How? Quote
irigsoft Posted April 20, 2023 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
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.