How to create image in custom view?. Sample script please…

How to create image in custom view?. Sample script please…

2 Commentsto How to create image in custom view?. Sample script please…

  1. Jay M says:

    LL.bindClass(“android.widget.ImageView”);

    LL.bindClass(“android.graphics.Bitmap”);

    var mctx = LL.getContext();

    // image path

    var path = “replace with path”;

    var createImg = LL.createImage(path);

    var getImg = createImg.getBitmap();

    var createBmp = Bitmap.createBitmap(getImg);

    var iv = new ImageView(mctx);

    iv.setImageBitmap(createBmp);

    iv.setScaleType(ImageView.ScaleType.CENTER_INSIDE);

    return iv;

  2. Gerald Sison says:

    Thanks you. it works. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *