Posted by: Gerald Sison | on April 17, 2016
How to create image in custom view?. Sample script please…
Posted in Lightning Launcher Users: Discussion / Ask here | 2 Comments » Tags: Gerald Sison
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;
Thanks you. it works. 🙂
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
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;
Thanks you. it works. 🙂