Java Question Need Library get Bitmap from URI

Steini1980

Active Member
Licensed User
Longtime User
Could somebody help me and create a small library that opens an URI (e.g. Content://xxxx) and returns the content as Bitmap? The Content URI Provides the Bitmap directly, not as table data.

The Lib contains just something like this: Function getBmp(Parameter: URI) Return BMP

B4X:
InputStream istr = contentResolver.openInputStream(uri);
BufferedInputStream buf_istr = new BufferedInputStream(istr, 8192);
Bitmap bm = BitmapFactory.decodeStream(buf_istr);
 

barx

Well-Known Member
Licensed User
Longtime User
Why not create it yourself if you know the code? Is that the statements required for the function?
 

Steini1980

Active Member
Licensed User
Longtime User
But I have no expierence with Java and no development environment installed. The code lines I have copied from demo app.

If not possible to return the data as bitmap, then as stream or something I can import and save as picture in b4a.




 
Top