MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
Dim G1 As ColorGradient
G1.Initialize
G1.GradientToView(Pane1,G1.PatternColor(0),"BL_TR",xui.Color_Black,0dip,20dip)
G1.GradientToView(Pane2,G1.PatternColor(1),"BL_TR",xui.Color_Black,0dip,20dip)
G1.GradientToView(Pane3,G1.PatternColor(4),"BL_TR",xui.Color_Black,0dip,20dip)
G1.GradientToView(Label11,G1.PatternColor(5),"BL_TR",xui.Color_Black,0dip,20dip)
G1.GradientToView(Label12,Array As Int(0xFFFEAC00,0xFFF3FD00),"BL_TR",xui.Color_Black,0dip,20dip)
Sleep(3000)
G1.GradientToView(Pane1,G1.PatternColor(7),"RADIAL",xui.Color_Black,0dip,20dip)
yes, the most unpleasant partand add
shadow a view....
????
I have made many attempts with Blur and Pixelate, only on a single color background it did not give satisfactory results but they got worseJudging by the look of your shadow, it seems like you're trying to create it by doing a fade. That's not really how shadows look. Instead try using a combination of black box, blur and transparency. (There's more to it, but if you get those things working you're 80% there.)
I should create a special function that creates a grayscale with a certain degree of opacity but not uniform (I don't know how to do it) with a displacement effect that is indicated here with the distance and angle value.I found a picture from some image editor that kind of show how to make the shadow. I realize it's not from the B4X world, but it shows the remaining 20%:
Strangely it doesn't show a value for softness (=how much blur to apply)
- Angle
- Size
- Distance
- Opacity
- Color
View attachment 102151
Let me know if you need a more help with the concepts, that I can do. I don't really have a grasp on how to make it a reality in B4X though.
tried all effects yesterday, but with poor resultsCan be useful?
as orientation fade bordes:
[B4X] BitmapCreator Effects
BitmapCreatorEffects class includes all kinds of very simple to use image effects. The class is cross platform and compatible with B4J (v6.3+), B4A (v8.3+) and B4i (v5.0+). Example: 'Greyscale an image: Dim GreyImage As B4XBitmap = effects.GreyScale(ExistingBmp) 'Blur an image: Dim BlurImage As...www.b4x.com
????
This is similar to the one already made, simply turned to gray levelCome on! You can do it!!
[B4X] [XUI] Shadows
I have created a very simple little code to create the shadow to the images in the views, it can also be used to transform colors into shades of gray. (Attached source code) N.B.: Use B4XCreator B4A B4Jwww.b4x.com
????
Looking at your screenshot, it seems to have most things that would be required, but I'm missing size, opacity and amount of blur to make a generic shadow function. Not having them as values might make the shadows conform more to the OS standard, though. So perhaps it's a reasonable compromise.You can let the OS do the job for you.
Even if i get mad at the idea of generating a shadow from code i accepted your suggestion.You can let the OS do the job for you.
In B4A it is done by setting the panel's elevation.
In B4J:
View attachment 102164
(can also be done programmatically if needed)
B4i: View.SetShadow.
Public Sub ShadowToView(Vw As B4XView, ShadowsWidth As Float)
#If B4a
Dim jo As JavaObject
jo.InitializeStatic("android.os.Build.VERSION")
If 21<=jo.GetField("SDK_INT") Then
Dim jo As JavaObject = Vw
jo.RunMethod("setElevation", Array As Object(ShadowsWidth))
End If
#else If B4J
Dim Native As Node = Vw
Dim m As Matcher = Regex.Matcher($"-fx-effect: innershadow:[^;]+;"$, Native.Style)
If m.Find Then
Native.Style=$"${Native.Style.SubString2(0, m.GetStart(0))} -fx-effect: innershadow( gaussian , rgba(100,100,100,0.3) , 5,0,$1.0{-ShadowsWidth},$1.0{-ShadowsWidth} );${Native.Style.SubString(m.GetEnd(0))}"$
Else
Native.Style = $"${Native.style} -fx-effect: innershadow( gaussian , rgba(100,100,100,0.3) , 5,0,$1.0{-ShadowsWidth},$1.0{-ShadowsWidth} );"$
End If
#else if b4i
Dim Native As View = Vw
Native.SetShadow(xui.Color_LightGray,ShadowsWidth,ShadowsWidth,0.5,True)
#End If
End Sub
sure, this is just an experiment to prove the effects. But the colors can be changedMay I suggest dark mode? or some tweaks? Because this is completely unreadable to my old eyes:
View attachment 102367
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?