Android Question How to set background image on shapeimageview?

mr.gedo

Member
Hello everyone,

i try to use this lib https://www.b4x.com/android/forum/threads/shapeimageview.70398/

when i try to set background image it's be outside the shape i don't know what's problem exactly

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
Dim shape As ShapeImageView
End Sub


Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("1")
    
    
    shape.Initialize("shape")
    Activity.AddView(shape, 10dip, 10dip, 200dip, 200dip)
    shape.BorderColor=Colors.Blue
    shape.BorderWidth=3
    shape.Text="Test"
    shape.ShapeType=shape.SHAPE_CIRCLE
    
    Dim bg As BitmapDrawable
    bd.Initialize(LoadBitmap(File.DirAssets, "preview.png"))
    shape.Background=bg

End Sub
 
Top