This is a migrated thread and some comments may be shown as answers.

Im

1 Answer 107 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dimitar
Top achievements
Rank 1
Dimitar asked on 27 Aug 2017, 07:58 PM

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") ;
    }
})

1 Answer, 1 is accepted

Sort by
0
Accepted
Nikolay Tsonev
Telerik team
answered on 28 Aug 2017, 05:49 AM
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.
Tags
General Discussion
Asked by
Dimitar
Top achievements
Rank 1
Answers by
Nikolay Tsonev
Telerik team
Share this question
or