Dim bmpImage As Bitmap
Dim imgImage As ImageView
Dim bmpEx As BitmapExtended
Dim LayoutVal As LayoutValues
LayoutVal = GetDeviceLayoutValues
bmpImage.InitializeSample(File.DirAssets, "image.jpg", LayoutVal.Width, LayoutVal.Height)
Dim dScale As Double
dScale = (bmpEx.getHeight(bmpImage) * 100) / bmpEx.getWidth(bmpImage)
dScale = dScale / 100
imgImage.Initialize("")
imgImage.Gravity = Bit.OR(Gravity.CENTER, Gravity.FILL)
imgImage.Bitmap = bmpImage
Activity.AddView(imgImage, 0, 0, 100%x, (100%x * dScale))