Android Question [B4X] SimpleMediaManager (SMM) - REQUEST_ZOOMIMAGEVIEW

Hi
When I Use REQUEST_ZOOMIMAGEVIEW With SimpleMediaManager like this :
Ex:
MediaManager.SetMediaWithExtra(Panel1, "https://image.link", "", CreateMap(MediaManager.REQUEST_ZOOMIMAGEVIEW: True))
And I Use image format ".png"...
I needs background color black but in realese background is white
After When i use REQUEST_BACKGROUND for change color but not work
any Idea?
 
Solution
Thanks now is worked!
?

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Yes I added!
I dont't have problem use SimpleMediaManager

Main:
Dim extra_1 As Map = CreateMap(MediaManager.REQUEST_BACKGROUND: xui.Color_Yellow)
MediaManager.SetMediaWithExtra(Pane1, "https://bayanbox.ir/view/6340604828595145875/AdminProfile.png","",extra_1)

Dim extra_2 As Map = CreateMap(MediaManager.REQUEST_ZOOMIMAGEVIEW: True, MediaManager.REQUEST_BACKGROUND: xui.Color_Yellow)
MediaManager.SetMediaWithExtra(Pane2, "https://bayanbox.ir/view/6340604828595145875/AdminProfile.png", "", extra_2)

I say When I use REQUEST_ZOOMIMAGEVIEW my background is white however i add REQUEST_BACKGROUND why not work? how i can do?
 

Attachments

  • 1653364182432.png
    77.1 KB · Views: 246
Upvote 0
Work in B4x
Is it possible to run it in the B4A? Because I Get This Error

*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
java.lang.RuntimeException: java.lang.RuntimeException: Method: getBA not found in: b4a.example.main
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1719)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6176)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781)
Caused by: java.lang.RuntimeException: Method: getBA not found in: b4a.example.main
at anywheresoftware.b4j.object.JavaObject$MethodCache.getMethod(JavaObject.java:363)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:120)
at anywheresoftware.b4j.object.JavaObject.RunMethodJO(JavaObject.java:139)
at b4a.example.smmviews$ResumableSub_AddMedia.resume(smmviews.java:312)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1717)
... 7 more
 
Upvote 0
It doesn't look related to this code.
you say here
I think problem this here:
1. The callback (Me in this case) must be a class, such as a B4XPages page.
when i use you cod in b4xpage worked! but in activity b4a test and not run How I can use this cod in "Class" ?
 
Upvote 0
Something is wrong!
Part of Background is not black?
How I can Do?
 
Upvote 0
 

Attachments

  • SMM_background.zip
    10.4 KB · Views: 253
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Change to:
B4X:
Private Sub SetZoomImageViewMedia(Panel As B4XView, Url As String, BackgroundColor As Int)
    MediaManager.SetMediaWithExtra(Panel, Url, "", CreateMap(MediaManager.REQUEST_CALLBACK: Me, MediaManager.REQUEST_ZOOMIMAGEVIEW: True, _
        MediaManager.REQUEST_BACKGROUND: BackgroundColor))
    Wait For (Panel) SMM_MediaReady (Success As Boolean, Media As SMMedia)
    If Success Then
        Dim zv As ZoomImageView = Panel.GetView(0).Tag
        zv.pnlBackground.Color = BackgroundColor
        zv.mBase.Color = BackgroundColor
    End If
End Sub
 
Upvote 0
Thanks now is worked!
?
 
Upvote 0
Solution
Cookies are required to use this site. You must accept them to continue using the site. Learn more…