Hi All,
Below is a Sub for selecting and displaying images. [Many thanks to jmon and DonManfred] The Images are screen Snapshots and can be of any size. Theoretically FormLV should be the same size as the window from which the Image was created. The screenshot image attached shows this is not correct.
Any advice on correctly setting the size of the Form?
Regards Roger
Below is a Sub for selecting and displaying images. [Many thanks to jmon and DonManfred] The Images are screen Snapshots and can be of any size. Theoretically FormLV should be the same size as the window from which the Image was created. The screenshot image attached shows this is not correct.
Any advice on correctly setting the size of the Form?
B4X:
Sub FileSelect
'Create the modal form:
FormLV.Initialize("", 300, 500)
FormLV.SetFormStyle("UTILITY")
Private fc As FileChooser
fc.Initialize
fc.Title = $"Saved Files"$
fc.InitialDirectory = DirPath
Filename1 = fc.ShowOpen(MainForm)
Filename1 = Filename1.Replace(DirPath, "")
FormLV.Title = Filename1
If Filename1 <> "" Then
Private im As Image
im.initialize(DirPath, Filename1)
Log(im.Height)
Log(im.Width)
FormLV.WindowWidth = im.Width
FormLV.WindowHeight = im.Height
FormLV.RootPane.Style = "-fx-background-image: url('" & File.GetUri(DirPath, Filename1) & "');"
FormLV.Show
End If
End Sub
Regards Roger