S Sub7 Active Member Licensed User Longtime User Dec 12, 2014 #1 Well it seems stupid but i miss something. Let say i have an imageview and i want to put a logo inside i set this imageview in the script editor in this way: Code: imgview.top = 0%y imgview.SetLeftAndRight(5%x,95%x) I know that i want the logo to cover almost all screen 5/95 but i dont know how to set the height correctly, for example in photoshop you can resize by keeping proportions, but here? Code: Dim imgwidth as int imgwidth = imgview.width Image gravity FILL how i can calculate the height so the image does not get streched knowing only the width? Thanks ps i tried something like this but is not ok Code: Dim logobmp As Bitmap logobmp.Initialize(File.DirAssets, "logo.png") Dim logoHeight As Int logoHeight = logobmp.Height /logobmp.Width *logobmp .Width imageview.Height = logoHeight img_imageview.Bitmap = logobmp
Well it seems stupid but i miss something. Let say i have an imageview and i want to put a logo inside i set this imageview in the script editor in this way: Code: imgview.top = 0%y imgview.SetLeftAndRight(5%x,95%x) I know that i want the logo to cover almost all screen 5/95 but i dont know how to set the height correctly, for example in photoshop you can resize by keeping proportions, but here? Code: Dim imgwidth as int imgwidth = imgview.width Image gravity FILL how i can calculate the height so the image does not get streched knowing only the width? Thanks ps i tried something like this but is not ok Code: Dim logobmp As Bitmap logobmp.Initialize(File.DirAssets, "logo.png") Dim logoHeight As Int logoHeight = logobmp.Height /logobmp.Width *logobmp .Width imageview.Height = logoHeight img_imageview.Bitmap = logobmp
LucaMs Expert Licensed User Longtime User Dec 12, 2014 #2 Maybe this can help you (thanks to Klaus): https://www.b4x.com/android/forum/threads/imageview-bitmap-centered.43779/ Upvote 0
Maybe this can help you (thanks to Klaus): https://www.b4x.com/android/forum/threads/imageview-bitmap-centered.43779/
S Sub7 Active Member Licensed User Longtime User Dec 12, 2014 #3 Ciao Luca, while this works and i've tried that before, this logo is a png file with transparency. the output of that function is correct image but with a white background which is not ok. Upvote 0
Ciao Luca, while this works and i've tried that before, this logo is a png file with transparency. the output of that function is correct image but with a white background which is not ok.
LucaMs Expert Licensed User Longtime User Dec 12, 2014 #4 attached: ImageView.Color = Colors.Blue png with transparency Attachments lm png tranparency.zip lm png tranparency.zip 43.5 KB · Views: 303 Upvote 0
S Sub7 Active Member Licensed User Longtime User Dec 13, 2014 #5 So was only that: imageview.Color = Colors.Transparent Grazie luca, nice xmass example. Upvote 0