hi
I'm capturing a screenshot.
when I capture a new screenshot it still shows the old one.
How can I fix.
B4X:
Sub Button1_Click
............
bitmap1.Initialize3(vv.TakeScreenshot)
Dim Out As OutputStream
Out = File.OpenOutput(dir, "image.jpg", False)
bitmap1.WriteToStream(Out, 100, "JPEG")
Out.Close
MediaManager.SetMediaFromFile(Panel2, dir, "image.jpg","image/*", CreateMap(MediaManager.REQUEST_ZOOMIMAGEVIEW: True))
End Sub
When taking a Snapshot of the screen, images loaded with SimpleMediaManager are not displayed on the image. Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 Root.LoadLayout("MainPage") MediaManager.Initialize End Sub Private Sub Button1_Click...
When taking a Snapshot of the screen, images loaded with SimpleMediaManager are not displayed on the image. Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 Root.LoadLayout("MainPage") MediaManager.Initialize End Sub Private Sub Button1_Click...
I used MediaReady. the result did not change.
I'm capturing a video screenshot. when I capture it again it doesn't show the new screenshot. shows the previous screenshot
Sub Capture_Click
............
bitmap1.Initialize3(vv.TakeScreenshot)
Dim Out As OutputStream
Out = File.OpenOutput(dir, "image.jpg", False)
bitmap1.WriteToStream(Out, 100, "JPEG")
Out.Close
MediaManager.SetMediaFromFile(Panel2, dir, "image.jpg","image/*", CreateMap(MediaManager.REQUEST_ZOOMIMAGEVIEW: True))
End Sub
Sub Capture_Click
............
bitmap1.Initialize3(vv.TakeScreenshot)
Dim Out As OutputStream
Out = File.OpenOutput(dir, "image.jpg", False)
bitmap1.WriteToStream(Out, 100, "JPEG")
Out.Close
MediaManager.SetMediaFromFile(Panel2, dir, "image.jpg","image/*", CreateMap(MediaManager.REQUEST_ZOOMIMAGEVIEW: True))
End Sub
Example project with webview. It takes a screenshot but if I want to take it again when I scroll down to the bottom of the page, it doesn't refresh. Shows the previous picture.
1. You should switch to B4XPages. You are not handling the activities life cycle correctly.
2. There is no good reason to use GetSafeDirDefaultExternal. Use XUI.DefaultFolder / File.DirInternal
One of the features of SMM is that it manages a sophisticated images cache. It will not load the image again unless you change the image name or disable the cache.