I have this code :
First it's called "Camera1_PictureTaken", then "ShowImage" which calls "SetZoomImageViewMedia".
In SetZoomImageViewMedia, frsit line (MediaManager.SetMediaWithExtra) I got error : Invalid link: file:///data/user/0/softwise.ebrojilo/files/cp.jpg
File, of course exists as check on "ShowImage" is true (If File.Exists(dir, filename) Then).
What I'm doing wrong?
B4X:
Sub Camera1_PictureTaken (Data() As Byte)
Dim filename As String = "cp.jpg"
Dim dir As String = File.DirInternal
camEx.SavePictureToFile(Data, dir, filename)
End Sub
Private Sub ShowImage
Dim filename As String = "cp.jpg"
Dim dir As String = File.DirInternal
Dim uri As String = xui.FileUri(File.DirInternal, filename)
If File.Exists(dir, filename) Then
MediaManager.Initialize
SetZoomImageViewMedia(pnlImage, uri, Colors.White)
End If
End Sub
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
First it's called "Camera1_PictureTaken", then "ShowImage" which calls "SetZoomImageViewMedia".
In SetZoomImageViewMedia, frsit line (MediaManager.SetMediaWithExtra) I got error : Invalid link: file:///data/user/0/softwise.ebrojilo/files/cp.jpg
File, of course exists as check on "ShowImage" is true (If File.Exists(dir, filename) Then).
What I'm doing wrong?