I have edittext and an image in imageview. Image maintains aspect ratio , using modified code from this post - POST .I want to place edittext on certain place of image. But there are a lot of resolutions so it is a problem. What is the best way to do it ? Maybe there is a possibility to check pixel color of image and if it is transparent for example so place there edittext form ? Thanks.
I have a layout made in designer. There is an imageview (100%x,Activity.Height-90dip) and a few edittext forms. I wanted to use designer script but image maintain its aspect ratio so on other resolutions there is a little blank place over image iself and under image.
I assume that you know the correct location in the original image. The image is linearly scaled. This means that you just need to do the following calculation:
B4X:
newX = x * NewWidth / OldWidth
newY = y * NewHeight / OldHeight
Thank you very much Erel. How I understood I must do all calculations inside code and then edittext.setlayout with this parameters ? Also one problem that I have images for different densities - ldpi , mdpi , hdpi , xhdpi and xxhdpi made according to Google designer guidlines and i have only right places of edittext forms for mdpi image. I think I understand that doesn't matter because I know scale factor of image 0.75 , 1 , 1.5 ,2 ,3.