Android Question Using files from res\drawable folder

Smee

Well-Known Member
Licensed User
Longtime User
Hi,

If i have png files in this folder rather than the files folder how can i address them when using as a bitmap? I have tried various metods but none seem to work
B4X:
 If File.Exists("",image.png) Then
bmpName = LoadBitmapSample("", "image.png", 200dip, 200dip)


If File.Exists("../res/drawable/",image.png) Then
bmpName = LoadBitmapSample("../res/drawable/", "image.png", 200dip, 200dip)

Where can i find the correct syntax for addressing various methods of using files in this directory

Many Thanks
 

Smee

Well-Known Member
Licensed User
Longtime User

Thanks for the reply, I have read that thread and found a partial solution here https://www.b4x.com/android/forum/threads/androidresources.16847/
However i understood that to keep memory resources down i need to use loadBitmapSample so that is what I am trying to do

I am putting the images into that folder because there are so many of them and i thought it would be a "tidier" solution. Not correct?
Thanks again for the reply

EDIT:
When i say "tidier" solution I do not ant to see 40 or 50 image files in the "files" tab of the IDE and To include them in the project I have to do that no?

Edit2 I realise I can drop them straight into the files folder without having to include them in the files tab but i get loads of warnings in the log, just looks messy
 
Last edited:
Upvote 0
Top