-
Notifications
You must be signed in to change notification settings - Fork 4
/
ExternalInpaint.b4j
executable file
·48 lines (44 loc) · 1.22 KB
/
ExternalInpaint.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
AppType=JavaFX
Build1=Default,org.xulihang.imagetrans
Group=Default Group
Library1=jcore
Library2=jfx
Library3=json
Library4=jxmlsax
Library5=xmlbuilder
Library6=jxui
Library7=javaobject
Library8=jokhttputils2
Library9=jstringutils
Module1=ExternalInpaintPlugin
NumberOfFiles=0
NumberOfLibraries=9
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 ExternalInpaintPlugin
n.Initialize
Dim origin As Image=fx.LoadImage(File.DirApp,"1.jpg")
Dim mask As Image=fx.LoadImage(File.DirApp,"mask.png")
wait for (n.inpaint(origin,mask)) complete (result As B4XBitmap)
Dim out As OutputStream
out=File.OpenOutput(File.DirApp,"removed.jpg",False)
result.WriteToStream(out,100,"JPEG")
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