Im

2 posts, 1 answers
  1. Dimitar
    Dimitar avatar
    45 posts
    Member since:
    May 2014

    Posted 27 Aug Link to this post

    as a result from image-cache I have an Image class  . When I trace is  : android.graphics.Bitmap@20e949 . I am trying to save it as file on local , but I it seems I am doing mistake . There are some examples, but most of them using camera imageAsset .

    So I am trying something like this where image is result from casheImage.push , which is android.graphics.Bitmap@20e949 .  

    let source2 = new imageSource.ImageSource();
    source2.fromAsset(image).then((source2) =>
    {
        
        let folder2 = fs.knownFolders.documents().path;                                   
        let path2 = fs.path.join(folder2, self._imageSrc);
        let saved2 = source2.saveToFile(path, "png");
        if(saved2){
            console.log("Saved image To Hard Disk Local Cashe") ;
        }
    })
  2. Answer
    nikolay.tsonev
    Admin
    nikolay.tsonev avatar
    287 posts

    Posted 28 Aug Link to this post

    Hi Dimitar,

    I investigate your scenario and found that you could use fromNativeSource method provided by ImageSource module. It will allow you to create a NativeScript image source object from the native image object.
    Regarding that for more info about the method and expected input params, please review the above-attached link.

    Best Regards,
    nikolay.tsonev
    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Back to Top