Using an Android Bitmap in Hyperloop

119 Views Asked by At

I have create a Android Bitmap (android.graphics.Bitmap) object in Hyperloop code, but I need to be able to return the image and display it in Titanium, for example in an Ti.UI.ImageView.

But I am stuck at trying to display it. The Android code seems to work and generates a bitmap( I can see the width/height etc) but I cannot find a way of converting the bitmap to a suitable object for use in Titanium so it displays

Does anyone know how/if this can be done?

2

There are 2 best solutions below

1
On BEST ANSWER

Have a look at the hyperloop-examples at: https://github.com/appcelerator/hyperloop-examples/blob/master/app/controllers/android/blur.js

There you have Bitmap that is added to an ImageView and Ti.UI.View at the end:

// create imageview and attach it
var image = new ImageView(activity);
container.add(image);
image.setImageBitmap(bmpOut);
0
On

I have been trying to find a way of viewing PDFs in a Titanium Android app I am developing using my own custom ES6 Framework. With help from miga I managed to solve the problem, the resulting PDFViewer class can be found in this gist

https://gist.github.com/magnatronus/6e4c35abc6556b690795c7f002c934cd