Angel Garcia Member Licensed User Jul 16, 2020 #1 Hello all, I've been trying this new B4XView and it works great but, i need a function or something to stop the loop of the gif or to set to Null to the control. I have already tried: Code: Copy B4XGifView1.mBase.SetBitmap(Null) B4XGifView1.GifDrawable=Null With no success, only thing to do like a "workaround" is to hide the gif with this: B4XGifView1.mBase.Visible= False Is there a better way? Am i missing something? Many thanks in advance!
Hello all, I've been trying this new B4XView and it works great but, i need a function or something to stop the loop of the gif or to set to Null to the control. I have already tried: Code: Copy B4XGifView1.mBase.SetBitmap(Null) B4XGifView1.GifDrawable=Null With no success, only thing to do like a "workaround" is to hide the gif with this: B4XGifView1.mBase.Visible= False Is there a better way? Am i missing something? Many thanks in advance!
JohnC Expert Licensed User Longtime User Jul 16, 2020 #2 If the B4X Gif viewer doesn't have any kind of "stop" method, then you could take a screen shot of a frame from the gif (the frame that you like the best), and then when you want to "stop" the animation, load the bitmap of that one frame into the B4XGifViewer. Upvote 0
If the B4X Gif viewer doesn't have any kind of "stop" method, then you could take a screen shot of a frame from the gif (the frame that you like the best), and then when you want to "stop" the animation, load the bitmap of that one frame into the B4XGifViewer.
Angel Garcia Member Licensed User Jul 16, 2020 #3 Hi John, I just tried what you said but, now the snapshot bitmap is overlaped to the animation and still looping behind hahaha. ? I think there should be a function to set to Null the GifDrawable, but i cant find the proper method. Any other ideas? Upvote 0
Hi John, I just tried what you said but, now the snapshot bitmap is overlaped to the animation and still looping behind hahaha. ? I think there should be a function to set to Null the GifDrawable, but i cant find the proper method. Any other ideas?
JohnC Expert Licensed User Longtime User Jul 16, 2020 #4 I haven't used the B4X Gif Viewer, but that might be a bug because if you load a new bitmap into it, it should replace the existing one. Upvote 0
I haven't used the B4X Gif Viewer, but that might be a bug because if you load a new bitmap into it, it should replace the existing one.
Erel B4X founder Staff member Licensed User Longtime User Jul 17, 2020 #5 This code is used in the Pleroma client to remove and immediately release images: Code: Copy Consumer.GifTarget.mBase.GetView(0).SetBitmap(Null) #if B4A If Consumer.GifTarget.GifDrawable.IsInitialized Then Consumer.GifTarget.GifDrawable.RunMethod("recycle", Null) End If #End If Upvote 0
This code is used in the Pleroma client to remove and immediately release images: Code: Copy Consumer.GifTarget.mBase.GetView(0).SetBitmap(Null) #if B4A If Consumer.GifTarget.GifDrawable.IsInitialized Then Consumer.GifTarget.GifDrawable.RunMethod("recycle", Null) End If #End If
Angel Garcia Member Licensed User Jul 17, 2020 #6 Hello! Thank you Erel, You solution worked perfectly!! To trigger the animation i used: Code: Copy B4XGifView1.SetGif(File.DirAssets, "Graph_10s.gif") And to stop it: Code: Copy If B4XGifView1.GifDrawable.IsInitialized=True Then B4XGifView1.mBase.GetView(0).SetBitmap(Null) B4XGifView1.GifDrawable.RunMethod("recycle",Null) B4XGifView1.GifDrawable=Null End If Cheers!! Upvote 0
Hello! Thank you Erel, You solution worked perfectly!! To trigger the animation i used: Code: Copy B4XGifView1.SetGif(File.DirAssets, "Graph_10s.gif") And to stop it: Code: Copy If B4XGifView1.GifDrawable.IsInitialized=True Then B4XGifView1.mBase.GetView(0).SetBitmap(Null) B4XGifView1.GifDrawable.RunMethod("recycle",Null) B4XGifView1.GifDrawable=Null End If Cheers!!