androidimageviewappceleratorandroid-bitmapappcelerator-hyperloop

Using an Android Bitmap in Hyperloop


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?


Solution

  • 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);