T thebaldconvict Member Licensed User Longtime User Jul 13, 2012 #1 Hi all, A quick question if I may, (I have searched a fair while but can't see anything). I've been using Basic4android for only a few days but am getting to grips with it, its amazing how powerful it is and how I can now not use Java.... anyway... In my app I've made the splash screen be an imageview that is full screen and a timer runs for 3 seconds before disabling the timer and changing the visible property of the imageview to false. What I actually wanted was for the imageview to fade to transparent leaving the main app screen in view but I cant find any way to adjust the alpha or transparency settings. Could anybody please help, this and my little sound problem (not sure how to play click sounds etc) are the last ones before I can release my first app! Thanks in advance Tim
Hi all, A quick question if I may, (I have searched a fair while but can't see anything). I've been using Basic4android for only a few days but am getting to grips with it, its amazing how powerful it is and how I can now not use Java.... anyway... In my app I've made the splash screen be an imageview that is full screen and a timer runs for 3 seconds before disabling the timer and changing the visible property of the imageview to false. What I actually wanted was for the imageview to fade to transparent leaving the main app screen in view but I cant find any way to adjust the alpha or transparency settings. Could anybody please help, this and my little sound problem (not sure how to play click sounds etc) are the last ones before I can release my first app! Thanks in advance Tim
R Roger Garstang Well-Known Member Licensed User Longtime User Jul 13, 2012 #2 Might be other ways, but do you know the background color behind it? If so you could draw over the top of it with a color equal to the background and vary the alpha of the color using a timer or something until it covers the image. Once covered you could then remove the image since it is underneath the object covering it. Once image is gone you could even remove the object you used to cover it. Might even be able to draw right on the image with a canvas and repeat coloring with the background color at a low percent like 1 and do it 255 times or 2 and do it 128 times, etc which if the calculations are right should cover it. Last edited: Jul 13, 2012 Upvote 0
Might be other ways, but do you know the background color behind it? If so you could draw over the top of it with a color equal to the background and vary the alpha of the color using a timer or something until it covers the image. Once covered you could then remove the image since it is underneath the object covering it. Once image is gone you could even remove the object you used to cover it. Might even be able to draw right on the image with a canvas and repeat coloring with the background color at a low percent like 1 and do it 255 times or 2 and do it 128 times, etc which if the calculations are right should cover it.
T thebaldconvict Member Licensed User Longtime User Jul 13, 2012 #3 Unfortunately, the background of the view is an image with a coloured pattern on it so there isn't as such a colour to fade too.... Upvote 0
Unfortunately, the background of the view is an image with a coloured pattern on it so there isn't as such a colour to fade too....
mc73 Well-Known Member Licensed User Longtime User Jul 13, 2012 #4 Perhaps you could create another 2-3 versions of your image, which would be designed in such a way that a fade-out effect appears. Upvote 0
Perhaps you could create another 2-3 versions of your image, which would be designed in such a way that a fade-out effect appears.
T thebaldconvict Member Licensed User Longtime User Jul 13, 2012 #5 The only other thing I could think of doing was moving the imageview offscreen before setting it as not visible giving the effect of it sliding off but it seems a bit of a compromise Sent from my Galaxy Note using Tapatalk Upvote 0
The only other thing I could think of doing was moving the imageview offscreen before setting it as not visible giving the effect of it sliding off but it seems a bit of a compromise Sent from my Galaxy Note using Tapatalk
R Roger Garstang Well-Known Member Licensed User Longtime User Jul 13, 2012 #6 I kinda like mc73's idea. Might even be possible to use some other drawing library to render PNGs of your image at different alpha levels. I know PHP can do it too if you make use of a web server for other things you could use it to render the images. Upvote 0
I kinda like mc73's idea. Might even be possible to use some other drawing library to render PNGs of your image at different alpha levels. I know PHP can do it too if you make use of a web server for other things you could use it to render the images.
NJDude Expert Licensed User Longtime User Jul 13, 2012 #7 You can find a Fading Sample HERE not exactly what you're looking for but might help you out. Upvote 0
margret Well-Known Member Licensed User Longtime User Jul 14, 2012 #8 I liked your idea, so I thought I would see if I could write a class quicky to do this. This may be what you wanted, you are welcome to try. Below is a sample of the code in your Activity and attached is the Class code Zipped. You will need B4A 2.02. Code: Copy Sub Globals Dim MyFade As fade End Sub Sub Activity_Create(FirstTime As Boolean) 'Put your code here End Sub Sub Activity_Resume MyFade.Initialize(Activity, Me, "1.jpg", 6000, 100) End Sub Attachments fade.zip fade.zip 803 bytes · Views: 758 Upvote 0
I liked your idea, so I thought I would see if I could write a class quicky to do this. This may be what you wanted, you are welcome to try. Below is a sample of the code in your Activity and attached is the Class code Zipped. You will need B4A 2.02. Code: Copy Sub Globals Dim MyFade As fade End Sub Sub Activity_Create(FirstTime As Boolean) 'Put your code here End Sub Sub Activity_Resume MyFade.Initialize(Activity, Me, "1.jpg", 6000, 100) End Sub
S susu Well-Known Member Licensed User Longtime User Jul 14, 2012 #9 You can also use Animation library with InitializeAlpha. Read Erel's tutorial here: http://www.b4x.com/forum/basic4andr...ls/6967-android-views-animation-tutorial.html Upvote 0
You can also use Animation library with InitializeAlpha. Read Erel's tutorial here: http://www.b4x.com/forum/basic4andr...ls/6967-android-views-animation-tutorial.html
T thebaldconvict Member Licensed User Longtime User Jul 14, 2012 #10 margret said: I liked your idea, so I thought I would see if I could write a class quicky to do this. This may be what you wanted, you are welcome to try. Below is a sample of the code in your Activity and attached is the Class code Zipped. You will need B4A 2.02. Code: Copy Sub Globals Dim MyFade As fade End Sub Sub Activity_Create(FirstTime As Boolean) 'Put your code here End Sub Sub Activity_Resume MyFade.Initialize(Activity, Me, "1.jpg", 6000, 100) End Sub Click to expand... Thanks Margret, that works really really well :sign0098: One more question, the image is bigger than the screen so that it fits on all devices and I'd made the imageview "fit" the image, using your class its showing full size so the picture doesn't fit. Is there any way I can change it to fit the screen? Many thanks again Ahhhh done it, changed the line in the class: Code: Copy 'BitImage.Gravity = Gravity.CENTER BitImage.Gravity = Gravity.FILL That is awesome! Thank you so much! Last edited: Jul 14, 2012 Upvote 0
margret said: I liked your idea, so I thought I would see if I could write a class quicky to do this. This may be what you wanted, you are welcome to try. Below is a sample of the code in your Activity and attached is the Class code Zipped. You will need B4A 2.02. Code: Copy Sub Globals Dim MyFade As fade End Sub Sub Activity_Create(FirstTime As Boolean) 'Put your code here End Sub Sub Activity_Resume MyFade.Initialize(Activity, Me, "1.jpg", 6000, 100) End Sub Click to expand... Thanks Margret, that works really really well :sign0098: One more question, the image is bigger than the screen so that it fits on all devices and I'd made the imageview "fit" the image, using your class its showing full size so the picture doesn't fit. Is there any way I can change it to fit the screen? Many thanks again Ahhhh done it, changed the line in the class: Code: Copy 'BitImage.Gravity = Gravity.CENTER BitImage.Gravity = Gravity.FILL That is awesome! Thank you so much!
margret Well-Known Member Licensed User Longtime User Jul 14, 2012 #11 Hello, Glad this is working for you! In the class code you will see line # 21 and it reads like below: Code: Copy BitImage.Gravity = Gravity.CENTER Change it to: Code: Copy BitImage.Gravity = Gravity.FILL Upvote 0
Hello, Glad this is working for you! In the class code you will see line # 21 and it reads like below: Code: Copy BitImage.Gravity = Gravity.CENTER Change it to: Code: Copy BitImage.Gravity = Gravity.FILL
D dclarkchem Member Licensed User Longtime User Feb 12, 2014 #12 margret said: I liked your idea, so I thought I would see if I could write a class quicky to do this. This may be what you wanted, you are welcome to try. Below is a sample of the code in your Activity and attached is the Class code Zipped. You will need B4A 2.02. Code: Copy Sub Globals Dim MyFade As fade End Sub Sub Activity_Create(FirstTime As Boolean) 'Put your code here End Sub Sub Activity_Resume MyFade.Initialize(Activity, Me, "1.jpg", 6000, 100) End Sub Click to expand... Wow, thanks! Exactly what I was looking for ! ! ! Upvote 0
margret said: I liked your idea, so I thought I would see if I could write a class quicky to do this. This may be what you wanted, you are welcome to try. Below is a sample of the code in your Activity and attached is the Class code Zipped. You will need B4A 2.02. Code: Copy Sub Globals Dim MyFade As fade End Sub Sub Activity_Create(FirstTime As Boolean) 'Put your code here End Sub Sub Activity_Resume MyFade.Initialize(Activity, Me, "1.jpg", 6000, 100) End Sub Click to expand... Wow, thanks! Exactly what I was looking for ! ! !
Informatix Expert Licensed User Longtime User Feb 12, 2014 #13 dclarkchem said: Wow, thanks! Exactly what I was looking for ! ! ! Click to expand... You can also use the BetterImageView library. Upvote 0
dclarkchem said: Wow, thanks! Exactly what I was looking for ! ! ! Click to expand... You can also use the BetterImageView library.