I have an app which at certain time displays an image with some HotSpots. As you can see from the code I thought I had solved the problem of different devices scaling the hotspot location differently by using the %x and %y.
Everything works perfectly on most phone and tablets except the S3 Mini which, for some reason stretches the height of the bitmap, distorting it and therefore allows the hotspots to show in the wrong place.
Does anyone know how I might solve this one, please?
Cheers
Penfound
B4X:
Dim Canv AsCanvas
Dim Bitmap1 AsBitmap
Bitmap1.Initialize(File.DirAssets,"UnderBonnet.jpg")
Dim DestRect AsRect
bmpTop = QLabel.Height+10
bmpLeft = 0
bmpRight = 100%X
bmpBottom = bmpTop + Bitmap1.height
lblInstructions.Top=bmpBottom
DestRect.Initiialize(bmpLeft,bmpTop,bmpRight,bmpBottom)
Canv.Initialize(Panel1)
Canv.DrawBitmap(Bitmap1,Null,DestRect)
HotSpotLib.Initialize
Dim Id AsInt
WhsLeft = bmpLeft+8.5%x
WhsTop = bmpTop+10.5%y
WhsDia = 3.5%y
ChsLeft = bmpLeft+5.5%x
ChsTop = bmpTop+15%y
ChsDia = 3.5%y
BhsLeft = bmpLeft+90.5%x
BhsTop = bmpTop+7.2%y
BhsDia = 3.5%y
OhsLeft = bmpLeft+35.5%x
OhsTop = bmpTop+28%y
Ohsdia = 4%y
hsx1 = bmpLeft+7%x
hsx2 = bmpLeft+9.4%x
hsx3 = bmpLeft+5.5%y
hsy1 = bmpTop+16%y
hsy2 = bmpTop+17.5%y
Does anyone know how I might solve this one, please?
Cheers
Penfound