Sometimes I want to see images in SMM with rounded corners and I have to resort to external routines to do it.
And reviewing the SMM code, I see the feasibility of adding the image corner radii parameter (B4XImageView).
Greetings
example:
And reviewing the SMM code, I see the feasibility of adding the image corner radii parameter (B4XImageView).
Greetings
SMMViews:
Public Sub AddMedia(RequestSet As SMMediaRequestSet, MEDIA As SMMedia, Request As SMMediaRequest)
#if SMM_DEBUG
Log("AddMedia: " & MEDIA.Meta.Key)
#End If
Dim Target As B4XView = RequestSet.Target
CancelRequest(Target)
Dim ViewType As Int = MediaTypeToViewType(MEDIA.Meta.MediaType, Request)
Dim sm As SMMView = GetView(ViewType, MEDIA.Meta.Key)
Target.Color = Request.Extra.GetDefault(mManager.REQUEST_BACKGROUND, mManager.DefaultBackgroundColor)
TargetToSMMViews.Put(Target, sm)
Target.AddView(sm.mBase, 0, 0, Target.Width, Target.Height)
Dim FadeAnimation As Int = Request.Extra.GetDefault(mManager.REQUEST_FADE_ANIMATION_DURATION, mManager.DefaultFadeAnimationDuration)
If FadeAnimation > 0 Then
sm.mBase.Visible = False
sm.mBase.SetVisibleAnimated(FadeAnimation, True)
Else
sm.mBase.Visible = True
End If
Select ViewType
Case VIEW_TYPE_B4XIMAGEVIEW
Dim x As B4XImageView = sm.CustomView
x.RoundedImage = Request.Extra.GetDefault(mManager.REQUEST_ROUNDIMAGE, False)
x.ResizeMode = Request.Extra.GetDefault(mManager.REQUEST_RESIZE_MODE, mManager.DefaultResizeMode)
x.Bitmap = MediaToBitmap(MEDIA)
#if B4A
If mManager.IsWebPAnimated (MEDIA) Then
Dim decoder As JavaObject
Dim Drawable As JavaObject = decoder.InitializeStatic("android.graphics.ImageDecoder").RunMethod("decodeDrawable", Array(MEDIA.Media))
x.mBase.GetView(0).As(View).Background = Drawable
If GetType(Drawable) = "android.graphics.drawable.AnimatedImageDrawable" Then
Drawable.RunMethod("start", Null)
End If
End If
#End If
Case VIEW_TYPE_GIFVIEW
example:
Last edited: