B4J Question [SOLVED] Is it possible to use ZoomImageView with SimpleMediaManager to display an image from a local file?

oleg_

Member
Licensed User

I mean instead of

B4X:
MediaManager.SetMediaWithExtra(Panel1, "https://image.link", "", CreateMap(MediaManager.REQUEST_ZOOMIMAGEVIEW: True))

write something like this

B4X:
MediaManager.SetMediaWithExtra(Panel1, "file://localhost/C:/01.jpg", "", CreateMap(MediaManager.REQUEST_ZOOMIMAGEVIEW: True))
 

Daestrum

Expert
Licensed User
Longtime User
Try (notice 3 slashes)

file:///c:/01.jpg

Assuming the file in in root directory of C

to test you have the correct url, type it into your browser, if it's correct it will display the image.
 
Last edited:
Upvote 0

oleg_

Member
Licensed User
Try (notice 3 slashes)

file:///c:/01.jpg

Assuming the file in in root directory of C

Thanks for the answer, but unfortunately it doesn't work that way.

Here's the result:

B4X:
 MediaManager.SetMediaWithExtra(pnl_Picture_show_panel, "file:///c:/01.jpg", "", CreateMap(MediaManager.REQUEST_ZOOMIMAGEVIEW: True))

WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
Waiting for debugger to connect...
Program started.
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
Invalid link: file:///c:/01.jpg

to test you have the correct url, type it into your browser, if it's correct it will display the image.
Yes, it works fine in the browser, but in the program, alas, it doesn’t.
 
Last edited:
Upvote 0

oleg_

Member
Licensed User
Yes, use SMM.SetMediaFromFile
Thank you, Erel! This really works great!
B4X:
    MediaManager.SetMediaFromFile (pnl_Picture_show_panel, "c:/", "01.jpg", "image/*", CreateMap(MediaManager.REQUEST_ZOOMIMAGEVIEW: True))
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…