How to store a PNG Image on a string

EduardoElias

Active Member
Licensed User
Longtime User
Since it is not possible to load as a resource the png files on a library, I was wondering if there is a way to code/encode a string to use as a png for buttons and other places where needs small images.

I think i need to create an app that have the images and create the encoded string, than copy this string to be used on the source code. How to do that?

And the opposite getting these string and make then a png to be used on a button.

Is there b4a supported functions for those things?
 

EduardoElias

Active Member
Licensed User
Longtime User
Thanks for answer,

I was mentioning the new compile to library function.

If i am not doing a mistake, I read that it is not possible to store any files/resources. It is part of the project for an apk.

This is the reason I was looking for a guidance on using an alternative way. I am not doing java libraries.
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
Although I havent tried it (and I cant because my environ isnt set up), are you saying that loading pngs from DirAssets will not work once a class is compiled to a library? Have you tried it?
There is a second alternative if that does not work, you can load the png from resources if you store it under Objects/res/drawable.
See here but may I warn you it is not so simple for the first timers.
 
Upvote 0
Top