Rezise of image using bitimage is problamatic

plugins

#1

since im liitle new to nativescript im not getting how to resize image. i have worked a little but not got answer please check here.

i want product image to be resized…


#2

Some plugins may not be compatible with Playground, nativescript-bitmap-factory seems to only work if you import it as below (only valid for playground)

var BitmapFactory = require("../nativescript-bitmap-factory");

Here is another thread that has sample code for resizing image with same plugin


#3

The above link I went through. But it’s not a full example. I know they are resizing with some code. But I don’t know exactly how they calling and setting the image in XML and there example is very weird. And in there js very fewer details are there. So I created playground example where a image in products folder needs to be resize. Please update the mistakes in playground sample. So that any image will shrink to tiny image. Thank u in advance


#4


im not getting result though i follwed their approach. kindly look at this…


#5

Use a image source instead of path, you can create image source from path.

https://docs.nativescript.org/ns-framework-modules/image-source


#6

really i am making a mistake. i dont know where … as u said i used image source and now im gettinh some result but it was blank… sorry for wrong playground setup earlier. u can check this now where im getting a blank result.

please reduce the size of the given image and display it in xml…

im not getting how to use imagemodules everything they provided was not working properly for me. that documentation is not easy … please look at my code & modify something


#7

Everything you need is already there in the {N} docs and plugin’s read me file. All you have to do is just spend little time in reading them.

  1. ~ denotes current app folder so you don’t have to do get current app path and join it with your file path.
  2. Use makeMutable function to make sure image source is usable. The other thread I linked above also talks about this.