Up until now, I have been using canvas and bitmap, to put info on a screen. I'm extremely used-to quoting dimensions as a percentage of the screen (eg. 50%x)
I just tried to create an image view in the middle of the screen with its child bitmap dimensions:
I was expecting the imageview to be in the middle of the screen, but it obviously wasn't (it was in the bottom right), and it wasn't the size of the df1 bitmap(too big). Dividing the values by density (eg. 50%x/density-5%x /density) comes close, but the imageview is still too big. What am I doing wrong? How do I go from CurrenttoDip?:BangHead::sign0013:
I just tried to create an image view in the middle of the screen with its child bitmap dimensions:
B4X:
Dim df1 As Bitmap
Dim dfv As ImageView
df1.InitializeSAMPLE(File.DirAssets,"df1.png",10%x,398*10%x/665)
dfv.Initialize("")
activity.AddView(dfv,50%x-5%x,50%y-10%x/df1.Width*df1.height/2,50%x+5%x,50%y+10%x/df1.Width*df1.height/2)
dfv.Bitmap = df1