B4J Question [SOLVED] Transparent form background

jroriz

Active Member
Licensed User
Longtime User
I need exactly like this, but the form has to be transparent. I want to do something like a mask.
Using this example the background of the form does not become transparent, even using f.SetFormStyle ("TRANSPARENT").
Any Help?
 

jroriz

Active Member
Licensed User
Longtime User
I need exactly like this, but the form has to be transparent. I want to do something like a mask.
Using this example the background of the form does not become transparent, even using f.SetFormStyle ("TRANSPARENT").
Any Help?
In fact is a B4J Question, I dont know how to move the question...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Moved to B4J forum.

SS-2018-03-07_08.25.38.png


B4X:
Sub Process_Globals
   Private fx As JFX
   Private MainForm As Form
   Private ox, oy As Double
End Sub

Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   MainForm.SetFormStyle("TRANSPARENT")
   MainForm.RootPane.LoadLayout("1")
   MainForm.Show
   MainForm.BackColor = fx.Colors.ARGB(50, 255, 0, 0)
   CSSUtils.SetBackgroundColor(MainForm.RootPane, fx.Colors.Transparent) 'can also be set with the designer
End Sub
Sub MainForm_MousePressed (EventData As MouseEvent)
   ox = EventData.X
   oy = EventData.Y
End Sub

Sub MainForm_MouseDragged (EventData As MouseEvent)
   Dim jo As JavaObject = EventData
   MainForm.WindowLeft = jo.RunMethod("getScreenX", Null) - ox
   MainForm.WindowTop = jo.RunMethod("getScreenY", Null) - oy
End Sub
 
Upvote 0

jroriz

Active Member
Licensed User
Longtime User
Perfect!
Soon I will share a creation that makes OCR given the coordinates of the screen.
It uses tessaract (command line) and is very simple to implement.
PS: How do I change this thread as [SOLVED]?
 
Upvote 0
Top