Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Getting file Stream with PhotoKit framework on Xamarin.IOS

$
0
0

Hi

I was trying to get file stream by using the photokit framework on Xamarin.IOS.

PHFetchResult fetchResults = PHAsset.FetchAssets(PHAssetMediaType.Image, null);

        for (int i = 0; i < fetchResults.Count; i++)
        {
            //fetching Result
            PHAsset phAsset = (PHAsset)fetchResults[i];
            String fileName = (NSString)phAsset.ValueForKey((NSString)"filename");
             PHImageManager.DefaultManager.RequestImageData(phAsset, null, (data, dataUti, orientation, info) => {
                var path = (info?[(NSString)@"PHImageFileURLKey"] as NSUrl).FilePathUrl;
             Stream stream = System.IO.OpenRead((String)path);  
        });

But It returned to the FileNotFoundException.
Please help me to get file stream.

Thanks


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>