I have used the code below to open jpg image.
There is no problem to open not large image.
But I can not open (load into ImageView) large image (w:7800, h:7400).
Please is there a way to load large image into ImageView with B4J ?
My code:
There is no problem to open not large image.
But I can not open (load into ImageView) large image (w:7800, h:7400).
Please is there a way to load large image into ImageView with B4J ?
My code:
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Button1 As Button
Dim directory, fileName As String
Private ImageView1 As ImageView
Private P_imag As Pane
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
End Sub
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub Button1_Click
Dim fc As FileChooser
fc.Initialize
fc.InitialDirectory = File.DirApp
fc.SetExtensionFilter("Layouts",Array("*.jpg"))
fc.Title = "photo"
Dim f As String = fc.ShowOpen(MainForm)
directory = File.GetFileParent(f)
fileName = File.GetName(f)
Dim bmp As Image = fx.LoadImage(directory,fileName)
If f <> "" Then
ImageView1.SetImage(bmp)
ImageView1.SetSize(bmp.Width, bmp.Height)
End If
End Sub