Android Question Help me with "ScaleImageView" Demo

NGUYEN TUAN ANH

Member
Licensed User
I have downloaded ScaleImageView_v2.00.zip and Tested your demo "ScaleImageView"
I'm using AVD elmulate 4in_Phone_Platform_28_Default
But I don't know where to create the folder DT on my computer's hard drive to copy the image file to it
In case I put the image file into tab files, is it okay and how to do in code ?
If I use B4A Bridge to connect to my phone, then where on the phone to copy the image file
i'm new user, please help me, thank you very much !
 

NGUYEN TUAN ANH

Member
Licensed User
The only place to put files that should be included in the project is in the Files tab in the IDE. You can then load them from File.DirAssets at runtime.
I'm have puted files "in_1m_a.jpg" into the Files tab in the IDE
I'm codding
in Start Modul:
Public ViewerFolder As String = File.DirAssets
Public ViewerFilename As String = "in_1m_a.jpg"

in Viewer Modul:
ScaleImageView1.ImageFile = Starter.ViewerFolder & Starter.ViewerFilename
Dim loops As Int = 1
Do Until ScaleImageView1.IsReady
Sleep(100)
loops = loops + 1
If loops > 100 Then ' give it up to 10 seconds
Exit
End If
Loop
But, no image display in ScaleImageView1
Please help me !
 

agraham

Expert
Licensed User
B4X:
Public ViewerFolder As String = File.DirAssets
...
ScaleImageView1.ImageFile = Starter.ViewerFolder & Starter.ViewerFilename
This won't work. File.DirAssets is a special folder and only works with File.OpenInput, it cannot be concatenated to form a path to a file. I guess you haven't bothered to read the Readme.txt file in the demo. I suggest that you do so now!
 

NGUYEN TUAN ANH

Member
Licensed User
B4X:
Public ViewerFolder As String = File.DirAssets
...
ScaleImageView1.ImageFile = Starter.ViewerFolder & Starter.ViewerFilename
This won't work. File.DirAssets is a special folder and only works with File.OpenInput, it cannot be concatenated to form a path to a file. I guess you haven't bothered to read the Readme.txt file in the demo. I suggest that you do so now!
Thanks Mr. Agraham, i have read Readme.txt carfully
I know, Public ViewerFolder As String = File.DirRootExternal & "/Download/"
But i don't know, If i user AVD elmulate then File.DirRootExternal will corresponding to which local folder on my computer
and, If i user B4A Bridge to connect to my phone (no external memory card) then File.DirRootExternal will corresponding to which local folder on my phone
 

NGUYEN TUAN ANH

Member
Licensed User
1. No folder on your PC is accessible to the emulator.

2. You need to explain us what you are trying to do.
Thanks Mr. Erel, I explain you as follow:
I have an image file "tx1.jpg" with dimension 11000pixel x 15000pixel in my computer "D:\temp\tx1.jpg"
I want to use ScaleImageView library to display in layout
I use:
Dim ViewerFolder As String = File.DirRootExternal & "/Download/"
Dim ViewerFilename As String = "tx1.jpg"
ScaleImageView1.ImageFile = ViewerFolder & ViewerFilename
But i don't know how to copy "D:\temp\tx1.jpg" to File.DirRootExternal & "/Download/"
I don't know how to open Files Explorer with AVD to copy tx1.jpg file fromt "D:\temp" to SdCard of AVD
Could you please help me !
 
Top