goron Member Licensed User Longtime User Jan 15, 2015 #1 Dialogs & Images I would like to show the selected image ( .png .jpg - etc ) as "ICON" as can be seen below : Dim ICON As Bitmap Icon.Initialize(File.DirAssets, "android48.png") Dim Action As Int = FileDialog1.Show("Select a file:", "OK", "Cancel", "", ICON) When the textbox shows its name (file name), and before (OK, Cancel) button is pressed. Replacing the ICON with the updated image, or create another view for it. TIA, Gideon
Dialogs & Images I would like to show the selected image ( .png .jpg - etc ) as "ICON" as can be seen below : Dim ICON As Bitmap Icon.Initialize(File.DirAssets, "android48.png") Dim Action As Int = FileDialog1.Show("Select a file:", "OK", "Cancel", "", ICON) When the textbox shows its name (file name), and before (OK, Cancel) button is pressed. Replacing the ICON with the updated image, or create another view for it. TIA, Gideon
Erel B4X founder Staff member Licensed User Longtime User Jan 15, 2015 #2 You will need to use a non-modal dialog for this. Check this solution: https://www.b4x.com/android/forum/threads/class-file-explorer-with-visualization.19003/#content Upvote 0
You will need to use a non-modal dialog for this. Check this solution: https://www.b4x.com/android/forum/threads/class-file-explorer-with-visualization.19003/#content
goron Member Licensed User Longtime User Jan 16, 2015 #3 I thought a small change (Dialogs lib v2.94) is needed to show the selected image. FileExplorer v21 is quite "heavy" for this task and uses: Animation lib Reflection lib ScrollView2D lib 10x !, Gideon Upvote 0
I thought a small change (Dialogs lib v2.94) is needed to show the selected image. FileExplorer v21 is quite "heavy" for this task and uses: Animation lib Reflection lib ScrollView2D lib 10x !, Gideon
ivan.tellez Active Member Licensed User Longtime User Jan 16, 2015 #4 goron said: FileExplorer v21 is quite "heavy" Click to expand... Its a class, you have the source code, rewrite the parts you dont like. Upvote 0
goron said: FileExplorer v21 is quite "heavy" Click to expand... Its a class, you have the source code, rewrite the parts you dont like.
goron Member Licensed User Longtime User Jan 17, 2015 #5 Thanks Ivan, I found Treeview Class (Tree and Node) written by Derez works fine with the minimal change! (In blue) Now, I can see the image before it selected! Just in case anyone is interested: Main: 'here if you want to put the specific icon of the file as a bitmap, 'create a map of all file extensions and their icons, then check the extension of st and set : da.imgflag = 4 : da.bmp = [icon] Da.imgflag = tr.FILE_IMG Da.imgdir = dir Da.imgfile = st Log(dir & " : " & st) ' just 4 test Tree module: Case FILE_IMG ' =2 tbmp = fileimg If Da.imgfile.EndsWith(".jpg") OR Da.imgfile.EndsWith(".png") Then tbmp = LoadBitmap(Da.imgdir,Da.imgfile) End If Upvote 0
Thanks Ivan, I found Treeview Class (Tree and Node) written by Derez works fine with the minimal change! (In blue) Now, I can see the image before it selected! Just in case anyone is interested: Main: 'here if you want to put the specific icon of the file as a bitmap, 'create a map of all file extensions and their icons, then check the extension of st and set : da.imgflag = 4 : da.bmp = [icon] Da.imgflag = tr.FILE_IMG Da.imgdir = dir Da.imgfile = st Log(dir & " : " & st) ' just 4 test Tree module: Case FILE_IMG ' =2 tbmp = fileimg If Da.imgfile.EndsWith(".jpg") OR Da.imgfile.EndsWith(".png") Then tbmp = LoadBitmap(Da.imgdir,Da.imgfile) End If
ivan.tellez Active Member Licensed User Longtime User Jan 18, 2015 #6 goron said: I found Treeview Class Click to expand... Its actually easier, with the standard ListView. Code: Private bfile_pic As Bitmap Private ListFiles As ListView 'Initialize the icons bfile_pic.Initialize(File.DirAssets, "file_pic.png") 'Then, use the icons ListFiles.AddTwoLinesAndBitmap2("File Name", "File Type", FileIco, "File Name") Upvote 0
goron said: I found Treeview Class Click to expand... Its actually easier, with the standard ListView. Code: Private bfile_pic As Bitmap Private ListFiles As ListView 'Initialize the icons bfile_pic.Initialize(File.DirAssets, "file_pic.png") 'Then, use the icons ListFiles.AddTwoLinesAndBitmap2("File Name", "File Type", FileIco, "File Name")
Informatix Expert Licensed User Longtime User Jan 18, 2015 #7 goron said: I thought a small change (Dialogs lib v2.94) is needed to show the selected image. FileExplorer v21 is quite "heavy" for this task and uses: Animation lib Reflection lib ScrollView2D lib 10x !, Gideon Click to expand... The three libraries total up 60 kb so I'm not sure to understand the argument here. Upvote 0
goron said: I thought a small change (Dialogs lib v2.94) is needed to show the selected image. FileExplorer v21 is quite "heavy" for this task and uses: Animation lib Reflection lib ScrollView2D lib 10x !, Gideon Click to expand... The three libraries total up 60 kb so I'm not sure to understand the argument here.