-
Notifications
You must be signed in to change notification settings - Fork 4
/
InsetRectMaskGen.b4j
executable file
·49 lines (46 loc) · 1.21 KB
/
InsetRectMaskGen.b4j
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
AppType=JavaFX
Build1=Default,org.xulihang.imagetrans
Group=Default Group
Library1=javaobject
Library10=jbitmapcreator
Library2=jcore
Library3=jfx
Library4=jokhttputils2
Library5=json
Library6=jstringutils
Library7=jxmlsax
Library8=jxui
Library9=xmlbuilder
Module1=InsetRectMaskGenPlugin
NumberOfFiles=0
NumberOfLibraries=10
NumberOfModules=1
Version=8.9
@EndOfDesignText@
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
Sub Process_Globals
Private fx As JFX
Public MainForm As Form
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
Dim n As InsetRectMaskGenPlugin
n.Initialize
Dim box As Map
box.Initialize
Dim img As Image=fx.LoadImage(File.DirApp,"1.jpg")
wait for (n.genMask(img,box,5)) complete (result As B4XBitmap)
Dim out As OutputStream
out=File.OpenOutput(File.DirApp,"mask.png",False)
result.WriteToStream(out,100,"PNG")
out.Close
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub