mitsusdev Member Licensed User Longtime User Jan 21, 2014 #1 What is the best way for do a graphic menu multi-resolution ? I have done a test with buttons, but for some devices the single button are moved. ok finger 3 is in bad position and the all menu is small and not center (galaxy tab - 600x1024 1.5 - 250 dpi)
What is the best way for do a graphic menu multi-resolution ? I have done a test with buttons, but for some devices the single button are moved. ok finger 3 is in bad position and the all menu is small and not center (galaxy tab - 600x1024 1.5 - 250 dpi)
Erel B4X founder Staff member Licensed User Longtime User Jan 21, 2014 #2 You should use percentage for all the positions. This way the buttons will be resized together with the background image. Upvote 0
You should use percentage for all the positions. This way the buttons will be resized together with the background image.
mitsusdev Member Licensed User Longtime User Jan 23, 2014 #3 Sorry Erel maybe, i don't understand i'm capture the percentage of top, left, height and width for each button. Code: Copy Perc(0) = (Dito1.Top * 100) / Activity.Height Perc(1) = (Dito1.Left * 100) / Activity.Width Perc(2) = (Dito1.Width * 100) / Activity.Width Perc(3) = (Dito1.Height * 100) / Activity.Height and other buttons Code: Copy 'Dito1 Perc=54.651161193847656 Perc=9.375 Perc=16.5625 Perc=8.60465145111084 and other buttons after i use these percetanges for set top and left postision on each device Code: Copy Dito1.Top = (Activity.Height / 100) * 54.651161193847656 Dito1.Left = (Activity.Width / 100) * 9.375 Dito1.Width = (Activity.Width / 100) * 16.5625 Dito1.Height = (Activity.Height / 100) * 8.60465145111084 but the result is this. Upvote 0
Sorry Erel maybe, i don't understand i'm capture the percentage of top, left, height and width for each button. Code: Copy Perc(0) = (Dito1.Top * 100) / Activity.Height Perc(1) = (Dito1.Left * 100) / Activity.Width Perc(2) = (Dito1.Width * 100) / Activity.Width Perc(3) = (Dito1.Height * 100) / Activity.Height and other buttons Code: Copy 'Dito1 Perc=54.651161193847656 Perc=9.375 Perc=16.5625 Perc=8.60465145111084 and other buttons after i use these percetanges for set top and left postision on each device Code: Copy Dito1.Top = (Activity.Height / 100) * 54.651161193847656 Dito1.Left = (Activity.Width / 100) * 9.375 Dito1.Width = (Activity.Width / 100) * 16.5625 Dito1.Height = (Activity.Height / 100) * 8.60465145111084 but the result is this.
Erel B4X founder Staff member Licensed User Longtime User Jan 24, 2014 #4 This is how I would have done it. Use a background image for the drawing. The buttons should be transparent. You do not need to do these calculations. Just need to find the correct place of each button. Code: Copy Activity.AddView(Button1, 15%x, 50%y, 20%x, 55%y) 'just an example Upvote 0
This is how I would have done it. Use a background image for the drawing. The buttons should be transparent. You do not need to do these calculations. Just need to find the correct place of each button. Code: Copy Activity.AddView(Button1, 15%x, 50%y, 20%x, 55%y) 'just an example
mitsusdev Member Licensed User Longtime User Jan 24, 2014 #5 Thank you i have resolve with set gravity to fill. the dimensions were good, but the images were small. i'm try your solution with percentace format, but the form of hand is bad. some device have 1.5 of ratio, other device have 1.7 of ratio. for a good form the ratio must be the same. Upvote 0
Thank you i have resolve with set gravity to fill. the dimensions were good, but the images were small. i'm try your solution with percentace format, but the form of hand is bad. some device have 1.5 of ratio, other device have 1.7 of ratio. for a good form the ratio must be the same.