iOS Question How to code ImageView in B4i?

Vern

Member
Licensed User
Longtime User
I need to convert the B4a code below for B4i but can't find any examples. How do I code it?

B4X:
Sub Globals
    Private ImageView1 As ImageView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Image_landscape")
    Dim bmp As Bitmap = LoadBitmapResize(filedir, filename, ImageView1.Width, ImageView1.Height, True)
    bmp.Initialize(filedir, filename)
    ImageView1.SetBackgroundImage(bmp).Gravity = Gravity.FILL
End Sub
 

Alexander Stolte

Expert
Licensed User
Longtime User
It is much easier, the following code works B4X
I need to convert the B4a code below for B4i but can't find any examples. How do I code it?
B4X:
Private ImageView1 As B4XView
ImageView1.SetBitmap(xui.LoadBitmapResize(filedir,filename,ImageView1.Width,ImageView1.Height,True))
 
Upvote 0
Top